-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/page header footer design (#982)
* added test cases for themeswitcher * test cases for menu list * updated test cases for layout header page * footer implemenation * Implementation of footer design * design fixes of footer on light mode * added stories for footer * added font's for roboto and monteserrat * fix storybook to render font's correctly * fix for connect button * partial changes * change: - Simplified the Home component - Notification component to render alerts. - Moved all modal from home to ModalContainers. - Updated the styles for the Home Container. * - created hook for useOnboard & useWalletConnect - Updated home components. - Removed fetching dao specific data from home - NS cleanup * added fee switcher * added fee switcher to header component * gaswatcher to be migrated to typescript * fix for select dropdown & gasWatcher component * fix for select styles * fix for storybook breaking & gas undefined error * fix for gas * Fix connect button after close connect modal * removed font files, loaded from google, updated comment * change: - cleanup old notification class & reducer. - removed pager.modules.scss & added style.ts. * reverted the index.scss & index.js * added types for custom files * updated test snapshots * test fixes gateway --------- Co-authored-by: alvaro-ricotta <alvaro.e.ricotta@gmail.com>
- Loading branch information
Showing
102 changed files
with
2,208 additions
and
3,313 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,115 @@ | ||
/* | ||
Copyright 2021-present Boba Network. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
import React, { ReactNode } from 'react' | ||
import Snackbar from '@mui/material/Snackbar' | ||
import MuiAlert, { AlertColor } from '@mui/material/Alert' | ||
import CheckCircle from '@mui/icons-material/CheckCircle' | ||
import Error from '@mui/icons-material/Error' | ||
import { useDispatch, useSelector } from 'react-redux' | ||
import { selectAlert, selectError } from 'selectors' | ||
import { closeAlert, closeError } from 'actions/uiAction' | ||
|
||
interface ToastProps { | ||
children: ReactNode | ||
open: boolean | ||
onClose: () => void | ||
type: AlertColor | ||
duration: number | ||
} | ||
|
||
const Toast = ({ | ||
children, | ||
open, | ||
onClose, | ||
type = 'success', | ||
duration = 9000, | ||
}: ToastProps) => { | ||
let autohide = 0 | ||
if (type === 'success') { | ||
autohide = 3000 // autohide all the green alerts | ||
} else { | ||
autohide = duration | ||
} | ||
|
||
return ( | ||
<Snackbar | ||
open={open} | ||
autoHideDuration={autohide ? autohide : undefined} | ||
onClose={onClose} | ||
anchorOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center', | ||
}} | ||
style={{ marginTop: 50 }} | ||
> | ||
<MuiAlert | ||
onClose={onClose} | ||
severity={type} | ||
variant="filled" | ||
sx={{ | ||
wordWrap: 'break-word', | ||
borderRadius: '10px', | ||
}} | ||
iconMapping={{ | ||
error: <Error sx={{ color: '#FFD88D' }} />, | ||
success: <CheckCircle sx={{ color: '#FFD88D' }} />, | ||
}} | ||
> | ||
{children} | ||
</MuiAlert> | ||
</Snackbar> | ||
) | ||
} | ||
|
||
/** | ||
* | ||
* @NotificationAlert: component is used to show the success & error message. | ||
* | ||
* | ||
*/ | ||
|
||
const NotificationAlert = () => { | ||
const dispatch = useDispatch<any>() | ||
const errorMessage = useSelector(selectError) | ||
const alertMessage = useSelector(selectAlert) | ||
|
||
const handleErrorClose = () => dispatch(closeError()) | ||
const handleAlertClose = () => dispatch(closeAlert()) | ||
|
||
return ( | ||
<> | ||
<Toast | ||
type="error" | ||
duration={0} | ||
open={!!errorMessage} | ||
onClose={handleErrorClose} | ||
> | ||
{errorMessage} | ||
</Toast> | ||
|
||
<Toast | ||
type="success" | ||
duration={0} | ||
open={!!alertMessage} | ||
onClose={handleAlertClose} | ||
> | ||
{alertMessage} | ||
</Toast> | ||
</> | ||
) | ||
} | ||
|
||
export default NotificationAlert |
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.