fixing getting room photos, reworking how routing works, added jotai for state management
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user