-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: licensed seats sidebar (#8834)
Currently mock data, next step is to create chart and connect to backend. ![image](https://github.com/user-attachments/assets/4b91a3ea-b42a-4c6e-b953-803ff5765c07)
- Loading branch information
Showing
2 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
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
122 changes: 122 additions & 0 deletions
122
frontend/src/component/admin/users/UsersHeader/LicensedUsersSidebar.tsx
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,122 @@ | ||
import { Alert, Button, styled, Typography } from '@mui/material'; | ||
import { DynamicSidebarModal } from 'component/common/SidebarModal/SidebarModal'; | ||
import type React from 'react'; | ||
const ModalContentContainer = styled('section')(({ theme }) => ({ | ||
minHeight: '100vh', | ||
maxWidth: 700, | ||
width: '95vw', | ||
backgroundColor: theme.palette.background.default, | ||
display: 'flex', | ||
flexFlow: 'column', | ||
gap: theme.spacing(4), | ||
paddingInline: theme.spacing(4), | ||
paddingBlock: theme.spacing(3.75), | ||
})); | ||
|
||
const WidgetContainer = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: theme.spacing(9), | ||
})); | ||
|
||
const HeaderRow = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: theme.spacing(1.5), | ||
})); | ||
|
||
const ModalHeader = styled('h3')(({ theme }) => ({ | ||
fontSize: theme.typography.h2.fontSize, | ||
margin: 0, | ||
fontWeight: theme.typography.h4.fontWeight, | ||
})); | ||
|
||
const RowHeader = styled('h4')(({ theme }) => ({ | ||
margin: 0, | ||
fontWeight: theme.typography.h4.fontWeight, | ||
fontSize: theme.spacing(1.75), | ||
})); | ||
|
||
const Row = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: theme.spacing(2), | ||
})); | ||
|
||
const CloseRow = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
justifyContent: 'flex-end', | ||
marginBlockStart: 'auto', | ||
gap: theme.spacing(4), | ||
})); | ||
|
||
const InfoRow = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
gap: theme.spacing(2), | ||
width: '100%', | ||
})); | ||
|
||
const LicenceBox = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
width: '100%', | ||
background: theme.palette.background.elevation1, | ||
padding: theme.spacing(3, 2, 3, 2), | ||
borderRadius: theme.shape.borderRadiusLarge, | ||
})); | ||
|
||
type LicensedUsersSidebarProps = { | ||
open: boolean; | ||
close: () => void; | ||
}; | ||
|
||
export const LicensedUsersSidebar = ({ | ||
open, | ||
close, | ||
}: LicensedUsersSidebarProps) => { | ||
return ( | ||
<DynamicSidebarModal | ||
open={open} | ||
onClose={close} | ||
label='Project status' | ||
onClick={(e: React.SyntheticEvent) => { | ||
if (e.target instanceof HTMLAnchorElement) { | ||
close(); | ||
} | ||
}} | ||
> | ||
<ModalContentContainer> | ||
<HeaderRow> | ||
<ModalHeader>Licensed seats</ModalHeader> | ||
</HeaderRow> | ||
<WidgetContainer> | ||
<Row> | ||
<RowHeader>Last 30 days</RowHeader> | ||
<InfoRow> | ||
<LicenceBox> | ||
<Typography fontWeight='bold'>11/25</Typography> | ||
<Typography variant='body2'> | ||
Used seats last 30 days | ||
</Typography> | ||
</LicenceBox> | ||
<Alert severity='info'> | ||
A licensed seat is a unique user that had access | ||
to your Unleash instance within the last 30 | ||
days, and thereby occupied a seat. | ||
</Alert> | ||
</InfoRow> | ||
</Row> | ||
<Row> | ||
<RowHeader>Last year</RowHeader> | ||
<div>this will be great grid</div> | ||
</Row> | ||
</WidgetContainer> | ||
<CloseRow> | ||
<Button variant='outlined' onClick={close}> | ||
Close | ||
</Button> | ||
</CloseRow> | ||
</ModalContentContainer> | ||
</DynamicSidebarModal> | ||
); | ||
}; |