updating frontend to new standards
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Text, Button, Card, Group, Menu, Image, Badge } from '@mantine/core'
|
||||
import { useAtom } from 'jotai';
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { activePageAtom, roomFilterAtom, serverConfigAtom } from '../../state/state';
|
||||
// import { useNavigate } from "react-router-dom";
|
||||
import { serverConfigAtom } from '../../state/state';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ import { Link } from 'react-router-dom';
|
||||
function LocationCard(props) {
|
||||
const {location, idx} = props
|
||||
const [serverConfig] = useAtom(serverConfigAtom)
|
||||
const [, setRoomsFilter] = useAtom(roomFilterAtom)
|
||||
const [, setActivePage] = useAtom(activePageAtom)
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const setRoomNumber = (rooms) => {
|
||||
if (rooms === null) {
|
||||
@@ -25,11 +21,6 @@ function LocationCard(props) {
|
||||
}
|
||||
}
|
||||
|
||||
const navigateToRooms = (locationID, locationName) => {
|
||||
setActivePage("rooms")
|
||||
setRoomsFilter({"filterType": "location", "locationID": locationID, "commonName": "location", "metadata": locationName})
|
||||
navigate("/rooms")
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
@@ -51,9 +42,8 @@ function LocationCard(props) {
|
||||
</Badge>
|
||||
</Group>
|
||||
<Text size="sm">{location.Description}</Text>
|
||||
<Group>
|
||||
<Button component={Link} to={`/locations/${location.ID}`} state={{ location: location }}>View Details</Button>
|
||||
<Button onClick={() => navigateToRooms(location.ID, location.Name)}>View Rooms</Button>
|
||||
<Group position='right' mt="xl">
|
||||
<Button component={Link} to={`/locations/${location.ID}`} state={{ location: location }}>View Location Details</Button>
|
||||
</Group>
|
||||
</Card>
|
||||
);
|
||||
|
Reference in New Issue
Block a user