fix rent initial values
This commit is contained in:
@@ -25,7 +25,7 @@ function App() {
|
||||
const [selectedRoom, setSelectedRoom] = useState();
|
||||
const [numAdults, setNumAdults] = useState();
|
||||
|
||||
const [rent, setRent] = useState();
|
||||
const [rent, setRent] = useState(0);
|
||||
const [flatRent, setFlatRent] = useState();
|
||||
|
||||
const theme = extendTheme({
|
||||
|
||||
@@ -220,7 +220,7 @@ export function SelfEvaluationCard({ rent, setRent }) {
|
||||
const [sliderValue, setSliderValue] = useState(30)
|
||||
const [showTooltip, setShowTooltip] = useState(false)
|
||||
|
||||
const [income, setIncome] = useState(1000)
|
||||
const [income, setIncome] = useState(0)
|
||||
|
||||
const formatEuro = (val) => val + ' €';
|
||||
const parseEuro = (val) => val.replace(/^€/, '')
|
||||
@@ -299,8 +299,7 @@ export function ResultsCard({ rent, flat, room, numAdults, flatRent }) {
|
||||
var body = <CardBody></CardBody>
|
||||
if (flat && (room || flat.wgRoomList.length === 0) && flatRent) {
|
||||
var totalSize = flat.calcTotalPayedArea(room)
|
||||
var kitchenCost = flat.wgRoomList.length > 0 ? 50 / flat.wgRoomList.length : 50;
|
||||
var relativeRent = (rent - kitchenCost - (60 * numAdults)) / totalSize;
|
||||
var relativeRent = (rent) / totalSize;
|
||||
|
||||
var rangePosition = ((rent - flatRent.min) / (flatRent.maxCovering - flatRent.min)) * 100;
|
||||
if (rangePosition < 0) { rangePosition = 0; }
|
||||
|
||||
Reference in New Issue
Block a user