-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #475 from Magickbase/develop
- Loading branch information
Showing
37 changed files
with
517 additions
and
186 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { AlertProps, SnackbarProps, Snackbar, Alert as MuiAlert } from '@mui/material' | ||
import { styled } from '@mui/material/styles' | ||
import CheckCircleIcon from '@mui/icons-material/CheckCircle' | ||
import CancelIcon from '@mui/icons-material/Cancel' | ||
import ErrorIcon from '@mui/icons-material/Error' | ||
|
||
const StyledSnackbar = styled((props: SnackbarProps) => <Snackbar {...props} />)(({ theme }) => ({ | ||
'&.MuiSnackbar-root': { | ||
top: theme.spacing(20), | ||
[theme.breakpoints.down('sm')]: { | ||
top: theme.spacing(1), | ||
}, | ||
div: { | ||
'borderRadius': 8, | ||
'.MuiAlert-filledSuccess': { | ||
backgroundColor: '#F0FCF1', | ||
color: '#2BD56F', | ||
svg: { | ||
color: '#2BD56F', | ||
}, | ||
}, | ||
'.MuiAlert-filledError': { | ||
backgroundColor: '#FCF0F0', | ||
color: '#F83F3F', | ||
svg: { | ||
color: '#F83F3F', | ||
}, | ||
}, | ||
'.MuiAlert-filledWarning': { | ||
backgroundColor: '#FAF0E1', | ||
color: '#F3B515', | ||
svg: { | ||
color: '#F3B515', | ||
}, | ||
}, | ||
}, | ||
}, | ||
})) | ||
|
||
const StyledAlert = styled((props: AlertProps) => <MuiAlert {...props} />)(({ theme }) => ({ | ||
'&.MuiAlert-filled': { | ||
display: 'flex', | ||
alignItems: 'center', | ||
width: 'auto', | ||
height: '48px', | ||
[theme.breakpoints.down('sm')]: { | ||
height: '40px', | ||
}, | ||
}, | ||
'& .MuiAlert-icon': { | ||
marginRight: theme.spacing(1), | ||
svg: { | ||
fontSize: 16, | ||
[theme.breakpoints.down('sm')]: { | ||
fontSize: 14, | ||
}, | ||
}, | ||
}, | ||
'& .MuiAlert-message': { | ||
fontSize: 14, | ||
[theme.breakpoints.down('sm')]: { | ||
fontSize: 13, | ||
}, | ||
}, | ||
})) | ||
|
||
// extent mui SnackBar + Alert with custom styles | ||
const Alert: React.FC<SnackbarProps & { content: string; type: 'error' | 'success' | 'warning' }> = ({ | ||
content, | ||
type, | ||
...rest | ||
}) => { | ||
return ( | ||
<StyledSnackbar | ||
anchorOrigin={{ | ||
horizontal: 'center', | ||
vertical: 'top', | ||
}} | ||
autoHideDuration={3000} | ||
color="secondary" | ||
{...rest} | ||
> | ||
<div> | ||
<StyledAlert | ||
severity={type} | ||
variant="filled" | ||
iconMapping={{ error: <CancelIcon />, success: <CheckCircleIcon />, warning: <ErrorIcon /> }} | ||
> | ||
{content} | ||
</StyledAlert> | ||
</div> | ||
</StyledSnackbar> | ||
) | ||
} | ||
export default Alert |
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
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
@import '../../styles/mixin.scss'; | ||
|
||
.pagination { | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 1.125rem 1.5rem; | ||
} | ||
.noRecords { | ||
@include empty-list; | ||
} |
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
Oops, something went wrong.
7dff4ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
godwoken-explorer-ui – ./
v1.aggron.gwscan.com
godwoken-explorer-ui-git-master-nervosnet.vercel.app
godwoken-explorer-ui-nervosnet.vercel.app
godwoken-explorer-ui.vercel.app
aggron.gwscan.com