diff --git a/public/favicon.ico b/public/favicon.ico index a11777c..c668d65 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/App.js b/src/App.js index 36df68e..ea4b9dd 100644 --- a/src/App.js +++ b/src/App.js @@ -2,12 +2,7 @@ import { React, useState } from 'react'; import { ChakraProvider, - Box, Text, - Link, - VStack, - Code, - Grid, theme, Select, Card, @@ -15,7 +10,10 @@ import { Heading, CardBody, Center, + SimpleGrid, } from '@chakra-ui/react'; + +import { FlatDetails } from './Solimieten'; import { ColorModeSwitcher } from './ColorModeSwitcher'; import { flatData } from './Data'; @@ -23,6 +21,7 @@ function App() { const [levelOptions, setLevelOption] = useState([{ value: 0, label: "EG" }, { value: 1, label: "1. OG" }, { value: 2, label: "2. OG" }, { value: 3, label: "3. OG" }]); const [flatOptions, setFlatOptions] = useState([]); const [selectedBuilding, setSelectedBuilding] = useState(); + const [selectedFlat, setSelectedFlat] = useState(); function buildingSelected(e) { var newOptions; @@ -42,28 +41,38 @@ function App() { setFlatOptions(flatData[selectedBuilding][e.target.value]); } } + + function flatSelected(e) { + var index = e.target.value; + + setSelectedFlat(flatOptions[index]); + } + return (
- - - Wohnungsauswahl - - - View a summary of all your customers over the last month. - - - - - + + + + Wohnungsauswahl + + + View a summary of all your customers over the last month. + + + + + + +
); diff --git a/src/Solimieten.js b/src/Solimieten.js new file mode 100644 index 0000000..486d952 --- /dev/null +++ b/src/Solimieten.js @@ -0,0 +1,73 @@ +import { + Card, + CardHeader, + Heading, + CardBody, + Stack, + StackDivider, + Box, + Text, + Badge +} from '@chakra-ui/react'; + +export function FlatDetails({ flat }) { + var body = + Bitte auswählen + ; + + var badges = ""; + + if (flat) { + body = + + } spacing='4'> + + + + Bezeichnung + + + {flat.name} + + + + + Zimmeranzahl + + + {flat.numRooms} + + + + + Private Fläche + + + {flat.sizePrivate} m² + + + + ; + + if (flat.isWbs) { + badges = + mit WBS + ; + } else { + badges = + ohne WBS + ; + } + } + + return ( + + + + {badges} + Wohnungsdetails + + {body} + + ); +}