-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Amy Chen <amy.chen@discordapp.com> Co-authored-by: Peter Collins <somethingnew2-0@users.noreply.github.com> Co-authored-by: Chip Bradford <cfbradford@gmail.com>
- Loading branch information
1 parent
1c1ff99
commit 0692187
Showing
40 changed files
with
2,053 additions
and
2,291 deletions.
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
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,33 @@ | ||
import {Avatar, ButtonBase, Typography} from '@mui/material'; | ||
import {ReactNode} from 'react'; | ||
|
||
interface AvatarButtonProps { | ||
icon: ReactNode; | ||
text?: string; | ||
strikethrough?: boolean; | ||
onClick?: () => void; | ||
} | ||
|
||
export default function AvatarButton({icon, text, strikethrough, onClick}: AvatarButtonProps) { | ||
return ( | ||
<ButtonBase | ||
disabled={onClick == null} | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: 0.5, | ||
p: 0.5, | ||
borderRadius: 2, | ||
width: 100, | ||
wordBreak: 'break-word', | ||
}} | ||
onClick={onClick}> | ||
<Avatar sx={{bgcolor: 'primary.main'}}>{icon}</Avatar> | ||
{text && ( | ||
<Typography variant="body2" sx={{...(strikethrough && {textDecoration: 'line-through'})}}> | ||
{text} | ||
</Typography> | ||
)} | ||
</ButtonBase> | ||
); | ||
} |
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,44 @@ | ||
import {darken, lighten, PaletteColor, styled} from '@mui/material'; | ||
import {DataGrid} from '@mui/x-data-grid'; | ||
|
||
const getHoverBackgroundColor = (color: PaletteColor, mode: string) => (mode === 'dark' ? color.dark : color.light); | ||
|
||
const getSelectedBackgroundColor = (color: PaletteColor, mode: string) => | ||
mode === 'dark' ? darken(color.dark, 0.5) : lighten(color.light, 0.5); | ||
|
||
const getSelectedHoverBackgroundColor = (color: PaletteColor, mode: string) => | ||
mode === 'dark' ? darken(color.dark, 0.4) : lighten(color.light, 0.4); | ||
|
||
const BulkRenewalDataGrid = styled(DataGrid)( | ||
({ | ||
theme: { | ||
palette: {highlight, mode}, | ||
}, | ||
}) => ({ | ||
'& .super-app-theme--Expired': { | ||
backgroundColor: highlight.danger.main, | ||
'&:hover': { | ||
backgroundColor: getHoverBackgroundColor(highlight.danger, mode), | ||
}, | ||
'&.Mui-selected': { | ||
backgroundColor: getSelectedBackgroundColor(highlight.danger, mode), | ||
'&:hover': { | ||
backgroundColor: getSelectedHoverBackgroundColor(highlight.danger, mode), | ||
}, | ||
}, | ||
}, | ||
'& .super-app-theme--Soon': { | ||
backgroundColor: highlight.warning.main, | ||
'&:hover': { | ||
backgroundColor: getHoverBackgroundColor(highlight.warning, mode), | ||
}, | ||
'&.Mui-selected': { | ||
backgroundColor: getSelectedBackgroundColor(highlight.warning, mode), | ||
'&:hover': { | ||
backgroundColor: getSelectedHoverBackgroundColor(highlight.warning, mode), | ||
}, | ||
}, | ||
}, | ||
}), | ||
); | ||
export default BulkRenewalDataGrid; |
Oops, something went wrong.