working on view location details page
This commit is contained in:
@@ -3,6 +3,7 @@ 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/main';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +35,7 @@ function LocationCard(props) {
|
||||
return (
|
||||
<Card key={`${idx} - ${location.ID}`} shadow="md" padding="md">
|
||||
<Card.Section>
|
||||
{location.CoverPhoto ? <Image src={`${serverConfig.baseURL}/photos/locations/${location.Name}/${location.CoverPhoto}`}></Image> : <Text>No Photo</Text>}
|
||||
{location.CoverPhoto ? <Image src={`${serverConfig.baseURL}/files/locations/${location.Name}/${location.CoverPhoto}`}></Image> : <Text>No Photo</Text>}
|
||||
<Group position='right' style={{position: 'absolute', top: '5px', right: '5px', backgroundColor: 'grey', borderRadius: '25%'}}>
|
||||
<Menu>
|
||||
<Menu.Label>Edit</Menu.Label>
|
||||
@@ -51,7 +52,7 @@ function LocationCard(props) {
|
||||
</Group>
|
||||
<Text size="sm">{location.Description}</Text>
|
||||
<Group>
|
||||
<Button onClick={() => navigateToRooms(location.ID, location.Name)}>View Details</Button>
|
||||
<Button component={Link} to={`/location/${location.ID}`} state={{ location: location }}>View Details</Button>
|
||||
<Button onClick={() => navigateToRooms(location.ID, location.Name)}>View Rooms</Button>
|
||||
</Group>
|
||||
</Card>
|
||||
|
Reference in New Issue
Block a user