Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: App Dashboard Facelift #163

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
alert component theming
brightiron committed Oct 12, 2022
commit a849abbf5d8dcac55c261f731359184e03f25ff9
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { Alert } from '@mui/material'

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'WIP/Alert',
title: 'Components/Alert',
component: Alert,
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
parameters: {}
@@ -17,8 +17,11 @@ const Template: ComponentStory<typeof Alert> = (args) => <Alert {...args} />
export const Default = () => (
<>
<Alert severity="error">This is an error alert — check it out!</Alert>
<br />
<Alert severity="warning">This is a warning alert — check it out!</Alert>
<br />
<Alert severity="info">This is an info alert — check it out!</Alert>
<br />
<Alert severity="success">This is a success alert — check it out!</Alert>
</>
)
10 changes: 8 additions & 2 deletions frontend/src/theme/colorPalette.ts
Original file line number Diff line number Diff line change
@@ -39,10 +39,16 @@ export const colors = {
},
success: {
700: '#027A48',
50: '#ECFDF3'
600: '#039855',
300: '#6CE9A6',
50: '#ECFDF3',
25: '#F6FEF9'
},
warning: {
700: '#B54708',
50: '#FFFAEB'
600: '#DC6803',
300: '#FEC84B',
50: '#FFFAEB',
25: '#FFFCF5'
}
}
3 changes: 2 additions & 1 deletion frontend/src/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ export const lightTheme = createTheme({
MuiPagination: MuiComponentConfig.Pagination,
MuiModal: MuiComponentConfig.Modal,
MuiDialog: MuiComponentConfig.Dialog,
MuiSlider: MuiComponentConfig.Slider
MuiSlider: MuiComponentConfig.Slider,
MuiAlert: MuiComponentConfig.Alert
}
})
56 changes: 56 additions & 0 deletions frontend/src/theme/muiComponentConfig/MuiAlert.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Components } from '@mui/material'
import { colors } from '../colorPalette'

export const MuiAlert: Components['MuiAlert'] = {
styleOverrides: {
root: {
'& .MuiAlert-message': {
fontSize: '14px'
}
},
standardError: {
backgroundColor: colors.error[25],
border: `1px solid ${colors.error[300]}`,
borderRadius: '8px',
'& .MuiAlert-message': {
color: colors.error[600]
},
'& .MuiAlert-icon': {
color: colors.error[600]
}
},
standardWarning: {
backgroundColor: colors.warning[25],
border: `1px solid ${colors.warning[300]}`,
borderRadius: '8px',
'& .MuiAlert-message': {
color: colors.warning[600]
},
'& .MuiAlert-icon': {
color: colors.warning[600]
}
},
standardInfo: {
backgroundColor: colors.gray[25],
border: `1px solid ${colors.gray[300]}`,
borderRadius: '8px',
'& .MuiAlert-message': {
color: colors.gray[700]
},
'& .MuiAlert-icon': {
color: colors.gray[700]
}
},
standardSuccess: {
backgroundColor: colors.success[25],
border: `1px solid ${colors.success[300]}`,
borderRadius: '8px',
'& .MuiAlert-message': {
color: colors.success[600]
},
'& .MuiAlert-icon': {
color: colors.success[600]
}
}
}
}
4 changes: 3 additions & 1 deletion frontend/src/theme/muiComponentConfig/index.ts
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import { MuiDialogConfig } from './MuiDialog'
import { MuiModalConfig } from './MuiModal'
import { MuiPaginationConfig } from './MuiPagination'
import { MuiSliderConfig } from './MuiSlider'
import { MuiAlert } from './MuiAlert'

export const MuiComponentConfig = {
Button: MuiButtonConfig,
@@ -23,5 +24,6 @@ export const MuiComponentConfig = {
Dialog: MuiDialogConfig,
Modal: MuiModalConfig,
Pagination: MuiPaginationConfig,
Slider: MuiSliderConfig
Slider: MuiSliderConfig,
Alert: MuiAlert
}