fixing getting room photos, reworking how routing works, added jotai for state management

This commit is contained in:
2022-03-27 22:48:06 -04:00
parent 6ced49f5cd
commit 02a9c6c99c
9 changed files with 5425 additions and 9914 deletions

View File

@@ -1,4 +1,6 @@
import React, {useState } from 'react';
import { useAtom } from 'jotai';
import { activePageAtom } from '../state/main';
import { Navbar, Text, Group, ThemeIcon, Button, UnstyledButton } from '@mantine/core';
import { Link } from 'react-router-dom';
import { createStyles } from '@mantine/styles';
@@ -36,7 +38,7 @@ const useStyles = createStyles((theme) => ({
function SideBar(props) {
const { classes } = useStyles();
const [activePage, setActivePage] = useState("")
const [activePage, setActivePage] = useAtom(activePageAtom)
return (
@@ -59,7 +61,7 @@ function SideBar(props) {
</Group>
</UnstyledButton> */}
<UnstyledButton component={Link} to="/about" className={activePage === "rooms" ? classes.activeButton : classes.button} onClick={() => setActivePage("rooms")} >
<UnstyledButton component={Link} to="/rooms" className={activePage === "rooms" ? classes.activeButton : classes.button} onClick={() => setActivePage("rooms")} >
<Group>
<BsMap />
<Text>Rooms</Text>