-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIMS-1344: Properties Detailed View (#2214)
Co-authored-by: Dylan Barkowsky <37922247+dbarkowsky@users.noreply.github.com>
- Loading branch information
1 parent
1ac4ece
commit 43fde0f
Showing
14 changed files
with
595 additions
and
101 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import Icon from '@mdi/react'; | ||
import { Box, IconButton, Avatar, Typography, Button, ButtonProps, useTheme } from '@mui/material'; | ||
import { mdiArrowLeft } from '@mdi/js'; | ||
|
||
interface IDetailViewNavigation { | ||
navigateBackTitle: string; | ||
deleteTitle: string; | ||
onDeleteClick: () => void; | ||
onBackClick: () => void; | ||
deleteButtonProps?: ButtonProps; | ||
} | ||
|
||
const DetailViewNavigation = (props: IDetailViewNavigation) => { | ||
const theme = useTheme(); | ||
const { navigateBackTitle, deleteTitle, onDeleteClick, onBackClick, deleteButtonProps } = props; | ||
return ( | ||
<Box display={'flex'} alignItems={'center'}> | ||
<IconButton onClick={() => onBackClick()}> | ||
<Avatar | ||
style={{ color: 'white', backgroundColor: 'white' }} //For some reason this doesn't get applied if you do it in sx props. | ||
sx={{ border: '0.1px solid lightgray' }} | ||
> | ||
<Icon color="black" size={0.9} path={mdiArrowLeft} /> | ||
</Avatar> | ||
</IconButton> | ||
<Typography variant="h5">{navigateBackTitle}</Typography> | ||
<Button | ||
onClick={() => onDeleteClick()} | ||
sx={{ fontWeight: 'bold', color: theme.palette.warning.main, marginLeft: 'auto' }} | ||
{...deleteButtonProps} | ||
> | ||
{deleteTitle} | ||
</Button> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default DetailViewNavigation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import sideBarIcon from '@/assets/icons/SidebarLeft-Linear.svg'; | ||
import { | ||
Avatar, | ||
Box, | ||
CSSObject, | ||
Drawer, | ||
Icon, | ||
IconButton, | ||
ListItem, | ||
ListItemButton, | ||
ListItemText, | ||
Theme, | ||
useTheme, | ||
} from '@mui/material'; | ||
import React, { PropsWithChildren, useState } from 'react'; | ||
|
||
interface ISideBarItem { | ||
title: string; | ||
subTitle?: string; | ||
} | ||
|
||
type ICollapsibleSidebar = { | ||
items: ISideBarItem[]; | ||
} & PropsWithChildren; | ||
|
||
const CollapsibleSidebar = (props: ICollapsibleSidebar) => { | ||
const openWidth = '300px'; | ||
const closedWidth = 'calc(52px + 2rem)'; | ||
const openedMixin = (theme: Theme): CSSObject => ({ | ||
width: openWidth, | ||
transition: theme.transitions.create('width', { | ||
easing: theme.transitions.easing.sharp, | ||
duration: theme.transitions.duration.enteringScreen, | ||
}), | ||
overflowX: 'hidden', | ||
}); | ||
|
||
const closedMixin = (theme: Theme): CSSObject => ({ | ||
transition: theme.transitions.create('width', { | ||
easing: theme.transitions.easing.sharp, | ||
duration: theme.transitions.duration.leavingScreen, | ||
}), | ||
overflowX: 'hidden', | ||
width: closedWidth, | ||
}); | ||
|
||
const [drawerOpen, setDrawerOpen] = useState(true); | ||
const theme = useTheme(); | ||
return ( | ||
<Box> | ||
<Drawer | ||
variant="permanent" | ||
anchor="left" | ||
open={drawerOpen} | ||
sx={{ | ||
width: drawerOpen ? openWidth : closedWidth, | ||
flexShrink: 0, | ||
[`& .MuiDrawer-paper`]: { | ||
width: drawerOpen ? openWidth : closedWidth, | ||
boxSizing: 'border-box', | ||
}, | ||
...(drawerOpen && { | ||
...openedMixin(theme), | ||
'& .MuiDrawer-paper': openedMixin(theme), | ||
}), | ||
...(!drawerOpen && { | ||
...closedMixin(theme), | ||
'& .MuiDrawer-paper': closedMixin(theme), | ||
}), | ||
}} | ||
> | ||
<Box display={'flex'} sx={{ ml: '1rem', mt: '88px', mr: '1rem' }}> | ||
<IconButton onClick={() => setDrawerOpen(!drawerOpen)}> | ||
<Avatar | ||
style={{ | ||
backgroundColor: '#eee', | ||
height: 36, | ||
width: 36, | ||
}} | ||
> | ||
<Icon sx={{ mb: '2px' }}> | ||
<img | ||
height={18} | ||
width={18} | ||
src={sideBarIcon} | ||
style={{ transform: `rotate(${drawerOpen ? '3.142rad' : '0'})` }} | ||
/> | ||
</Icon> | ||
</Avatar> | ||
</IconButton> | ||
</Box> | ||
<Box> | ||
{drawerOpen && | ||
props.items.map((item) => ( | ||
<ListItem key={item.title}> | ||
<ListItemButton | ||
onClick={() => { | ||
const element = document.getElementById(item.title); | ||
const y = element.getBoundingClientRect().top + window.scrollY + -74; | ||
window.scrollTo({ top: y, behavior: 'smooth' }); | ||
}} | ||
> | ||
<ListItemText primary={item.title} secondary={item.subTitle} /> | ||
</ListItemButton> | ||
</ListItem> | ||
))} | ||
</Box> | ||
</Drawer> | ||
<Box ml={drawerOpen ? openWidth : closedWidth}>{props.children}</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default CollapsibleSidebar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { dateFormatter } from '@/utils/formatters'; | ||
import { DataGrid, GridColDef } from '@mui/x-data-grid'; | ||
import React from 'react'; | ||
|
||
const ParcelNetValueTable = () => { | ||
const columns: GridColDef[] = [ | ||
{ | ||
field: 'FiscalYear', | ||
headerName: 'Year', | ||
}, | ||
{ | ||
field: 'EffectiveDate', | ||
headerName: 'Effective Date', | ||
flex: 1, | ||
}, | ||
{ | ||
field: 'Value', | ||
headerName: 'Net Book Value', | ||
flex: 1, | ||
}, | ||
]; | ||
|
||
const testData = [ | ||
{ | ||
FiscalYear: '24/23', | ||
EffectiveDate: dateFormatter(new Date()), | ||
Value: '$34000000', | ||
}, | ||
{ | ||
FiscalYear: '23/22', | ||
EffectiveDate: dateFormatter(new Date()), | ||
Value: '$145000000', | ||
}, | ||
]; | ||
|
||
return ( | ||
<DataGrid | ||
sx={{ | ||
borderStyle: 'none', | ||
'& .MuiDataGrid-columnHeaders': { | ||
borderBottom: 'none', | ||
}, | ||
'& div div div div >.MuiDataGrid-cell': { | ||
borderBottom: 'none', | ||
borderTop: '1px solid rgba(224, 224, 224, 1)', | ||
}, | ||
}} | ||
hideFooter | ||
getRowId={(row) => row.FiscalYear} | ||
columns={columns} | ||
rows={testData} | ||
/> | ||
); | ||
}; | ||
|
||
export default ParcelNetValueTable; |
Oops, something went wrong.