diff --git a/webapp/public/style.css b/webapp/public/style.css index 3a4273547..dab98a194 100644 --- a/webapp/public/style.css +++ b/webapp/public/style.css @@ -1,13 +1,24 @@ .grecaptcha-badge { - width: 70px !important; - overflow: hidden !important; - transition: all 0.3s ease !important; - right: 0px !important; - bottom: 70px !important; - } - - .grecaptcha-badge:hover { - width: 256px !important; - } - - \ No newline at end of file + width: 70px !important; + overflow: hidden !important; + transition: all 0.3s ease !important; + right: 0px !important; + bottom: 70px !important; +} + +.grecaptcha-badge:hover { + width: 256px !important; +} + +@media (prefers-color-scheme: light) { + body { + background: #FFF; + color: #000; + } +} +@media (prefers-color-scheme: dark) { + body { + background: #051B34; + color: #FFF; + } +} \ No newline at end of file diff --git a/webapp/src/components/AccountInfo/index.js b/webapp/src/components/AccountInfo/index.js index 6824f7808..a76aea0e6 100644 --- a/webapp/src/components/AccountInfo/index.js +++ b/webapp/src/components/AccountInfo/index.js @@ -1,10 +1,12 @@ /* eslint camelcase: 0 */ import React, { useEffect, useState } from 'react' +import { useTheme } from '@mui/material/styles' import { makeStyles } from '@mui/styles' import PropTypes from 'prop-types' import { useTranslation } from 'react-i18next' import Typography from '@mui/material/Typography' import Identicon from 'react-identicons' +import Card from '@mui/material/Card' import Accordion from '@mui/material/Accordion' import AccordionSummary from '@mui/material/AccordionSummary' import AccordionDetails from '@mui/material/AccordionDetails' @@ -58,6 +60,7 @@ const AccountInfo = ({ onGetTableRows, }) => { const classes = useStyles() + const theme = useTheme() const [info, setInfo] = useState(null) const { t } = useTranslation('accountInfoComponent') @@ -113,7 +116,7 @@ const AccountInfo = ({ }, [account]) return ( -
+ {!!info && ( <>
@@ -122,7 +125,7 @@ const AccountInfo = ({
)} -
+ ) } diff --git a/webapp/src/components/AccountInfo/styles.js b/webapp/src/components/AccountInfo/styles.js index 5513117cc..8b86d6603 100644 --- a/webapp/src/components/AccountInfo/styles.js +++ b/webapp/src/components/AccountInfo/styles.js @@ -1,25 +1,19 @@ export default (theme) => ({ paper: { - backgroundColor: theme.palette.background.paper, - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - borderRadius: 10, - padding: theme.spacing(4), width: '100%', - direction: 'column', - justify: 'space-between', height: 'auto', '&:focus': { outline: 'none', }, marginTop: theme.spacing(2), - justifyContent: 'space-between', - flexDirection: 'column', }, accordion: { - boxShadow: 'none', + boxShadow: 'none !important', width: '100%', - borderRadius: 0, - borderBottom: '1px solid rgba(0, 0, 0, 0.12)', + borderBottom: `1px solid ${theme.palette.neutral.light}`, + '& .MuiPaper-root': { + boxShadow: 'none !important', + }, }, accordionSummary: { padding: 0, @@ -38,10 +32,6 @@ export default (theme) => ({ minWidth: '80px', }, }, - keyIcon: { - marginRight: theme.spacing(1), - color: 'rgba(0, 0, 0, 0.54)', - }, keyLabel: { wordBreak: 'break-all', }, @@ -101,11 +91,11 @@ export default (theme) => ({ }, border: { [theme.breakpoints.up('lg')]: { - borderLeft: '1px solid rgba(0, 0, 0, 0.2)', + borderLeft: `1px solid ${theme.palette.neutral.light}`, }, }, iconBorder: { - backgroundColor: '#f0f0f0', + backgroundColor: theme.palette.neutral.lighter, borderRadius: 50, width: 85, height: 85, diff --git a/webapp/src/components/ChartHeader/index.js b/webapp/src/components/ChartHeader/index.js new file mode 100644 index 000000000..5f18ff83a --- /dev/null +++ b/webapp/src/components/ChartHeader/index.js @@ -0,0 +1,95 @@ +import React from 'react' +import clsx from 'clsx' +import { makeStyles } from '@mui/styles' +import { useTranslation } from 'react-i18next' +import PropTypes from 'prop-types' +import Select from '@mui/material/Select' +import MenuItem from '@mui/material/MenuItem' +import FormControl from '@mui/material/FormControl' +import InputLabel from '@mui/material/InputLabel' +import Typography from '@mui/material/Typography' + +import PauseButton from '../../components/PauseButton' + +import styles from './styles' + +const useStyles = makeStyles(styles) + +const ChartHeader = ({ + title, + options, + value, + isHistoryEnabled, + isLive, + isPaused, + onSelect, + handlePause, + ariaLabel, +}) => { + const classes = useStyles() + const { t } = useTranslation() + + return ( +
+ + {title} + +
+ + {isHistoryEnabled && ( + <> + {t('timeFrame')} + + + )} + + {handlePause && ( + + )} +
+
+ ) +} + +ChartHeader.propTypes = { + ariaLabel: PropTypes.string, + title: PropTypes.string, + isPaused: PropTypes.bool, + handlePause: PropTypes.func, + value: PropTypes.string, + options: PropTypes.array, + isLive: PropTypes.bool, + isHistoryEnabled: PropTypes.bool, + onSelect: PropTypes.func, +} + +ChartHeader.defaultProps = { + title: '', + ariaLabel: '', + isPaused: false, + isLive: false, + isHistoryEnabled: false, + handlePause: undefined, + onSelect: undefined, +} + +export default ChartHeader diff --git a/webapp/src/components/TransactionsChartContainer/styles.js b/webapp/src/components/ChartHeader/styles.js similarity index 82% rename from webapp/src/components/TransactionsChartContainer/styles.js rename to webapp/src/components/ChartHeader/styles.js index 4501d77dd..9be1ca032 100644 --- a/webapp/src/components/TransactionsChartContainer/styles.js +++ b/webapp/src/components/ChartHeader/styles.js @@ -1,11 +1,11 @@ export default (theme) => ({ - headerTransactionLine: { + headerContainer: { display: 'flex', justifyContent: 'space-between', flexDirection: 'column', alignItems: 'baseline', padding: theme.spacing(1), - [theme.breakpoints.up('lg')]: { + [theme.breakpoints.up('md')]: { justifyContent: 'space-between', alignItems: 'center', flexDirection: 'row', @@ -30,7 +30,7 @@ export default (theme) => ({ marginTop: theme.spacing(3), }, }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, + onlySelect: { + width: 150, + } }) diff --git a/webapp/src/components/ContractTables/styles.js b/webapp/src/components/ContractTables/styles.js index be477cd85..4305254fc 100644 --- a/webapp/src/components/ContractTables/styles.js +++ b/webapp/src/components/ContractTables/styles.js @@ -27,7 +27,7 @@ export default (theme) => ({ }, }, tableCell: { - borderBottom: '1px solid rgba(0, 0, 0, 0.12)', + borderBottom: `1px solid ${theme.palette.neutral.light}`, }, loadMore: { display: 'flex', diff --git a/webapp/src/components/EmptyState/index.js b/webapp/src/components/EmptyState/index.js index a2211fdec..e933505e6 100644 --- a/webapp/src/components/EmptyState/index.js +++ b/webapp/src/components/EmptyState/index.js @@ -25,7 +25,7 @@ const EmptyState = () => { component={RouterLink} to="/undiscoverable-bps" variant="contained" - color="secondary" + color="primary" mt={2} > {t('viewList')} diff --git a/webapp/src/components/EmptyState/styles.js b/webapp/src/components/EmptyState/styles.js index d92168157..7c4a1d313 100644 --- a/webapp/src/components/EmptyState/styles.js +++ b/webapp/src/components/EmptyState/styles.js @@ -4,10 +4,6 @@ export default (theme) => ({ flexDirection: 'column', alignItems: 'center', width: '100%', - '& a': { - color: theme.palette.primary.main, - textDecorationColor: theme.palette.primary.main, - }, }, emptyStateContainer: { '& span': { @@ -26,6 +22,9 @@ export default (theme) => ({ display: 'flex', alignItems: 'center', justifyContent: 'center', + '& svg': { + color: theme.palette.error.light + }, '& span': { marginTop: theme.spacing(1), }, diff --git a/webapp/src/components/EndpointsTable/index.js b/webapp/src/components/EndpointsTable/index.js index 8b11ccc48..542d6550e 100644 --- a/webapp/src/components/EndpointsTable/index.js +++ b/webapp/src/components/EndpointsTable/index.js @@ -90,8 +90,8 @@ const EndpointsTable = ({ producers, textLists }) => { > {producer.name} - {!!producer.endpoints.api.length + - producer.endpoints.ssl.length && ( + {(producer.endpoints.api.length + + producer.endpoints.ssl.length) > 0 && ( {
{t('footer1')}
- {
{t('footer2')} antelope tools dashboard
-
+
@@ -71,14 +72,14 @@ const Footer = () => { {t('bugRequest')} - + } /> diff --git a/webapp/src/components/Footer/styles.js b/webapp/src/components/Footer/styles.js index d6c2a12dc..870334514 100644 --- a/webapp/src/components/Footer/styles.js +++ b/webapp/src/components/Footer/styles.js @@ -4,9 +4,9 @@ export default (theme) => ({ flexBasis: 'auto', flexWrap: 'wrap', padding: `1px ${theme.spacing(1)}`, - background: theme.palette.common.white, + background: theme.palette.background.default, alignItems: 'center', - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15)', + boxShadow: theme.palette.shadows.card, justifyContent: 'space-between', [theme.breakpoints.down('md')]: { flexDirection: 'column', @@ -21,14 +21,11 @@ export default (theme) => ({ color: theme.palette.common.black, }, '& a': { - color: theme.sidebar.footer.color, + color: theme.palette.neutral.dark, lineHeight: '20px', textAlign: 'center', letterSpacing: '0.1px', textDecoration: 'none', - [theme.breakpoints.down('md')]: { - color: theme.palette.primary.main, - }, }, [theme.breakpoints.down('md')]: { textAlign: 'center !important', @@ -37,7 +34,6 @@ export default (theme) => ({ }, }, sidebarFooter: { - backgroundColor: `${theme.sidebar.footer.background} !important`, padding: theme.spacing(2.75, 4), minHeight: 61, display: 'flex', @@ -45,7 +41,6 @@ export default (theme) => ({ alignItems: 'center', }, sidebarFooterText: { - color: theme.sidebar.footer.color, lineHeight: '20px', textAlign: 'center', letterSpacing: '0.1px', @@ -53,7 +48,6 @@ export default (theme) => ({ justifyContent: 'center !important', }, sidebarFooterSubText: { - color: theme.sidebar.footer.color, fontSize: '0.725rem', display: 'block', padding: 1, @@ -62,7 +56,6 @@ export default (theme) => ({ display: 'flex', justifyContent: 'flex-end', '& a': { - color: theme.sidebar.footer.color, fontSize: 14, lineHeight: '20px', textAlign: 'center', @@ -99,14 +92,14 @@ export default (theme) => ({ height: '20px !important', alignItems: 'center', padding: '2px 6px', - color: '#FFFF', + color: theme.palette.primary.contrastText, justifyContent: 'center', borderRadius: '10px', textAlign: 'center', backgroundColor: `${theme.palette.primary.main} !important`, '& span.MuiChip-label, & span.MuiChip-label:hover': { cursor: 'pointer', - color: theme.sidebar.badge.color, + color: theme.palette.background.default, paddingleft: theme.spacing(2), paddingRight: theme.spacing(2), }, diff --git a/webapp/src/components/GeoMap/CountryMap.js b/webapp/src/components/GeoMap/CountryMap.js index 8c812fb89..89782bc31 100644 --- a/webapp/src/components/GeoMap/CountryMap.js +++ b/webapp/src/components/GeoMap/CountryMap.js @@ -1,6 +1,7 @@ import React, { useEffect, useRef, useCallback } from 'react' import { useNavigate } from 'react-router-dom' import { makeStyles } from '@mui/styles' +import { useTheme } from '@mui/material/styles' import PropTypes from 'prop-types' import { countries } from '../../utils/countries' @@ -13,6 +14,7 @@ const useStyles = makeStyles(styles) const ClusterMap = ({ data, map, mapCode }) => { const classes = useStyles() + const theme = useTheme() const navigate = useNavigate() const myRef = useRef() @@ -21,12 +23,16 @@ const ClusterMap = ({ data, map, mapCode }) => { const options = { chart: { map, + backgroundColor: theme.palette.background.default, }, legend: { enabled: false, }, title: { text: countries[mapCode].name, + style: { + color: theme.palette.text.primary, + } }, mapNavigation: { enableButtons: false, @@ -76,8 +82,8 @@ const ClusterMap = ({ data, map, mapCode }) => { series: [ { name: 'NodeDistribution', - borderColor: '#8F9DA4', - nullColor: '#EEEEEE', + borderColor: theme.palette.neutral.main, + nullColor: theme.palette.neutral.light, showInLegend: false, }, { @@ -86,6 +92,7 @@ const ClusterMap = ({ data, map, mapCode }) => { enableMouseTracking: true, colorKey: 'clusterPointsAmount', name: 'Countries', + color: theme.palette.neutral.darker, data: data || [], }, ], @@ -93,7 +100,7 @@ const ClusterMap = ({ data, map, mapCode }) => { new HighMapsWrapper['Map'](myRef.current, options) }, - [navigate], + [navigate, theme.palette], ) useEffect(() => { diff --git a/webapp/src/components/GeoMap/MainMap.js b/webapp/src/components/GeoMap/MainMap.js index 45508c1ac..eec80c167 100644 --- a/webapp/src/components/GeoMap/MainMap.js +++ b/webapp/src/components/GeoMap/MainMap.js @@ -20,6 +20,9 @@ const MainMap = ({ data, map, setMap }) => { const setupMapData = useCallback( (data = [], map) => { const options = { + chart: { + backgroundColor: theme.palette.background.default, + }, title: { text: '', }, @@ -41,19 +44,26 @@ const MainMap = ({ data, map, setMap }) => { }, tooltip: { headerFormat: '{series.name}
', - backgroundColor: '#FFFFFF', - border: '1px solid rgba(0, 0, 0, 0.12)', - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', + borderRadius: 10, + borderWidth: 1, + borderColor: theme.palette.primary.main, + backgroundColor: theme.palette.background.default, + style: { + color: theme.palette.text.primary, + }, }, series: [ { - data, + data: data.map(item => ({ + ...item, + color: theme.palette.neutral.lighter, + })), mapData: map, joinBy: ['iso-a2', 'country'], name: t('numberOfNodes'), cursor: 'pointer', - borderColor: '#8F9DA4', - nullColor: '#EEEEEE', + borderColor: theme.palette.neutral.main, + nullColor: theme.palette.neutral.light, point: { events: { click: function (e) { diff --git a/webapp/src/components/GeoMap/index.js b/webapp/src/components/GeoMap/index.js index da51acb1b..5c54a8a2d 100644 --- a/webapp/src/components/GeoMap/index.js +++ b/webapp/src/components/GeoMap/index.js @@ -1,9 +1,11 @@ import React, { useEffect, useState, useCallback } from 'react' import { makeStyles } from '@mui/styles' +import { useTranslation } from 'react-i18next' import PropTypes from 'prop-types' import axios from 'axios' import clsx from 'clsx' import Button from '@mui/material/Button' +import Card from '@mui/material/Card' import ArrowBackIcon from '@mui/icons-material/ArrowBack' import { generalConfig } from '../../config' @@ -17,6 +19,7 @@ const useStyles = makeStyles(styles) const GeoMap = ({ data }) => { const classes = useStyles() + const { t } = useTranslation() const [mapOptions, setMapOptions] = useState() const [mapSelected, setMapSelected] = useState() const [mapGeoData, setMapGeoData] = useState() @@ -99,15 +102,17 @@ const GeoMap = ({ data }) => { }, [mapSelected, data]) return ( -
+ {mapSelected && mapGeoData ? ( { setMap={setMapSelected} /> )} -
+ ) } diff --git a/webapp/src/components/GeoMap/styles.js b/webapp/src/components/GeoMap/styles.js index d1c9410fc..5af6705f9 100644 --- a/webapp/src/components/GeoMap/styles.js +++ b/webapp/src/components/GeoMap/styles.js @@ -1,17 +1,14 @@ export default (theme) => ({ mapWrapper: { - backgroundColor: theme.palette.common.white, marginTop: theme.spacing(3), }, goBackBtnHidden: { display: 'none !important', }, - goBackBtn: { - display: 'flex', - marginLeft: theme.spacing(1), - }, divRef: { height: '100vh', - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15)', + '& a': { + color: theme.palette.primary.main + } }, }) diff --git a/webapp/src/components/Header/AntelopeLogo.js b/webapp/src/components/Header/AntelopeLogo.js new file mode 100644 index 000000000..cbaaced08 --- /dev/null +++ b/webapp/src/components/Header/AntelopeLogo.js @@ -0,0 +1,45 @@ +import React from 'react' + +const AntelopeLogoSvg = () => ( + + + + + + + + + + + + + + + + + + + +) + +export default AntelopeLogoSvg diff --git a/webapp/src/components/Header/index.js b/webapp/src/components/Header/index.js index 99f77cdb1..530384ee0 100644 --- a/webapp/src/components/Header/index.js +++ b/webapp/src/components/Header/index.js @@ -15,6 +15,9 @@ import { useTranslation } from 'react-i18next' import moment from 'moment' import 'moment/locale/es' +import ToggleColorMode from 'components/ToggleColorMode' + +import AntelopeLogoSvg from './AntelopeLogo' import styles from './styles' const AuthButton = lazy(() => import('./AuthButton')) @@ -35,14 +38,8 @@ const languages = [ const HeaderLogo = () => { const classes = useStyles() return ( - - antelope tools dashboard + + ) } @@ -85,7 +82,6 @@ const LanguageMenu = () => { anchorEl={anchorMenu} open={Boolean(anchorMenu)} onClose={closeMenu} - className={classes.cardShadow} > {languages.map((language) => ( {
+ {useConnectWallet && ( ({ }, }, imgHeaderLogo: { - width: '145px', - marginTop: theme.spacing(2), - [theme.breakpoints.down('sm')]: { - width: '70%', - marginLeft: theme.spacing(2.5), - }, + '& svg': { + height: '64px', + width: '145px', + marginTop: theme.spacing(2), + color: theme.palette.text.primary, + [theme.breakpoints.down('sm')]: { + width: '70%', + marginLeft: theme.spacing(2.5), + }, + } }, appBar: { - backgroundColor: `${theme.palette.common.white} !important`, - color: theme.header.color, - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', height: '100%', }, iconButton: { '& svg': { width: 22, height: 22, - color: 'rgba(0, 0, 0, 0.54)', + color: theme.palette.neutral.darker, }, }, userBox: { @@ -42,7 +43,7 @@ export default (theme) => ({ alignItems: 'center', gap: theme.spacing(2), '& button': { - color: '#757575', + color: theme.palette.neutral.dark, }, [theme.breakpoints.down('sm')]: { maxWidth: '250px', @@ -105,7 +106,6 @@ export default (theme) => ({ }, }, loginBtn: { - color: `${theme.palette.common.white} !important`, cursor: 'pointer', }, connectWalletBtn: { @@ -118,8 +118,8 @@ export default (theme) => ({ alignItems: 'center', textAlign: 'center', padding: theme.spacing(2), - border: `0 solid ${theme.palette.common.white}`, - borderLeft: `0.8px solid ${theme.palette.common.white}`, + border: `0 solid ${theme.palette.primary.contrastText}`, + borderLeft: `0.8px solid ${theme.palette.primary.contrastText}`, background: 'transparent', [theme.breakpoints.down('sm')]: { padding: theme.spacing(2, 1, 2, 1), @@ -140,15 +140,14 @@ export default (theme) => ({ alignItems: 'center', textAlign: 'center', background: theme.palette.primary.main, + color: theme.palette.primary.contrastText, borderRadius: '10px', transition: 'ease-in-out all 0.5s', '&:hover': { - boxShadow: `0px 0px 3px 3px ${theme.palette.primary.main}`, + boxShadow: theme.palette.shadows.authBox, }, - }, - cardShadow: { - '& .MuiPaper-root': { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', + '& button': { + color: theme.palette.primary.contrastText, }, }, }) diff --git a/webapp/src/components/HealthCheck/styles.js b/webapp/src/components/HealthCheck/styles.js index d4ca30e85..e9bb07da6 100644 --- a/webapp/src/components/HealthCheck/styles.js +++ b/webapp/src/components/HealthCheck/styles.js @@ -32,17 +32,14 @@ export default (theme) => ({ color: theme.palette.success.main, }, timerOff: { - color: 'orange', + color: theme.palette.warning.light, }, yellowLight: { - color: theme.palette.warning.main, + color: theme.palette.warning.dark, }, redLight: { color: theme.palette.error.main, }, - test: { - boxShadow: '10px 5px 5px red !important', - }, loading: { width: '18px !important', height: '18px !important', diff --git a/webapp/src/components/HighChartsWrapper/index.js b/webapp/src/components/HighChartsWrapper/index.js new file mode 100644 index 000000000..77ab18c51 --- /dev/null +++ b/webapp/src/components/HighChartsWrapper/index.js @@ -0,0 +1,41 @@ +import React, { useEffect, useState } from 'react' +import { makeStyles } from '@mui/styles' +import { useTheme } from '@mui/material/styles' +import Highcharts from 'highcharts' +import HighchartsReact from 'highcharts-react-official' + +import styles from './styles' + +const useStyles = makeStyles(styles) + +const HighchartsWrapper = ({ options }) => { + const classes = useStyles() + const theme = useTheme() + const [colors, setColors] = useState(theme.palette.charts.colors) + + useEffect(() => { + setColors(theme.palette.charts.colors) + }, [theme]) + + options.time = { + timezoneOffset: new Date().getTimezoneOffset(), + ...options?.time, + } + + options.tooltip = { + ...options?.tooltip, + borderRadius: 10, + borderWidth: 1, + } + + return ( +
+ +
+ ) +} + +export default HighchartsWrapper diff --git a/webapp/src/components/HighChartsWrapper/styles.js b/webapp/src/components/HighChartsWrapper/styles.js new file mode 100644 index 000000000..2d06d02ce --- /dev/null +++ b/webapp/src/components/HighChartsWrapper/styles.js @@ -0,0 +1,17 @@ +export default (theme) => ({ + chart: { + '& .highcharts-background,.highcharts-tooltip-box': { + fill: theme.palette.background.default, + }, + '& .highcharts-title,.highcharts-legend-item text,.highcharts-axis-title,.highcharts-axis-labels text,.highcharts-data-label text,.highcharts-tooltip text': + { + fill: `${theme.palette.text.primary} !important`, + }, + '& .highcharts-legend-item-hidden text': { + fill: `${theme.palette.neutral.light} !important`, + }, + '& .highcharts-yaxis-grid > .highcharts-grid-line, .highcharts-xaxis > .highcharts-axis-line': { + stroke: theme.palette.neutral.light + }, + }, +}) diff --git a/webapp/src/components/Icons/Alert.js b/webapp/src/components/Icons/Alert.js index 4ee024808..35ee277fe 100644 --- a/webapp/src/components/Icons/Alert.js +++ b/webapp/src/components/Icons/Alert.js @@ -10,16 +10,16 @@ const AlertSvg = () => ( > ) diff --git a/webapp/src/components/Loader/index.js b/webapp/src/components/Loader/index.js index 2b237ecca..54f7aa494 100644 --- a/webapp/src/components/Loader/index.js +++ b/webapp/src/components/Loader/index.js @@ -11,7 +11,7 @@ const Loader = () => { return (
- +
) } diff --git a/webapp/src/components/NetworkSelector/styles.js b/webapp/src/components/NetworkSelector/styles.js index dfdca46c5..ea3300823 100644 --- a/webapp/src/components/NetworkSelector/styles.js +++ b/webapp/src/components/NetworkSelector/styles.js @@ -7,7 +7,7 @@ export default (theme) => ({ width: 44, height: 44, borderRadius: 50, - backgroundColor: theme.palette.primary.contrastText, + backgroundColor: theme.palette.common.white, }, [theme.breakpoints.up('sm')]: { marginTop: 0, @@ -20,7 +20,7 @@ export default (theme) => ({ }, list: { transition: 'max-height .6s ease-out', - backgroundColor: theme.palette.primary.contrastText, + backgroundColor: theme.palette.background.default, maxHeight: 0, overflow: 'hidden', margin: 0, @@ -30,7 +30,6 @@ export default (theme) => ({ width: 310, top: 48, left: -55, - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15)', '& .titles': { display: 'flex', '& .titlesBoxRight': { @@ -39,8 +38,8 @@ export default (theme) => ({ alignItems: 'center', width: '50%', height: 50, - borderLeft: '1px solid #EEEEEE', - borderBottom: '1px solid #EEEEEE', + borderLeft: `1px solid ${theme.palette.neutral.lighter}`, + borderBottom: `1px solid ${theme.palette.neutral.lighter}`, }, '& .titlesBoxLeft': { paddingLeft: theme.spacing(2), @@ -48,7 +47,7 @@ export default (theme) => ({ alignItems: 'center', height: 50, width: '50%', - borderBottom: '1px solid #EEEEEE', + borderBottom: `1px solid ${theme.palette.neutral.lighter}`, }, '& p': { fontWeight: 'bold', @@ -65,7 +64,7 @@ export default (theme) => ({ }, '& .listsBoxRight': { width: '50%', - borderLeft: '1px solid #EEEEEE', + borderLeft: `1px solid ${theme.palette.neutral.lighter}`, }, '& .listsBoxLeft': { width: '50%', @@ -82,6 +81,7 @@ export default (theme) => ({ listActive: { maxHeight: 1000, opacity: 1, + boxShadow: theme.palette.shadows.card, }, listItem: { height: 50, @@ -90,17 +90,17 @@ export default (theme) => ({ cursor: 'pointer', listStyle: 'none', paddingLeft: theme.spacing(2), - background: theme.palette.primary.contrastText, + background: theme.palette.background.default, '& a': { width: '100%', height: '100%', display: 'flex', alignItems: 'center', textDecoration: 'none', - color: theme.palette.common.black, + color: theme.palette.text.primary, }, '&:hover': { - background: '#f4f4f4', + background: theme.palette.neutral.lighter, }, }, listItemActive: { @@ -112,7 +112,6 @@ export default (theme) => ({ alignItems: 'center', height: 50, borderRadius: theme.spacing(2), - color: theme.palette.common.black, [theme.breakpoints.down('sm')]: { margin: theme.spacing(6, 0, 4), textAlign: 'center', @@ -149,7 +148,6 @@ export default (theme) => ({ expandIcon: { marginTop: theme.spacing(1), marginRight: 0, - color: theme.palette.text.hint, }, jungleImg: { width: '22px !important', diff --git a/webapp/src/components/NoResults/index.js b/webapp/src/components/NoResults/index.js index 9b9ea85c4..1a6def958 100644 --- a/webapp/src/components/NoResults/index.js +++ b/webapp/src/components/NoResults/index.js @@ -1,8 +1,8 @@ import React from 'react' import { makeStyles } from '@mui/styles' -import Card from '@mui/material/Card' -import CardHeader from '@mui/material/CardHeader' import { useTranslation } from 'react-i18next' +import Card from '@mui/material/Card' +import Typography from '@mui/material/Typography' import styles from './styles' @@ -14,7 +14,7 @@ const NoResults = () => { return ( - + {t('noResultsFound')} ) } diff --git a/webapp/src/components/NoResults/styles.js b/webapp/src/components/NoResults/styles.js index 1164aef3c..753f01413 100644 --- a/webapp/src/components/NoResults/styles.js +++ b/webapp/src/components/NoResults/styles.js @@ -1,11 +1,8 @@ export default (theme) => ({ root: { - display: 'flex', - flexDirection: 'column', width: '100%', + display: 'flex', + justifyContent: 'center', marginBottom: theme.spacing(2), - padding: theme.spacing(2), - alignItems: 'center', - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', }, }) diff --git a/webapp/src/components/NodeCard/EndpointsChips.js b/webapp/src/components/NodeCard/EndpointsChips.js index afcfe0c62..00a2a7dc2 100644 --- a/webapp/src/components/NodeCard/EndpointsChips.js +++ b/webapp/src/components/NodeCard/EndpointsChips.js @@ -2,6 +2,7 @@ import React, { memo } from 'react' import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' import Typography from '@mui/material/Typography' +import Link from '@mui/material/Link' import moment from 'moment' import ChipList from '../ChipList' @@ -107,9 +108,9 @@ const EndpointsChips = ({ node }) => { return ( <> {type.toUpperCase()}:{' '} - + {value || 'N/A'} - + ) })} diff --git a/webapp/src/components/NodeCard/NodesCard.js b/webapp/src/components/NodeCard/NodesCard.js index 8c1d72cf4..630385c29 100644 --- a/webapp/src/components/NodeCard/NodesCard.js +++ b/webapp/src/components/NodeCard/NodesCard.js @@ -30,10 +30,8 @@ const NodesCard = ({ nodes, hideFeatures = false }) => { return ( <> -
{t('healthStatus')}
-
- -
+ {t('healthStatus')} + ) } diff --git a/webapp/src/components/NodeCard/ShowInfo.js b/webapp/src/components/NodeCard/ShowInfo.js index e638622eb..0548b94bf 100644 --- a/webapp/src/components/NodeCard/ShowInfo.js +++ b/webapp/src/components/NodeCard/ShowInfo.js @@ -12,8 +12,8 @@ const ShowInfo = ({ cond, title, value }) => { return ( <> -
{title}
-
{value}
+ {title} + {value} ) } diff --git a/webapp/src/components/NodeCard/styles.js b/webapp/src/components/NodeCard/styles.js index 5ef48f3b0..bd4f47f14 100644 --- a/webapp/src/components/NodeCard/styles.js +++ b/webapp/src/components/NodeCard/styles.js @@ -18,7 +18,7 @@ export default (theme) => ({ '& .MuiCardContent-root:last-child': { paddingBottom: theme.spacing(4), }, - boxShadow: '2px 3px 4px 0px #0000002E', + boxShadow: theme.palette.shadows.nodeCard, backgroundColor: theme.palette.background.light, borderRadius: theme.spacing(3), [theme.breakpoints.down('sm')]: { diff --git a/webapp/src/components/NodesList/NodesRow.js b/webapp/src/components/NodesList/NodesRow.js index 531775c76..0be5c3dd2 100644 --- a/webapp/src/components/NodesList/NodesRow.js +++ b/webapp/src/components/NodesList/NodesRow.js @@ -4,8 +4,9 @@ import React, { useState, useEffect } from 'react' import PropTypes from 'prop-types' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' -import Typography from '@mui/material/Typography' import Button from '@mui/material/Button' +import Card from '@mui/material/Card' +import Typography from '@mui/material/Typography' import { eosConfig } from '../../config' import { formatData } from '../../utils' @@ -53,7 +54,7 @@ const NodesRow = ({ producer }) => { if (!producerOrg || !Object.keys(producerOrg)?.length) return <> return ( -
+ {
- +
{' '}
-
+ ) } diff --git a/webapp/src/components/NodesList/index.js b/webapp/src/components/NodesList/index.js index bc21611e4..8ab3d5e2b 100644 --- a/webapp/src/components/NodesList/index.js +++ b/webapp/src/components/NodesList/index.js @@ -4,6 +4,7 @@ import React from 'react' import PropTypes from 'prop-types' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' +import Card from '@mui/material/Card' import Typography from '@mui/material/Typography' import { eosConfig } from 'config' @@ -19,8 +20,8 @@ const NodeList = ({ producers }) => { const Header = () => { return ( -
{eosConfig.producerColumns?.includes('rank') ? ( {t('rank')} @@ -30,7 +31,7 @@ const NodeList = ({ producers }) => { {t('producerName')} {t('nodes')} -
+ ) } diff --git a/webapp/src/components/NonCompliantCard/index.js b/webapp/src/components/NonCompliantCard/index.js index 48560f176..c156d637c 100644 --- a/webapp/src/components/NonCompliantCard/index.js +++ b/webapp/src/components/NonCompliantCard/index.js @@ -50,7 +50,7 @@ const NonCompliantCard = ({ producer, stats }) => { state={{ owner: producer.owner, url: producer.url }} to="/bpjson" variant="contained" - color="secondary" + color="primary" mt={2} > {t('bpJsonGenerator')} diff --git a/webapp/src/components/NonCompliantCard/styles.js b/webapp/src/components/NonCompliantCard/styles.js index d62d66cb8..c44f680e9 100644 --- a/webapp/src/components/NonCompliantCard/styles.js +++ b/webapp/src/components/NonCompliantCard/styles.js @@ -24,7 +24,7 @@ export default (theme) => ({ alignItems: 'center', alignSelf: 'center', [theme.breakpoints.down('sm')]: { - borderBottom: '1px solid rgba(0, 0, 0, 0.2)', + borderBottom: `1px solid ${theme.palette.neutral.main}`, paddingBottom: theme.spacing(4), }, }, @@ -33,10 +33,6 @@ export default (theme) => ({ height: 'auto', margin: '0px', flexGrow: '1', - '& a': { - color: theme.palette.primary.main, - textDecorationColor: theme.palette.primary.main, - }, [theme.breakpoints.down('lg')]: { width: '150px', }, @@ -48,7 +44,7 @@ export default (theme) => ({ [theme.breakpoints.up('sm')]: { marginTop: theme.spacing(3), marginBottom: theme.spacing(3), - borderLeft: '1px solid rgba(0, 0, 0, 0.2)', + borderLeft: `1px solid ${theme.palette.neutral.main}`, padding: theme.spacing(0, 3, 0), }, [theme.breakpoints.down('sm')]: { diff --git a/webapp/src/components/PauseButton/index.js b/webapp/src/components/PauseButton/index.js index c379b5114..8b294912b 100644 --- a/webapp/src/components/PauseButton/index.js +++ b/webapp/src/components/PauseButton/index.js @@ -35,7 +35,7 @@ const PauseButton = ({ isPaused, handlePause, isEnabled }) => { color={ !isEnabled ? theme.palette.action.disabled - : theme.palette.common.black + : theme.palette.text.primary } /> )} diff --git a/webapp/src/components/ProducerName/styles.js b/webapp/src/components/ProducerName/styles.js index cbe459ebd..c2095e2c0 100644 --- a/webapp/src/components/ProducerName/styles.js +++ b/webapp/src/components/ProducerName/styles.js @@ -5,7 +5,7 @@ export default (theme) => ({ '& img': { borderRadius: '50%', aspectRatio: '1 / 1', - backgroundColor: '#FFF', + backgroundColor: theme.palette.common.white, }, }, nameContainer: { diff --git a/webapp/src/components/ProducersChart/index.js b/webapp/src/components/ProducersChart/index.js index 55cad4a41..f07e44fd9 100644 --- a/webapp/src/components/ProducersChart/index.js +++ b/webapp/src/components/ProducersChart/index.js @@ -2,7 +2,9 @@ import React, { useState, useEffect, memo } from 'react' import PropTypes from 'prop-types' import { makeStyles } from '@mui/styles' +import { Link as RouterLink } from 'react-router-dom' import Typography from '@mui/material/Typography' +import Link from '@mui/material/Link' import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts' import useMediaQuery from '@mui/material/useMediaQuery' import { useTheme } from '@mui/material/styles' @@ -65,9 +67,7 @@ const CustomBarLabel = memo( outerRadius + spacing, midAngle, ) - const link = generalConfig.eosRateLink - ? `${generalConfig.eosRateLink}/block-producers/${payload.owner}` - : payload.url + const link = `${eosConfig.producersRoute}/${payload.owner}` const getNameTextAnchor = (x, cx) => { if (x + 30 >= cx && x < cx) { @@ -79,38 +79,35 @@ const CustomBarLabel = memo( } } + const ProfileLink = ({ link, owner, Content }) => { + return ( + + + + ) + } + const ProducerName = () => { const Content = () => ( {payload.owner} ) - if (!link) { - return - } - return ( - - - - ) + return } const ProducerLogo = () => { @@ -123,20 +120,7 @@ const CustomBarLabel = memo( /> ) - if (!link) { - return - } - - return ( - - - - ) + return } return ( @@ -150,7 +134,11 @@ const CustomBarLabel = memo( width="100%" viewBox="0 0 100 100" > - + { if (active && payload.length > 0) { return ( -
+
{t('name')}:{' '} @@ -236,6 +224,7 @@ CustomTooltip.propTypes = { const ProducersChart = ({ producers, info }) => { const [entries, setEntries] = useState([]) + const classes = useStyles() const theme = useTheme() useEffect(() => { @@ -243,7 +232,11 @@ const ProducersChart = ({ producers, info }) => { }, [producers]) return ( - + } /> { key={`cell-${index}`} fill={ entry.owner === info.head_block_producer - ? theme.palette.primary.dark + ? theme.palette.primary.main : theme.palette.primary.light } /> diff --git a/webapp/src/components/ProducersChart/styles.js b/webapp/src/components/ProducersChart/styles.js index 2290e7f12..833037e7c 100644 --- a/webapp/src/components/ProducersChart/styles.js +++ b/webapp/src/components/ProducersChart/styles.js @@ -1,12 +1,17 @@ export default (theme) => ({ - wrapper: { + tooltip: { backgroundColor: theme.palette.background.paper, padding: theme.spacing(2), borderRadius: theme.spacing(1), - boxShadow: - '0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)', + boxShadow: theme.palette.shadows.card, + border: `1px solid ${theme.palette.primary.main}`, }, description: { fontWeight: 'normal', }, + chartContainer: { + display: 'flex', + alignItems: 'center', + paddingBottom: theme.spacing(2), + } }) diff --git a/webapp/src/components/ProducersTable/MainSocialLinks.js b/webapp/src/components/ProducersTable/MainSocialLinks.js index 15e6c69f4..1fde1bd15 100644 --- a/webapp/src/components/ProducersTable/MainSocialLinks.js +++ b/webapp/src/components/ProducersTable/MainSocialLinks.js @@ -29,6 +29,8 @@ const MainSocialLinks = ({ social, name }) => { links[item?.name] = item.url }) + if (!Object.keys(links).length) return <> + return (
{socialMediaNames.map((socialMedia, index) => diff --git a/webapp/src/components/ProducersTable/ProducerRow.js b/webapp/src/components/ProducersTable/ProducerRow.js index 860370086..2a2cc9612 100644 --- a/webapp/src/components/ProducersTable/ProducerRow.js +++ b/webapp/src/components/ProducersTable/ProducerRow.js @@ -50,19 +50,23 @@ const ProducerRow = ({ producer, index }) => { - - - {producerOrg?.media?.website} - - - - - + {producerOrg?.media?.website && ( + <> + + + {producerOrg?.media?.website} + + + + + + + )} {eosConfig.producerColumns?.includes('votes') && ( @@ -131,7 +135,7 @@ const ProducerRow = ({ producer, index }) => { - + ) diff --git a/webapp/src/components/ProducersTable/index.js b/webapp/src/components/ProducersTable/index.js index bb1ff822d..0cf19eb20 100644 --- a/webapp/src/components/ProducersTable/index.js +++ b/webapp/src/components/ProducersTable/index.js @@ -3,6 +3,7 @@ import React from 'react' import PropTypes from 'prop-types' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' +import { useNavigate } from 'react-router-dom' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' import TableCell from '@mui/material/TableCell' @@ -20,8 +21,15 @@ const useStyles = makeStyles(styles) const ProducersTable = ({ producers }) => { const classes = useStyles() + const navigate = useNavigate() const { t } = useTranslation('producerCardComponent') + const handleClickRow = producer => { + navigate(`/${eosConfig.producersRoute}/${producer?.owner}`, { + state: { producer }, + }) + } + return ( @@ -29,9 +37,7 @@ const ProducersTable = ({ producers }) => { {eosConfig.producerColumns.map((name) => ( - - {t(name)} - + {t(name)} ))} @@ -39,6 +45,9 @@ const ProducersTable = ({ producers }) => { {producers.map((producer, index) => ( { + handleClickRow(producer) + }} className={classes.tableRow} key={`bp-${producer?.owner}-${index}`} > diff --git a/webapp/src/components/ProducersTable/styles.js b/webapp/src/components/ProducersTable/styles.js index 73368b825..41dd51f1f 100644 --- a/webapp/src/components/ProducersTable/styles.js +++ b/webapp/src/components/ProducersTable/styles.js @@ -18,6 +18,7 @@ export default (theme) => ({ }, '&:hover': { backgroundColor: `${theme.palette.neutral.lighter}`, + cursor: 'pointer', }, }, tableHead: { diff --git a/webapp/src/components/ResourceUsage/index.js b/webapp/src/components/ResourceUsage/index.js index acfbf8faa..2e6247c8b 100644 --- a/webapp/src/components/ResourceUsage/index.js +++ b/webapp/src/components/ResourceUsage/index.js @@ -38,6 +38,7 @@ const ResourceUsage = ({ percent, title, label }) => { textAnchor="middle" dominantBaseline="middle" className="progress-label" + fill={theme.palette.text.primary} > {title} {(percent * 100).toFixed(2)}% @@ -47,6 +48,7 @@ const ResourceUsage = ({ percent, title, label }) => { textAnchor="middle" dominantBaseline="middle" className="progress-label" + fill={theme.palette.text.primary} > {label} diff --git a/webapp/src/components/RicardianContract/styles.js b/webapp/src/components/RicardianContract/styles.js index 8f282516c..f0d51a946 100644 --- a/webapp/src/components/RicardianContract/styles.js +++ b/webapp/src/components/RicardianContract/styles.js @@ -22,15 +22,12 @@ export default (theme) => ({ '& h6': { fontStyle: 'italic', lineHeight: 1, + color: theme.palette.neutral.dark }, '& h5': { lineHeight: 1, }, }, - defaultIcon: { - fontSize: 65, - color: '#484158', - }, divider: { marginBottom: theme.spacing(2), }, diff --git a/webapp/src/components/SearchBar/index.js b/webapp/src/components/SearchBar/index.js index 5cb61467c..c874f4755 100644 --- a/webapp/src/components/SearchBar/index.js +++ b/webapp/src/components/SearchBar/index.js @@ -5,7 +5,6 @@ import clsx from 'clsx' import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import Chip from '@mui/material/Chip' import IconButton from '@mui/material/IconButton' import InputAdornment from '@mui/material/InputAdornment' @@ -62,47 +61,43 @@ const SearchBar = ({ }, [debouncedFilter]) return ( - <> - - - {`${t('title')}:`} - - - - - - ), - }} - onKeyDown={handleOnKeyDown} - onChange={handleOnChange('owner')} + + {`${t('title')}:`} + + + + + + ), + }} + onKeyDown={handleOnKeyDown} + onChange={handleOnChange('owner')} + /> +
+ {chips.map((chip, index) => ( + handleOnClickChip(chip.name)} + className={clsx({ + [classes.selected]: selected === chip.name, + })} /> -
- {chips.map((chip, index) => ( - handleOnClickChip(chip.name)} - className={clsx({ - [classes.selected]: selected === chip.name, - })} - /> - ))} -
- - - + ))} +
+
) } diff --git a/webapp/src/components/SearchBar/styles.js b/webapp/src/components/SearchBar/styles.js index ac9e6eaac..e35b1cb1a 100644 --- a/webapp/src/components/SearchBar/styles.js +++ b/webapp/src/components/SearchBar/styles.js @@ -13,10 +13,7 @@ export default (theme) => ({ }, selected: { backgroundColor: `${theme.palette.primary.main} !important`, - color: `${theme.palette.common.white} !important` - }, - cardContent: { - padding: `${theme.spacing(2)} !important` + color: `${theme.palette.primary.contrastText} !important` }, title: { fontSize: '17px !important', diff --git a/webapp/src/components/Sidebar/NavLink.js b/webapp/src/components/Sidebar/NavLink.js index 21834de35..2334a1940 100644 --- a/webapp/src/components/Sidebar/NavLink.js +++ b/webapp/src/components/Sidebar/NavLink.js @@ -2,7 +2,7 @@ import React, { forwardRef } from 'react' import { NavLink as RouterNavLink } from 'react-router-dom' const NavLink = forwardRef(function NavLink(props, ref) { - return + return }) export default NavLink diff --git a/webapp/src/components/Sidebar/SidebarCategory.js b/webapp/src/components/Sidebar/SidebarCategory.js index c97267c18..767abd132 100644 --- a/webapp/src/components/Sidebar/SidebarCategory.js +++ b/webapp/src/components/Sidebar/SidebarCategory.js @@ -5,14 +5,14 @@ import ExpandLess from '@mui/icons-material/ExpandLess' import ExpandMore from '@mui/icons-material/ExpandMore' import { Chip, ListItem as MuiListItem, ListItemText } from '@mui/material' import styled from 'styled-components' -import { darken } from 'polished' import { eosConfig } from 'config' const Category = styled(MuiListItem)` font-weight: ${(props) => props.theme.typography.fontWeightRegular}; - color: ${(props) => props.theme.sidebar.color}; + color: ${(props) => props.theme.palette.neutral.darker}; display: flex; flex-direction: row; + justify-content: center !important; svg { opacity: 0.5; object-fit: contain; @@ -26,12 +26,19 @@ const Category = styled(MuiListItem)` } &:hover, &.${(props) => props.activeclassname} { - background-color: ${(props) => - darken(0.05, props.theme.sidebar.background)}; + border-radius: 10px; svg { opacity: 1; } } + &:hover { + background-color: ${(props) => + props.theme.palette.neutral.lighter}; + } + &.${(props) => props.activeclassname} { + background-color: ${(props) => + props.theme.palette.sidebar.activeLink}; + } ` const SidebarCategory = ({ diff --git a/webapp/src/components/Sidebar/SidebarLink.js b/webapp/src/components/Sidebar/SidebarLink.js index 5263baed5..d1105ac8f 100644 --- a/webapp/src/components/Sidebar/SidebarLink.js +++ b/webapp/src/components/Sidebar/SidebarLink.js @@ -2,23 +2,23 @@ import React from 'react' import PropTypes from 'prop-types' import { Chip, ListItem as MuiListItem, ListItemText } from '@mui/material' -import { rgba, darken } from 'polished' +import { darken } from 'polished' import styled from 'styled-components' import NavLink from './NavLink' const Link = styled(MuiListItem)` span { - color: ${(props) => rgba(props.theme.sidebar.color, 0.7)}; + color: ${(props) => props.theme.palette.neutral.darker}; } &:hover span { - color: ${(props) => rgba(props.theme.sidebar.color, 0.9)}; + color: ${(props) => props.theme.palette.neutral.darker}; } &.${(props) => props.activeclassname} { background-color: ${(props) => - darken(0.06, props.theme.sidebar.background)}; + darken(0.06, props.theme.palette.background.default)}; span { - color: ${(props) => props.theme.sidebar.color}; + color: ${(props) => props.theme.palette.neutral.darker}; } } ` diff --git a/webapp/src/components/Sidebar/index.js b/webapp/src/components/Sidebar/index.js index 97117a3c0..693f1dd20 100644 --- a/webapp/src/components/Sidebar/index.js +++ b/webapp/src/components/Sidebar/index.js @@ -13,7 +13,6 @@ import { import MenuIcon from '@mui/icons-material/Menu' import LanguageIcon from '@mui/icons-material/Language' import { makeStyles } from '@mui/styles' -import { rgba } from 'polished' import { useLocation } from 'react-router-dom' import { useTranslation } from 'react-i18next' import PerfectScrollbar from 'react-perfect-scrollbar' @@ -28,7 +27,7 @@ import ExternalLink from './ExternalLink' import SidebarCategory from './SidebarCategory' import SidebarLink from './SidebarLink' -const useStyles = makeStyles((theme) => styles(theme, rgba)) +const useStyles = makeStyles(styles) const Sidebar = ({ classes, staticContext, onDrawerToggle, ...rest }) => { const { t } = useTranslation('routes') @@ -74,26 +73,25 @@ const Sidebar = ({ classes, staticContext, onDrawerToggle, ...rest }) => { const LanguageSelector = () => { return ( - <> - - - {t('options')} - - sidebar')} - icon={} - activeclassname="active" - showOnlyIcons={!rest.open} - classes={classesStyle} - onClick={() => { - moment.locale(i18n.language === 'es' ? 'en' : 'es') - i18n.changeLanguage(i18n.language === 'es' ? 'en' : 'es') - }} - /> - -
- + + + {t('options')} + + sidebar')} + icon={} + activeclassname="active" + showOnlyIcons={!rest.open} + classes={classesStyle} + onClick={() => { + moment.locale(i18n.language === 'es' ? 'en' : 'es') + i18n.changeLanguage(i18n.language === 'es' ? 'en' : 'es') + }} + /> + ) } @@ -133,79 +131,74 @@ const Sidebar = ({ classes, staticContext, onDrawerToggle, ...rest }) => { placement="left" key={`category-${category.name}-${index}`} > -
+ {category.header ? ( -
+ <> + {rest.open && ( + + {t(category.header)} + + )} + ) : null} - - {category.header ? ( - <> - {rest.open && ( - - {t(category.header)} - - )} - - ) : null} - - {category.children ? ( -
- sidebar`)} - icon={category.icon} - onClick={() => toggle(index)} - isCollapsable - button - showOnlyIcons={!rest.open} - classes={classesStyle} - /> - - - {category.children.map((route, index) => ( - - ))} - -
- ) : ( + {category.children ? ( +
sidebar`, - )} - to={category.path} - activeclassname="active" - component={ - category.path.includes('http') - ? ExternalLink - : NavLink - } + isOpen={!openRoutes[index]} + name={t(`${category.path}>sidebar`)} icon={category.icon} - exact - badge={category.badge} + onClick={() => toggle(index)} + isCollapsable + button showOnlyIcons={!rest.open} classes={classesStyle} /> - )} - -
+ + + {category.children.map((route, index) => ( + + ))} + +
+ ) : ( + sidebar`, + )} + to={category.path} + activeclassname="active" + component={ + category.path.includes('http') ? ExternalLink : NavLink + } + icon={category.icon} + exact="true" + badge={category.badge} + showOnlyIcons={!rest.open} + classes={classesStyle} + /> + )} +
))} -
diff --git a/webapp/src/components/Sidebar/styles.js b/webapp/src/components/Sidebar/styles.js index aebe0ef42..4cc66aa87 100644 --- a/webapp/src/components/Sidebar/styles.js +++ b/webapp/src/components/Sidebar/styles.js @@ -1,8 +1,10 @@ -export default (theme, rgba) => ({ +export default (theme) => ({ drawer: { minWidth: '70px', borderRight: 0, height: '100%', + backgroundColor: theme.palette.background.default, + boxShadow: theme.palette.shadows.card, '& > div': { minWidth: '70px', borderRight: 0, @@ -10,14 +12,16 @@ export default (theme, rgba) => ({ maxWidth: '240px', position: 'sticky !important', height: 'auto', + boxShadow: 'none', }, }, }, scrollbar: { - backgroundColor: theme.sidebar.background, + backgroundColor: theme.palette.background.default, + paddingBottom: theme.spacing(4), }, list: { - backgroundColor: theme.sidebar.background, + backgroundColor: theme.palette.background.default, }, listItem: { padding: '2px 6px 2px 6px !important', @@ -25,13 +29,13 @@ export default (theme, rgba) => ({ flexDirection: 'column !important', alignItems: 'start !important', justifyContent: 'center !important', - cursor: 'pointer' + cursor: 'pointer', }, brand: { fontSize: theme.typography.h5.fontSize, fontWeight: theme.typography.fontWeightMedium, - color: theme.sidebar.header.color, - backgroundColor: theme.sidebar.header.background, + color: theme.palette.neutral.light, + backgroundColor: theme.palette.background.default, fontFamily: theme.typography.fontFamily, minHeight: 56, paddingLeft: theme.spacing(6), @@ -42,7 +46,7 @@ export default (theme, rgba) => ({ minHeight: 64, }, '&:hover': { - backgroundColor: theme.sidebar.header.background, + backgroundColor: theme.palette.background.default, }, }, brandIcon: { @@ -57,20 +61,20 @@ export default (theme, rgba) => ({ categoryText: { margin: 0, '& span': { - color: theme.sidebar.color, + color: theme.palette.neutral.darker, fontSize: theme.typography.body1.fontSize, - fontWeight: theme.sidebar.category.fontWeight, + fontWeight: 400, padding: theme.spacing(0, 4), }, }, categoryIconLess: { - color: rgba(theme.sidebar.color, 0.5), + color: theme.palette.neutral.darker, }, categoryIconMore: { - color: rgba(theme.sidebar.color, 0.5), + color: theme.palette.neutral.darker, }, linkText: { - color: theme.sidebar.color, + color: theme.palette.neutral.darker, '& span': { fontSize: theme.typography.body1.fontSize, }, @@ -83,11 +87,11 @@ export default (theme, rgba) => ({ height: '20px !important', position: 'absolute', right: 12, - backgroundColor: `${theme.palette.secondary.main} !important`, + backgroundColor: `${theme.palette.primary.main} !important`, '& span.MuiChip-label, & span.MuiChip-label:hover': { cursor: 'pointer', - color: theme.sidebar.badge.color, + color: theme.palette.background.default, paddingleft: theme.spacing(2), paddingRight: theme.spacing(2), }, @@ -96,26 +100,31 @@ export default (theme, rgba) => ({ top: 12, }, divider: { - height: '1px', - margin: theme.spacing(4), - backgroundColor: theme.palette.neutral.light, + '&::before': { + content: '""', + alignSelf: 'center', + height: '1px', + width: '90%', + margin: theme.spacing(4, 0, 4, 0), + backgroundColor: theme.palette.neutral.light, + }, }, sidebarSection: { - color: theme.sidebar.color, + color: theme.palette.neutral.darker, padding: theme.spacing(0, 4), opacity: 0.9, display: 'block', fontWeight: `${theme.typography.fontWeightBold} !important`, }, button: { - padding: '4px 10px 0px', + padding: '8px 0px 0px 12px', }, iconButton: { '& svg': { width: 30, height: 30, - color: theme.sidebar.color, - opacity: 0.5 + color: theme.palette.neutral.darker, + opacity: 0.5, }, }, tooltip: { diff --git a/webapp/src/components/SimpleDataCard/index.js b/webapp/src/components/SimpleDataCard/index.js index ccb88e7ab..b451456ee 100644 --- a/webapp/src/components/SimpleDataCard/index.js +++ b/webapp/src/components/SimpleDataCard/index.js @@ -2,7 +2,6 @@ import React, { memo } from 'react' import { makeStyles } from '@mui/styles' import PropTypes from 'prop-types' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import LinearProgress from '@mui/material/LinearProgress' import Typography from '@mui/material/Typography' @@ -32,11 +31,11 @@ const SimpleDataCard = ({ onMouseOver={helperText ? handleOpen : null} onMouseMove={helperText ? handleOpen : null} onMouseOut={helperText ? handleClose : null} - className={`${classes.cardShadow} ${classes.border} ${ + className={`${classes.border} ${ helperText ? classes.tooltipHover : '' }`} > - +
{title && (
@@ -70,7 +69,7 @@ const SimpleDataCard = ({ ) : ( )} - +
) diff --git a/webapp/src/components/SimpleDataCard/styles.js b/webapp/src/components/SimpleDataCard/styles.js index bc7fcd7bc..e1b147581 100644 --- a/webapp/src/components/SimpleDataCard/styles.js +++ b/webapp/src/components/SimpleDataCard/styles.js @@ -1,12 +1,9 @@ export default (theme) => ({ cards: { textTransform: 'capitalize', - minHeight: '90px', + minHeight: '58px', height: '100%', }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, border: { border: '0.5px solid transparent', }, @@ -40,6 +37,7 @@ export default (theme) => ({ textAlign: 'center', height: '100%', alignItems: 'center', + paddingBottom: theme.spacing(4), }, svgLink: { fontSize: 18, @@ -62,7 +60,7 @@ export default (theme) => ({ tooltipHover: { '&:hover': { border: `0.5px solid ${theme.palette.primary.main}`, - boxShadow: '0px 0px 40px -30px #1565c0bf inset !important', + boxShadow: `${theme.palette.shadows.hover} !important`, '& svg': { cursor: 'pointer', color: theme.palette.primary.main, diff --git a/webapp/src/components/ToggleColorMode/index.js b/webapp/src/components/ToggleColorMode/index.js new file mode 100644 index 000000000..bebcbe7c5 --- /dev/null +++ b/webapp/src/components/ToggleColorMode/index.js @@ -0,0 +1,25 @@ +import React from 'react' +import IconButton from '@mui/material/IconButton' +import LightModeIcon from '@mui/icons-material/LightMode' +import DarkModeIcon from '@mui/icons-material/DarkMode' +import { useTheme } from '@mui/material/styles' + +import { useThemeStateContext } from 'context/theme.context' + +const ToggleColorMode = () => { + const theme = useTheme() + const [, { toggleColorMode }] = useThemeStateContext() + + return ( + + {theme.palette.mode === 'light' ? : } + + ) +} + +export default ToggleColorMode diff --git a/webapp/src/components/Tooltip/styles.js b/webapp/src/components/Tooltip/styles.js index 3c01ae1ed..25129a499 100644 --- a/webapp/src/components/Tooltip/styles.js +++ b/webapp/src/components/Tooltip/styles.js @@ -1,7 +1,6 @@ export default (theme) => ({ paper: { - border: '1px solid rgba(0, 0, 0, 0.12)', - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', + border: `1px solid ${theme.palette.neutral.light}`, }, popover: { padding: theme.spacing(2), diff --git a/webapp/src/components/TransactionsChartContainer/index.js b/webapp/src/components/TransactionsChartContainer/index.js index d17d83624..68c30ca1b 100644 --- a/webapp/src/components/TransactionsChartContainer/index.js +++ b/webapp/src/components/TransactionsChartContainer/index.js @@ -1,111 +1,64 @@ import React from 'react' -import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import PropTypes from 'prop-types' -import Select from '@mui/material/Select' -import MenuItem from '@mui/material/MenuItem' -import FormControl from '@mui/material/FormControl' -import InputLabel from '@mui/material/InputLabel' -import Typography from '@mui/material/Typography' import LinearProgress from '@mui/material/LinearProgress' -import PauseButton from '../../components/PauseButton' +import ChartHeader from '../../components/ChartHeader' import TransactionsLineChart from '../../components/TransactionsLineChart' -import styles from './styles' - -const useStyles = makeStyles(styles) - const TransactionsChartContainer = ({ - title, - ariaLabel, + title, + ariaLabel, loading, data, - isPaused, - handlePause, + isPaused, + handlePause, chartLabelFormat, - historyState + historyState, }) => { - const classes = useStyles() const { t } = useTranslation() return ( - - + + {loading && } + -
- - {title} - -
- - {historyState?.isHistoryEnabled && ( - <> - {t('timeFrame')} - - - )} - - {handlePause && ( - - )} -
-
- {loading && } - -
+ }, + maxPadding: 0.05, + }} + data={data} + shared={chartLabelFormat?.shared} + customFormatter={chartLabelFormat?.customFormatter} + />
) } @@ -129,7 +82,7 @@ TransactionsChartContainer.propTypes = { isLive: PropTypes.bool, isHistoryEnabled: PropTypes.bool, onSelect: PropTypes.func, - }) + }), } TransactionsChartContainer.defaultProps = { diff --git a/webapp/src/components/TransactionsLineChart/index.js b/webapp/src/components/TransactionsLineChart/index.js index 267947013..b6a27fee5 100644 --- a/webapp/src/components/TransactionsLineChart/index.js +++ b/webapp/src/components/TransactionsLineChart/index.js @@ -1,7 +1,7 @@ import React from 'react' -import HighchartsReact from 'highcharts-react-official' import PropTypes from 'prop-types' -import Highcharts from 'highcharts' + +import HighchartsWrapper from '../HighChartsWrapper' const TransactionsLineChart = ({ data, @@ -13,9 +13,6 @@ const TransactionsLineChart = ({ customFormatter }) => { const options = { - time: { - timezoneOffset: new Date().getTimezoneOffset(), - }, title: { text: title, }, @@ -36,15 +33,12 @@ const TransactionsLineChart = ({ } return ( -
- -
+ ) } diff --git a/webapp/src/components/ViewBPProfile/index.js b/webapp/src/components/ViewBPProfile/index.js index 9a94b0d6a..1f43fafda 100644 --- a/webapp/src/components/ViewBPProfile/index.js +++ b/webapp/src/components/ViewBPProfile/index.js @@ -1,7 +1,6 @@ import React from 'react' import { Link } from 'react-router-dom' import { makeStyles } from '@mui/styles' -import { useTranslation } from 'react-i18next' import Button from '@mui/material/Button' import { eosConfig } from '../../config' @@ -10,13 +9,12 @@ import styles from './styles' const useStyles = makeStyles(styles) -const ViewBPProfile = ({ producer }) => { +const ViewBPProfile = ({ producer, text }) => { const classes = useStyles() - const { t } = useTranslation('producerCardComponent') return ( ) } diff --git a/webapp/src/config/eos.config.js b/webapp/src/config/eos.config.js index 35554eb6c..1ff232a2c 100644 --- a/webapp/src/config/eos.config.js +++ b/webapp/src/config/eos.config.js @@ -21,12 +21,11 @@ switch (networkName) { _nodeTypes = [ { name: 'validator', - color: '#4f4363', description: 'Node with signing key', }, - { name: 'boot', color: '#6ec4e0', description: 'Boot node' }, - { name: 'writer', color: '#5484b3', description: 'Writer node' }, - { name: 'observer', color: '#000', description: 'Observer node' }, + { name: 'boot', description: 'Boot node' }, + { name: 'writer', description: 'Writer node' }, + { name: 'observer', description: 'Observer node' }, ] _producerTypes = ['partners', 'nonPartners'] break @@ -34,22 +33,18 @@ switch (networkName) { _nodeTypes = [ { name: 'producer', - color: '#4f4363', description: 'Node with signing key', }, { name: 'full', - color: '#6ec4e0', description: 'Node in front of producer', }, { name: 'query', - color: '#5484b3', description: 'Node that provides HTTP(S) API to the public', }, { name: 'seed', - color: '#000', description: 'Node that provides P2P and/or BNET to the public', }, ] diff --git a/webapp/src/context/theme.context.js b/webapp/src/context/theme.context.js new file mode 100644 index 000000000..8c6a5b615 --- /dev/null +++ b/webapp/src/context/theme.context.js @@ -0,0 +1,51 @@ +import React from 'react' +import useMediaQuery from '@mui/material/useMediaQuery' +import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles' +import { ThemeProvider } from 'styled-components' + +import themes from '../theme' + +const ThemeStateContext = React.createContext({ toggleColorMode: () => {} }) + +export const ThemeStateProvider = ({ children }) => { + const userRequest = useMediaQuery('(prefers-color-scheme: dark)') + const preference = localStorage.getItem('prefersDarkMode') + const prefersDarkMode = preference ? Boolean(JSON.parse(preference)) : userRequest + + const [mode, setMode] = React.useState(prefersDarkMode ? 'dark' : 'light') + + if (!preference) { + localStorage.setItem('prefersDarkMode', prefersDarkMode) + } + + const colorMode = React.useMemo( + () => ({ + toggleColorMode: () => { + setMode(prev => { + localStorage.setItem('prefersDarkMode', prev === 'light') + + return prev === 'light' ? 'dark' : 'light' + }) + }, + }), + [], + ) + + const theme = React.useMemo(() => themes[mode === 'light' ? 0 : 1], [mode]) + + return ( + + + {children} + + + ) +} + +export const useThemeStateContext = () => { + const context = React.useContext(ThemeStateContext) + + const { toggleColorMode } = context + + return [{}, { toggleColorMode }] +} diff --git a/webapp/src/index.js b/webapp/src/index.js index f619565d4..f90713397 100644 --- a/webapp/src/index.js +++ b/webapp/src/index.js @@ -1,12 +1,11 @@ import React from 'react' import { createRoot } from 'react-dom/client' import { ApolloProvider } from '@apollo/client' -import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles' import { StylesProvider } from '@mui/styles' -import { ThemeProvider } from 'styled-components' + +import { ThemeStateProvider } from 'context/theme.context' import App from './App' -import theme from './theme' import { client } from './graphql' import * as serviceWorker from './serviceWorker' import './i18n' @@ -17,11 +16,9 @@ const root = createRoot(container) root.render( - - - - - + + + , ) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index a3c6aee3f..e9f7b23f4 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -50,7 +50,8 @@ "nextUpdateAt": "Next update at", "secondsAgo": "Seconds Ago", "metaTitle": "Antelope Tools network monitors real-time infrastructure data for multiple Antelope and EOSIO chains.", - "metaDescription": "Antelope Tools Dashboard is a network monitor featuring real-time data on block producer nodes and blockchain infrastructure for multiple Antelope and EOSIO chains." + "metaDescription": "Antelope Tools Dashboard is a network monitor featuring real-time data on block producer nodes and blockchain infrastructure for multiple Antelope and EOSIO chains.", + "goBack": "Go Back" }, "routes": { "/>sidebar": "Dashboard", @@ -87,7 +88,7 @@ "/faucet>heading": "{{networkName}} Account Creator and Token Faucet", "/ricardian-contract>sidebar": "BP Agreement", "/ricardian-contract>title": "BP Agreement - {{networkName}} Network Dashboard", - "/ricardian-contract>heading": "", + "/ricardian-contract>heading": "Block Producer Agreement on {{networkName}}", "/block-distribution>sidebar": "Block Distribution", "/block-distribution>title": "Block Production Distribution - {{networkName}} Network Dashboard", "/block-distribution>heading": "Block Production Distribution on {{networkName}}", @@ -112,11 +113,11 @@ "/about>sidebar": "About", "/about>title": "About - {{networkName}} Network Monitor and Infrastructure Dashboard", "/about>heading": "About Antelope Tools", - "/about>moreDescription": "", + "/about>moreDescription": "Learn more about Edenia and the Antelope Tools project, its importance and how you can get involved", "/help>sidebar": "Help", "/help>title": "Help - {{networkName}} Network Dashboard", "/help>heading": "Welcome to the Antelope Tools Help Center", - "/help>moreDescription": "", + "/help>moreDescription": "Check how the bp.json Standard is used, troubleshoot if BP data is missing and contact us if you have suggestions", "networkInformation": "Network Information", "tools": "Tools", "docs": "Docs", @@ -132,10 +133,11 @@ "/undiscoverable-bps>moreDescription": "A list of the paid block producers on the network which do not provide information in their BP.json files.", "/bpjson>moreDescription": "A tool for block producers to provide details of their organizations and nodes to comply with the BP information standard.", "/node-config>moreDescription": "Use this tool to obtain example config files to help configure a new node on the network.", - "/ricardian-contract>moreDescription": "The on-chain ricardian contract that describes the validator node agreement of this network.", + "/ricardian-contract>moreDescription": "The on-chain ricardian contract that describes the validator node agreement of {{networkName}}.", "/>moreDescription": "Monitor the infrastructure of blockchain networks using Antelope + EOSIO blockchain technology.", "/cpu-benchmark>moreDescription": "A visualization of CPU usage in microseconds by block producer nodes accounts, with lowest, highest, and average usage data.", "/block-producers>moreDescription": "A list of the block producers in the network – blockchain accounts registered to run nodes on the network. It includes information from chain tables and their bp.json files.", + "/block-producers/bpName>moreDescription": "View block producer general information such as rank, rewards and compliance", "/nodes>moreDescription": "A list of all the nodes run by block producers comprising the network with specific information such as endpoints and location.", "/endpoints>moreDescription": "An updated list of public API endpoints provided by node operators and their health status.", "/endpoints-stats>moreDescription": "Response time statistics from Costa Rica and the availability of a producer's endpoints.", @@ -246,7 +248,7 @@ "keyFormat": "Enter a valid ECC key. You can generate one using cleos or any compatible wallet." }, "ricardianContractRoute": { - "title": "Block Producer Agreement" + "title": "Ricardian Contract" }, "aboutRoute": { "body": { @@ -375,7 +377,8 @@ "logo_256": "Logo", "organization_name": "Name", "viewNodes": "View {{totalNodes}} nodes", - "bpNodes": "{{bpName}} Nodes" + "bpNodes": "{{bpName}} Nodes", + "viewNodesProfile": "See Full Nodes Info" }, "nodeCardComponent": { "features": "Features", @@ -442,7 +445,7 @@ "endpointsResponding": "Only endpoints responding", "linkToStats": "Go to stats", "filterEndpoints": "Filter responding endpoints", - "copyToClipboard": "Copy responding endpoints from the column to the clipboard" + "copyToClipboard": "Click to Copy responding endpoints from the column to the clipboard" }, "cpuBenchmarkRoute": { "title": "CPU Usage in Microseconds", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 081d57a16..8dfa0a7e3 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -59,7 +59,8 @@ "noOptions": "Sin coincidencias", "updatedAt": "Última actualización", "nextUpdateAt": "Próxima actualización", - "secondsAgo": "Hace Segundos" + "secondsAgo": "Hace Segundos", + "goBack": "Regresar" }, "routes": { "/>sidebar": "Panel", @@ -99,7 +100,7 @@ "/faucet>heading": "Crear una Cuenta de {{networkName}} y Obtenga Tokens", "/ricardian-contract>sidebar": "Acuerdo de Productor de Bloques", "/ricardian-contract>title": "Acuerdo de Productor de Bloques - Panel de red de {{networkName}}", - "/ricardian-contract>heading": "", + "/ricardian-contract>heading": "Acuerdo de Productor de Bloques en {{networkName}}", "/block-distribution>sidebar": "Distribución de bloques", "/block-distribution>title": "Distribución de bloques - Panel de red de {{networkName}}", "/block-distribution>heading": "Distribución de bloques en {{networkName}}", @@ -116,9 +117,11 @@ "/about>sidebar": "Acerca de", "/about>title": "Acerca de - Monitor de Infraestructura Blockchain de {{networkName}}", "/about>heading": "Acerca de Antelope Tools", + "/about>moreDescription": "Conozca más sobre Edenia y Antelope Tools su importancia y como puede involucrarse", "/help>sidebar": "Ayuda", "/help>title": "Ayuda - Panel de red de {{networkName}}", "/help>heading": "Bienvenidos al Centro de Ayuda de Antelope Tools", + "/help>moreDescription": "Revise como se usa el estándar bp.json, resuelva la ausencia de datos de BP y contáctenos si tiene alguna sugerencia", "networkInformation": "Información de la red", "tools": "Herramientas", "docs": "Documentación", @@ -138,6 +141,7 @@ "/>moreDescription": "Encuentre datos de redes blockchain utilizando la tecnología EOSIO. Vea más redes aquí: https://antelope.tools/.", "/cpu-benchmark>moreDescription": "Una visualización del uso de CPU en microsegundos por cuentas de nodos productores de bloques, con datos de uso más bajos, más altos y promedio.", "/block-producers>moreDescription": "Una lista de los productores de bloques en la red: cuentas de blockchain registradas para ejecutar nodos en la red. Incluye información de tablas en cadena y sus archivos bp.json.", + "/block-producers/bpName>moreDescription": "Vea la información general del productor de bloques como el rango, recompensas y compliance.", "/nodes>moreDescription": "Una lista de todos los nodos ejecutados por entidades que componen la red con información específica como puntos finales y ubicación.", "/endpoints>moreDescription": "Una lista actualizada de los puntos finales de la API pública proporcionada por los operadores de nodos en la red.", "/endpoints-stats>moreDescription": "Estadísticas del tiempo de respuesta desde Costa Rica y la disponibilidad de los puntos finales de un productor", @@ -248,7 +252,7 @@ "keyFormat": "Introduzca una clave ECC válida. Puede generar una usando cleos o cualquier billetera compatible." }, "ricardianContractRoute": { - "title": "Acuerdo de Productor de Bloques" + "title": "Contrato Ricardiano" }, "aboutRoute": { "body": { @@ -373,7 +377,8 @@ "generalInformation": "Información General", "organization_name": "Nombre", "viewNodes": "Ver {{totalNodes}} nodos", - "bpNodes": "Nodos de {{bpName}}" + "bpNodes": "Nodos de {{bpName}}", + "viewNodesProfile": "Ver Información de los Nodos" }, "nodeCardComponent": { "features": "Características", diff --git a/webapp/src/layouts/Dashboard.js b/webapp/src/layouts/Dashboard.js index bbfe7de65..334440a67 100644 --- a/webapp/src/layouts/Dashboard.js +++ b/webapp/src/layouts/Dashboard.js @@ -27,7 +27,7 @@ const INIT_VALUES = { dynamicTitle: '', pathname: null, } -const useStyles = makeStyles((theme) => styles(theme)) +const useStyles = makeStyles(styles) const GlobalStyle = createGlobalStyle` html, @@ -35,9 +35,6 @@ const GlobalStyle = createGlobalStyle` #root { height: 100%; } - body { - background: ${(props) => props.theme.body.background}; - } .MuiCardHeader-action .MuiIconButton-root { padding: 4px; width: 28px; @@ -57,19 +54,18 @@ const Dashboard = ({ children }) => { setMobileOpen(!mobileOpen) } - const removeParam = route => route.substring(0,route.lastIndexOf('/')) + const removeParam = route => route.substring(0, route.lastIndexOf('/')) useEffect(() => { - const path = location.pathname.replace(/\/$/,'') || '/' - const route = routes.find(route => - route.useParams ? - removeParam(route.path) === removeParam(path) - : - route.path === path + const path = location.pathname.replace(/\/$/, '') || '/' + const route = routes.find(route => + route.useParams + ? removeParam(route.path) === removeParam(path) + : route.path === path, ) - + if (route) { - const pathName = route.path.replace(':','') + const pathName = route.path.replace(':', '') const managementCardTitle = lacchain.dynamicTitle || '' setRouteName({ @@ -83,7 +79,7 @@ const Dashboard = ({ children }) => { pageTitle: t(`${pathName}>title`, { networkName: eosConfig.networkLabel, }), - useConnectWallet: Boolean(route.useConnectWallet) + useConnectWallet: Boolean(route.useConnectWallet), }) } else { setRouteName(INIT_VALUES) @@ -105,7 +101,10 @@ const Dashboard = ({ children }) => { } />
-
+
{ )} {i18n.exists(`routes:${routeName.pathname}>moreDescription`) - ? t(`${routeName.pathname}>moreDescription`) + ? t(`${routeName.pathname}>moreDescription`, { + networkName: eosConfig.networkLabel, + }) : ''}
diff --git a/webapp/src/layouts/StandAlone.js b/webapp/src/layouts/StandAlone.js index 4cf37b4fb..768678c45 100644 --- a/webapp/src/layouts/StandAlone.js +++ b/webapp/src/layouts/StandAlone.js @@ -12,7 +12,7 @@ const GlobalStyle = createGlobalStyle` } body { - background: ${(props) => props.theme.body.background}; + background: ${(props) => props.theme.background.light}; } ` diff --git a/webapp/src/layouts/styles.js b/webapp/src/layouts/styles.js index 20b456593..ac90b0f3a 100644 --- a/webapp/src/layouts/styles.js +++ b/webapp/src/layouts/styles.js @@ -5,9 +5,7 @@ export default (theme) => ({ }, drawer: { display: 'flex', - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', zIndex: 2, - paddingBottom: theme.spacing(3), [theme.breakpoints.down('md')]: { width: '0 !important', flexShrink: 0, @@ -28,13 +26,9 @@ export default (theme) => ({ mainContent: { padding: theme.spacing(4), minHeight: '90vh', - background: theme.body.background, '@media all and (-ms-high-contrast: none), (-ms-high-contrast: active)': { flex: 'none', }, - '& .MuiPaper-root .MuiPaper-root': { - boxShadow: 'none', - }, }, header: { flex: '100%', @@ -67,28 +61,6 @@ export default (theme) => ({ }, }, }, - boxReadmore: { - display: 'flex', - flexDirection: 'row', - alignItems: 'flex-end', - justifyContent: 'center', - paddingTop: theme.spacing(2), - '& span': { - fontSize: 14, - letterSpacing: '0.3px', - color: '#1565C0', - marginLeft: theme.spacing(1), - '&:hover': { - cursor: 'pointer', - }, - }, - [theme.breakpoints.up('sm')]: { - justifyContent: 'flex-start', - '& span': { - marginLeft: theme.spacing(4), - }, - }, - }, boxHeader: { display: 'flex', flexDirection: 'column', diff --git a/webapp/src/routes/About/index.js b/webapp/src/routes/About/index.js index 85bf94ef4..96a269755 100644 --- a/webapp/src/routes/About/index.js +++ b/webapp/src/routes/About/index.js @@ -3,7 +3,7 @@ import Typography from '@mui/material/Typography' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' +import Link from '@mui/material/Link' import { eosConfig } from '../../config' @@ -22,86 +22,83 @@ const About = () => { .replace(' Testnet', '') return ( - - -
-
- -
-
- - {t('body.paragraph1', { networkName: networkNameLabel })} - - - {t('subtitle1')} - - - - {t('body1.edenia')} - {' '} - {t('body1.paragraph1')} - - - {t('subtitle2')} - - - {t('body2.paragraph1')} - - - {t('subtitle3')} - - - {t('body3.paragraph1', { networkName: networkNameLabel })} - - - {t('subtitle4')} - - - {t('body4.paragraph1')} - - - {t('subtitle5')} - - - {t('body5.paragraph1')}{' '} - - {t('body5.pomelo')} - - {t('body5.paragraph2')} - - - {t('subtitle6')} - - - {t('body6.paragraph1')} - - {t('body6.github')} - - {' '}{t('body6.paragraph2')} - - {t('body6.telegram')} - - {'. '}{t('body6.paragraph3')} - -
-
-
+ +
+ +
+
+ + {t('body.paragraph1', { networkName: networkNameLabel })} + + + {t('subtitle1')} + + + + {t('body1.edenia')} + {' '} + {t('body1.paragraph1')} + + + {t('subtitle2')} + + + {t('body2.paragraph1')} + + + {t('subtitle3')} + + + {t('body3.paragraph1', { networkName: networkNameLabel })} + + + {t('subtitle4')} + + + {t('body4.paragraph1')} + + + {t('subtitle5')} + + + {t('body5.paragraph1')}{' '} + + {t('body5.pomelo')} + + {t('body5.paragraph2')} + + + {t('subtitle6')} + + + {t('body6.paragraph1')} + + {t('body6.github')} + {' '} + {t('body6.paragraph2')} + + {t('body6.telegram')} + + {'. '} + {t('body6.paragraph3')} + +
) } diff --git a/webapp/src/routes/About/styles.js b/webapp/src/routes/About/styles.js index ee96232e2..01e510d9b 100644 --- a/webapp/src/routes/About/styles.js +++ b/webapp/src/routes/About/styles.js @@ -26,12 +26,8 @@ export default (theme) => ({ width: '100%', }, }, - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, mainText: { width: '100%', - overflow: 'hidden', [theme.breakpoints.down('md')]: { display: 'flex', flexDirection: 'column', diff --git a/webapp/src/routes/Accounts/index.js b/webapp/src/routes/Accounts/index.js index d753c0b5a..3fd20e95b 100644 --- a/webapp/src/routes/Accounts/index.js +++ b/webapp/src/routes/Accounts/index.js @@ -2,7 +2,6 @@ import React, { lazy } from 'react' import { makeStyles } from '@mui/styles' import LinearProgress from '@mui/material/LinearProgress' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import SearchBar from '../../components/SearchBar' @@ -22,15 +21,13 @@ const Accounts = () => { return ( <> - - - - + + {loading && } {account && ( diff --git a/webapp/src/routes/Accounts/styles.js b/webapp/src/routes/Accounts/styles.js index bcb4293a5..942df2b6a 100644 --- a/webapp/src/routes/Accounts/styles.js +++ b/webapp/src/routes/Accounts/styles.js @@ -14,7 +14,10 @@ export default (theme) => ({ textAlign: 'left !important', marginBottom: `${theme.spacing(2)} !important` }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, + searchWrapper: { + '& .MuiPaper-root': { + boxShadow: 'none', + padding: 0, + } + } }) diff --git a/webapp/src/routes/BPJson/index.js b/webapp/src/routes/BPJson/index.js index aaa77fceb..3718d67b2 100644 --- a/webapp/src/routes/BPJson/index.js +++ b/webapp/src/routes/BPJson/index.js @@ -1,47 +1,39 @@ import React from 'react' -import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import LinearProgress from '@mui/material/LinearProgress' -import Typography from '@mui/material/Typography' import Alert from '@mui/material/Alert' +import Card from '@mui/material/Card' +import Typography from '@mui/material/Typography' import { BPJsonGenerator } from '@eoscostarica/eoscr-components' -import { makeStyles } from '@mui/styles' import { eosConfig } from '../../config' import useBPJsonState from './useBPJsonState' -import styles from './styles' - -const useStyles = makeStyles(styles) const BPJson = () => { - const classes = useStyles() const [ { loading, inconsistencyMessage, initData, producer, error, ual }, { t, handleOnSubmit }, ] = useBPJsonState() return ( - - - {loading && ( - <> - - {t('loadText')} - - - - )} - {error && {error}} - {inconsistencyMessage && ( - {inconsistencyMessage} - )} - - + + {loading && ( + <> + + {t('loadText')} + + + + )} + {error && {error}} + {inconsistencyMessage && ( + {inconsistencyMessage} + )} + ) } diff --git a/webapp/src/routes/BPJson/styles.js b/webapp/src/routes/BPJson/styles.js index e6c0ec241..ff6466532 100644 --- a/webapp/src/routes/BPJson/styles.js +++ b/webapp/src/routes/BPJson/styles.js @@ -1,5 +1 @@ -export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, -}) +export default (theme) => ({}) diff --git a/webapp/src/routes/BlockDistribution/index.js b/webapp/src/routes/BlockDistribution/index.js index 0ac9e7b3f..06ef2b14d 100644 --- a/webapp/src/routes/BlockDistribution/index.js +++ b/webapp/src/routes/BlockDistribution/index.js @@ -3,8 +3,6 @@ import React, { useEffect, useState } from 'react' import { useLazyQuery } from '@apollo/client' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' -import Typography from '@mui/material/Typography' import LinearProgress from '@mui/material/LinearProgress' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' @@ -12,63 +10,49 @@ import TableCell from '@mui/material/TableCell' import TableContainer from '@mui/material/TableContainer' import TableHead from '@mui/material/TableHead' import TableRow from '@mui/material/TableRow' -import InputLabel from '@mui/material/InputLabel' -import MenuItem from '@mui/material/MenuItem' -import FormControl from '@mui/material/FormControl' -import Select from '@mui/material/Select' -import Highcharts from 'highcharts' -import HighchartsReact from 'highcharts-react-official' -import { makeStyles } from '@mui/styles' import { formatWithThousandSeparator, rangeOptions } from '../../utils' import { BLOCK_DISTRIBUTION_QUERY } from '../../gql' - -import styles from './styles' - -const useStyles = makeStyles(styles) - -const options = { - time: { - timezoneOffset: new Date().getTimezoneOffset(), - }, - title: { - text: ' ', - }, - chart: { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false, - type: 'pie', - }, - tooltip: { - pointFormat: '{point.percentage:.1f}%', - backgroundColor: '#fff', - borderColor: '#fff', - borderRadius: 10, - borderWidth: 1, - }, - credits: { - enabled: false, - }, - plotOptions: { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '{point.name}: {point.percentage:.1f} %', - }, - }, - }, - series: [], -} +import ChartHeader from '../../components/ChartHeader' +import HighchartsWrapper from '../../components/HighChartsWrapper' const BlockDistribution = () => { const { t } = useTranslation('blockDistributionRoute') const [range, setRange] = useState(rangeOptions[0]) const [series, setSeries] = useState([]) const [load, { loading, data }] = useLazyQuery(BLOCK_DISTRIBUTION_QUERY) - const classes = useStyles() + + const options = { + title: { + text: ' ', + }, + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie', + }, + tooltip: { + pointFormat: '{point.percentage:.1f}%', + }, + credits: { + enabled: false, + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '{point.name}: {point.percentage:.1f} %', + style: { + textOutline: 'none', + }, + }, + }, + }, + series: [], + } useEffect(() => { load({ @@ -95,70 +79,49 @@ const BlockDistribution = () => { }, [data]) return ( - - -
- - {t('title')} - -
- - - {t('timeFrame')} - - - -
-
- {loading && } - {!loading && data?.items?.length > 0 && ( - <> - - -
- - - {t('account')} - {t('blocksProduced')} - {t('percent')} + + + {loading && } + {!loading && data?.items?.length > 0 && ( + <> + + +
+ + + {t('account')} + {t('blocksProduced')} + {t('percent')} + + + + {data?.items.map((item, index) => ( + + {item.account} + + {formatWithThousandSeparator(item.blocks)} + + + {formatWithThousandSeparator( + Math.ceil(item.percent * 100), + 1, + )} + % + - - - {data?.items.map((item, index) => ( - - {item.account} - - {formatWithThousandSeparator(item.blocks)} - - - {formatWithThousandSeparator( - Math.ceil(item.percent * 100), - 1, - )} - % - - - ))} - -
-
- - )} - + ))} + + + + + )} ) } diff --git a/webapp/src/routes/BlockDistribution/styles.js b/webapp/src/routes/BlockDistribution/styles.js deleted file mode 100644 index d553b8c81..000000000 --- a/webapp/src/routes/BlockDistribution/styles.js +++ /dev/null @@ -1,15 +0,0 @@ -export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, - formControl: { - display: 'flex', - flexDirection: 'row-reverse', - }, - textDiv: { - display: "flex", - justifyContent: "space-between", - alignItems: "center", - p: '{1} ' - } -}) diff --git a/webapp/src/routes/BlockProducers/index.js b/webapp/src/routes/BlockProducers/index.js index fa68ac97a..7b5a6d2d0 100644 --- a/webapp/src/routes/BlockProducers/index.js +++ b/webapp/src/routes/BlockProducers/index.js @@ -3,6 +3,7 @@ import React, { memo } from 'react' import { Link } from 'react-router-dom' import PropTypes from 'prop-types' import { makeStyles } from '@mui/styles' +import Card from '@mui/material/Card' import LinearProgress from '@mui/material/LinearProgress' import Pagination from '@mui/material/Pagination' import PaginationItem from '@mui/material/PaginationItem' @@ -66,7 +67,7 @@ const Producers = () => { return ( <> -
+
{ ) : !!items?.length ? ( <> -
+ -
+ ({ formControl: { width: '100%', }, - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, }) diff --git a/webapp/src/routes/CPUBenchmark/index.js b/webapp/src/routes/CPUBenchmark/index.js index 872322a17..fdcb4183a 100644 --- a/webapp/src/routes/CPUBenchmark/index.js +++ b/webapp/src/routes/CPUBenchmark/index.js @@ -3,8 +3,6 @@ import React, { useEffect, useState } from 'react' import { useLazyQuery } from '@apollo/client' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' -import Typography from '@mui/material/Typography' import LinearProgress from '@mui/material/LinearProgress' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' @@ -12,19 +10,15 @@ import TableCell from '@mui/material/TableCell' import TableContainer from '@mui/material/TableContainer' import TableHead from '@mui/material/TableHead' import TableRow from '@mui/material/TableRow' -import InputLabel from '@mui/material/InputLabel' -import MenuItem from '@mui/material/MenuItem' -import FormControl from '@mui/material/FormControl' -import Select from '@mui/material/Select' import Button from '@mui/material/Button' -import Highcharts from 'highcharts' -import HighchartsReact from 'highcharts-react-official' import { makeStyles } from '@mui/styles' import styles from './styles' import { formatWithThousandSeparator, rangeOptions } from '../../utils' import { CPU_BENCHMARK } from '../../gql' +import ChartHeader from '../../components/ChartHeader' +import HighchartsWrapper from '../../components/HighChartsWrapper' const useStyles = makeStyles(styles) @@ -33,9 +27,6 @@ const options = { type: 'spline', zoomType: 'x' }, - time: { - timezoneOffset: new Date().getTimezoneOffset(), - }, title: { text: ' ', }, @@ -180,75 +171,58 @@ const CPUBenchmark = () => { }, [data]) return ( - - -
- - {t('title')} - - - - {t('timeFrame')} - - - -
- {loading && } - {!loading && data?.items.length > 0 && ( - <> - -
- {t('selectTo')} - - {t('zoomTo')}. -
- - - - - {t('account')} - {t('lowest')} - {t('highest')} - {t('average')} + + + {loading && } + {!loading && data?.items.length > 0 && ( + <> + +
+ {t('selectTo')} + + {t('zoomTo')}. +
+ +
+ + + {t('account')} + {t('lowest')} + {t('highest')} + {t('average')} + + + + {producers.map((item, index) => ( + + {item.name} + + {formatWithThousandSeparator(item.lowest, 2)} μs + + + {formatWithThousandSeparator(item.highest, 2)} μs + + + {formatWithThousandSeparator(item.average, 2)} μs + - - - {producers.map((item, index) => ( - - {item.name} - - {formatWithThousandSeparator(item.lowest, 2)} μs - - - {formatWithThousandSeparator(item.highest, 2)} μs - - - {formatWithThousandSeparator(item.average, 2)} μs - - - ))} - -
-
- - )} -
+ ))} + + + + + )}
) } diff --git a/webapp/src/routes/CPUBenchmark/styles.js b/webapp/src/routes/CPUBenchmark/styles.js index d3cec29fe..408409580 100644 --- a/webapp/src/routes/CPUBenchmark/styles.js +++ b/webapp/src/routes/CPUBenchmark/styles.js @@ -1,17 +1,4 @@ export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, - formControl: { - display: 'flex', - flexDirection: 'row-reverse', - }, - textDiv: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - p: '{1} ', - }, infoContainer: { display: 'flex', justifyContent: 'center', diff --git a/webapp/src/routes/EVMDashboard/index.js b/webapp/src/routes/EVMDashboard/index.js index 6e089ec43..1352461d8 100644 --- a/webapp/src/routes/EVMDashboard/index.js +++ b/webapp/src/routes/EVMDashboard/index.js @@ -1,5 +1,4 @@ import React from 'react' -import { useTheme } from '@mui/material/styles' import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' @@ -16,7 +15,6 @@ const useStyles = makeStyles(styles) const EVMDashboard = () => { const classes = useStyles() - const theme = useTheme() const { t } = useTranslation('evmDashboardRoute') const [ @@ -32,7 +30,7 @@ const EVMDashboard = () => { isLive, }, { handleSelect, handlePause }, - ] = useEVMState(theme, t) + ] = useEVMState(t) return ( <> diff --git a/webapp/src/routes/EVMDashboard/useEVMstate.js b/webapp/src/routes/EVMDashboard/useEVMstate.js index ce71da167..f048d9410 100644 --- a/webapp/src/routes/EVMDashboard/useEVMstate.js +++ b/webapp/src/routes/EVMDashboard/useEVMstate.js @@ -13,7 +13,7 @@ import ethApi from '../../utils/ethapi' import { rangeOptions } from '../../utils' import { evmConfig } from '../../config' -const useEVMState = (theme, t) => { +const useEVMState = t => { const { data: stats, loading } = useSubscription(EVM_STATS_SUBSCRIPTION) const { data: historicalStats, loading: historicalLoading } = useSubscription( EVM_HISTORICAL_STATS_SUBSCRIPTION, @@ -154,17 +154,15 @@ const useEVMState = (theme, t) => { setTokenHistoryData([ { name: t('incoming'), - color: theme.palette.secondary.main, data: incoming, }, { name: t('outgoing'), - color: theme.palette.tertiary.main, data: outgoing, }, ]) } - }, [tokenData, t, theme]) + }, [tokenData, t]) useEffect(() => { if (transactionsData?.transactions) { @@ -180,12 +178,11 @@ const useEVMState = (theme, t) => { setTransactionsHistoryData([ { name: t('transactions'), - color: theme.palette.secondary.main, data, }, ]) } - }, [transactionsData, t, theme]) + }, [transactionsData, t]) useEffect(() => { const updateTPB = async blockNum => { @@ -235,11 +232,10 @@ const useEVMState = (theme, t) => { setTransactionsHistoryData([ { name: t('transactions'), - color: theme.palette.secondary.main, data: blocksList, }, ]) - }, [blocksList, t, theme]) + }, [blocksList, t]) return [ { diff --git a/webapp/src/routes/EVMEndpointsList/index.js b/webapp/src/routes/EVMEndpointsList/index.js index 42ce37a2c..bb3d6a9bd 100644 --- a/webapp/src/routes/EVMEndpointsList/index.js +++ b/webapp/src/routes/EVMEndpointsList/index.js @@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' import Button from '@mui/material/Button' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' import TableCell from '@mui/material/TableCell' @@ -33,77 +32,75 @@ const EVMEndpointsList = () => { const { healthLights } = generalConfig return ( - - -
- - {t('title')} - - -
-
-
- -
-
- - {t('filterEndpoints')} - - { - handleFilter(event.target?.checked) - }} - /> -
+ +
+ + {t('title')} + + +
+
+
+
-
- - - - - {t('rpcEndpoint')} - {t('lastBlock')} - {t('latency')} - - - - {endpoints?.map((endpoint, index) => ( - (!filter || getStatus(endpoint) !== healthLights.redLight) && ( - - -
- {endpoint.url} - - - -
-
- - {formatWithThousandSeparator(endpoint.height) || 'N/A'} - - - {endpoint.latency - ? `${formatWithThousandSeparator(endpoint.latency)} ms` - : 'N/A'} - -
- ) - ))} -
-
-
+
+ + {t('filterEndpoints')} + + { + handleFilter(event.target?.checked) + }} + />
- +
+
+ + + + + {t('rpcEndpoint')} + {t('lastBlock')} + {t('latency')} + + + + {endpoints?.map((endpoint, index) => ( + (!filter || getStatus(endpoint) !== healthLights.redLight) && ( + + +
+ {endpoint.url} + + + +
+
+ + {formatWithThousandSeparator(endpoint.height) || 'N/A'} + + + {endpoint.latency + ? `${formatWithThousandSeparator(endpoint.latency)} ms` + : 'N/A'} + +
+ ) + ))} +
+
+
+
) } diff --git a/webapp/src/routes/EVMEndpointsList/styles.js b/webapp/src/routes/EVMEndpointsList/styles.js index b8a291f0b..5abb8d73c 100644 --- a/webapp/src/routes/EVMEndpointsList/styles.js +++ b/webapp/src/routes/EVMEndpointsList/styles.js @@ -1,7 +1,4 @@ export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, healthContainer: { display: 'flex', width: '300px', diff --git a/webapp/src/routes/EndpointsList/index.js b/webapp/src/routes/EndpointsList/index.js index d2bcad2c8..ac3a3f3cf 100644 --- a/webapp/src/routes/EndpointsList/index.js +++ b/webapp/src/routes/EndpointsList/index.js @@ -3,7 +3,6 @@ import React from 'react' import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import Typography from '@mui/material/Typography' import LinearProgress from '@mui/material/LinearProgress' import InputLabel from '@mui/material/InputLabel' @@ -35,86 +34,84 @@ const EndpointsList = () => { ] = useEndpointsState() return ( - - -
-
- - {t('title')} {t('producer')} + +
+
+ + {t('title')} {t('producer')} + + +
+
+
+ + {t('endpointsResponding')} - + { + handleFilter(event.target?.checked) + }} + />
-
-
- - {t('endpointsResponding')} - - { - handleFilter(event.target?.checked) - }} - /> -
-
- -
- - {t('itemsPerPage')} - - +
+
+ + {t('itemsPerPage')} + +
-
- -
- {loading ? ( - - ) : ( - <> - {!!producers?.length ? ( - - ) : ( -
- -
- )} - {pagination.pages > 1 && ( -
- -
- )} - - )} - +
+
+ +
+ {loading ? ( + + ) : ( + <> + {!!producers?.length ? ( + + ) : ( +
+ +
+ )} + {pagination.pages > 1 && ( +
+ +
+ )} + + )} ) } diff --git a/webapp/src/routes/EndpointsList/styles.js b/webapp/src/routes/EndpointsList/styles.js index 739ec412a..b705e6d8b 100644 --- a/webapp/src/routes/EndpointsList/styles.js +++ b/webapp/src/routes/EndpointsList/styles.js @@ -43,9 +43,6 @@ export default (theme) => ({ padding: theme.spacing(4), justifyContent: 'center', }, - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, noShadow: { '& .MuiPaper-root': { boxShadow: 'none !important' diff --git a/webapp/src/routes/EndpointsStats/index.js b/webapp/src/routes/EndpointsStats/index.js index 910028724..9e963f2ee 100644 --- a/webapp/src/routes/EndpointsStats/index.js +++ b/webapp/src/routes/EndpointsStats/index.js @@ -4,14 +4,12 @@ import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' import Autocomplete from '@mui/material/Autocomplete' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' -import Highcharts from 'highcharts' -import HighchartsReact from 'highcharts-react-official' import LinearProgress from '@mui/material/LinearProgress' import TextField from '@mui/material/TextField' import Typography from '@mui/material/Typography' import useHealthCheckState from '../../hooks/customHooks/useHealthCheckHistoryState' +import HighchartsWrapper from '../../components/HighChartsWrapper' import styles from './styles' import EndpointsTable from './EndpointStatsTable' @@ -59,62 +57,57 @@ const EndpointsStats = () => { return ( <> - - - {loading && } - {!loading && ( - - )} - + + {loading && } + {!loading && ( + + )} - - - - {t('byProducer')} - - {producersNames?.length && ( - producer.name)} - value={selectedName} - onChange={(_event, newValue) => { - const producer = producersNames.find( - producer => producer.name === newValue, - ) + + + {t('byProducer')} + + {producersNames?.length && ( + producer.name)} + value={selectedName} + onChange={(_event, newValue) => { + const producer = producersNames.find( + producer => producer.name === newValue, + ) - if (!producer) return + if (!producer) return - setSelected(producer.id) - }} - inputValue={selectedName} - onInputChange={(_event, newInputValue) => { - setSelectedName(newInputValue) - }} - renderInput={params => ( - - )} - noOptionsText={t('noOptions')} - /> - )} - {historyData && ( - - )} - {statsAverage && ( - - )} - + setSelected(producer.id) + }} + inputValue={selectedName} + onInputChange={(_event, newInputValue) => { + setSelectedName(newInputValue) + }} + renderInput={params => ( + + )} + noOptionsText={t('noOptions')} + /> + )} + {historyData && ( + + )} + {statsAverage && ( + + )} ) diff --git a/webapp/src/routes/EndpointsStats/styles.js b/webapp/src/routes/EndpointsStats/styles.js index d36ef0ed0..4ab912879 100644 --- a/webapp/src/routes/EndpointsStats/styles.js +++ b/webapp/src/routes/EndpointsStats/styles.js @@ -1,7 +1,4 @@ export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, cardByProducer: { marginTop: theme.spacing(8) }, diff --git a/webapp/src/routes/Faucet/index.js b/webapp/src/routes/Faucet/index.js index 9e90bf661..15b0a2dd1 100644 --- a/webapp/src/routes/Faucet/index.js +++ b/webapp/src/routes/Faucet/index.js @@ -2,7 +2,6 @@ import React, { useState } from 'react' import { useMutation } from '@apollo/client' import { makeStyles } from '@mui/styles' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' import Typography from '@mui/material/Typography' @@ -157,127 +156,121 @@ const Faucet = () => { return (
-
- - - {t('createAccount')} -
-
- - setCreateAccountValues({ - ...createAccountValues, - ...{ publicKey: e.target.value }, - }) - } - helperText={t('keyFormat')} - required - /> -
- {!isUltraTestnet && ( -
- - setCreateAccountValues({ - ...createAccountValues, - ...{ accountName: e.target.value }, - }) - } - error={!!createAccountValues.accountName && !isValidAccountName(createAccountValues.accountName)} - helperText={t('accountFormat')} - required - /> -
- )} -
- -
+ + {t('createAccount')} +
+
+ + setCreateAccountValues({ + ...createAccountValues, + ...{ publicKey: e.target.value }, + }) + } + helperText={t('keyFormat')} + required + /> +
+ {!isUltraTestnet && ( +
+ + setCreateAccountValues({ + ...createAccountValues, + ...{ accountName: e.target.value }, + }) + } + error={!!createAccountValues.accountName && !isValidAccountName(createAccountValues.accountName)} + helperText={t('accountFormat')} + required + />
- - -
-
- - - {`${t('issueTokens')} (500 ${eosConfig.tokenSymbol})`} -
-
- setAccount(e.target.value)} - error={!!account && !isValidAccountName(account)} - helperText={t('accountFormat')} - required - /> -
-
- -
- {transferTokensTransaction && ( -
- - {t('transferTokensTransaction')} - - - {transferTokensTransaction.slice(0, 7)} - -
- )} + )} +
+ +
+
+
+ + {`${t('issueTokens')} (500 ${eosConfig.tokenSymbol})`} +
+
+ setAccount(e.target.value)} + error={!!account && !isValidAccountName(account)} + helperText={t('accountFormat')} + required + /> +
+
+ +
+ {transferTokensTransaction && ( +
+ + {t('transferTokensTransaction')} + + + {transferTokensTransaction.slice(0, 7)} +
- - -
+ )} +
+
) } diff --git a/webapp/src/routes/Faucet/styles.js b/webapp/src/routes/Faucet/styles.js index 03c5538b7..d16caf9f4 100644 --- a/webapp/src/routes/Faucet/styles.js +++ b/webapp/src/routes/Faucet/styles.js @@ -10,7 +10,7 @@ export default (theme) => ({ width: '300px', }, }, - test: { + container: { display: 'flex', justifyContent: 'center', [theme.breakpoints.down('md')]: { @@ -18,13 +18,9 @@ export default (theme) => ({ height: '100% !important', }, marginBottom: theme.spacing(4), + gap: theme.spacing(4), }, card: { - padding: '10px', height: '100%', - '& .MuiPaper-root': { - height: '100%', - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, }, }) diff --git a/webapp/src/routes/Help/index.js b/webapp/src/routes/Help/index.js index 268533904..ff77a1896 100644 --- a/webapp/src/routes/Help/index.js +++ b/webapp/src/routes/Help/index.js @@ -2,13 +2,12 @@ import React from 'react' import Typography from '@mui/material/Typography' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' +import Card from '@mui/material/Card' import Link from '@mui/material/Link' import HttpIcon from '@mui/icons-material/Http' import TelegramIcon from '@mui/icons-material/Telegram' import GitHubIcon from '@mui/icons-material/GitHub' import { Link as RouterLink } from 'react-router-dom' -import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import { eosConfig } from '../../config' @@ -21,131 +20,138 @@ const Help = () => { const { t } = useTranslation('helpRoute') return ( - - - - {t('title')} - - - {t('paragraph')} - - - {t('subtitle3')} - - {eosConfig.networkName !== 'lacchain' ? ( - <> - - {t('body3.paragraph1Text1')}{' '} - - eosio - - {' '}{t('body3.eosioAccount')} {t('body3.paragraph1Text2')}{' '} - - {t('standard')} - {'.'} - - - ) : ( + + + {t('title')} + + + {t('paragraph')} + + + {t('subtitle3')} + + {eosConfig.networkName !== 'lacchain' ? ( + <> {t('body3.paragraph1Text1')}{' '} - + eosio - - {' '}{t('body3.eosioAccount')} {t('body3.paragraph1Text2')}{' '} - - {t('standard')} - {'.'} + {' '} + {t('body3.eosioAccount')} {t('body3.paragraph1Text2')}{' '} + + {t('standard')} + + {'.'} - )} - - {t('title2')} - - - {t('paragraph2')} + + ) : ( + + {t('body3.paragraph1Text1')}{' '} + + eosio + {' '} + {t('body3.eosioAccount')} {t('body3.paragraph1Text2')}{' '} + + {t('standard')} + + {'.'} -
    -
  1. {t('bullet1Title')} {t('bullet1')}
  2. -
  3. {t('bullet2Title')} {t('bullet2')}
  4. + )} + + {t('title2')} + + + {t('paragraph2')} + +
      +
    1. + {t('bullet1Title')} + {t('bullet1')} +
    2. +
    3. + {t('bullet2Title')} + {t('bullet2')} -
    4. {t('bullet3Title')} {t('bullet3')}
    5. -
    - - {t('title3')} - - - {t('paragraph3')}{' '} - - {t('bpjsonGenerator')} - {'.'} - - - {t('title4')} - - - {t('paragraph4')} - -
    - - - {t('githubEOSCR')} - -
    -
    - - - {t('telegramChannel')} - -
    -
    - - - {t('websiteEOSCR')} - -
    - + +
  5. + {t('bullet3Title')} + {t('bullet3')} +
  6. +
+ + {t('title3')} + + + {t('paragraph3')}{' '} + + {t('bpjsonGenerator')} + + {'.'} + + + {t('title4')} + + + {t('paragraph4')} + +
+ + + {t('githubEOSCR')} + +
+
+ + + {t('telegramChannel')} + +
+
+ + + {t('websiteEOSCR')} + +
) } diff --git a/webapp/src/routes/Help/styles.js b/webapp/src/routes/Help/styles.js index aeba58fb2..8f6f99546 100644 --- a/webapp/src/routes/Help/styles.js +++ b/webapp/src/routes/Help/styles.js @@ -18,7 +18,4 @@ export default (theme) => ({ marginTop: 0, }, }, - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, }) diff --git a/webapp/src/routes/Home/BlockProducerInfo.js b/webapp/src/routes/Home/BlockProducerInfo.js index 85b17ec95..7510fdbcd 100644 --- a/webapp/src/routes/Home/BlockProducerInfo.js +++ b/webapp/src/routes/Home/BlockProducerInfo.js @@ -9,7 +9,6 @@ import { useSharedState } from '../../context/state.context' import { eosConfig } from '../../config' const Card = lazy(() => import('@mui/material/Card')) -const CardContent = lazy(() => import('@mui/material/CardContent')) const Typography = lazy(() => import('@mui/material/Typography')) const LinearProgress = lazy(() => import('@mui/material/LinearProgress')) const ProducersChart = lazy(() => import('../../components/ProducersChart')) @@ -110,18 +109,14 @@ const BlockProducerInfo = ({ t, classes }) => { />
-
- - - - - {t('bpSchedule')} - - - - - -
+ + + + {t('bpSchedule')} + + + +
diff --git a/webapp/src/routes/Home/TransactionInfo.js b/webapp/src/routes/Home/TransactionInfo.js index 3add1da0a..d52a38c3a 100644 --- a/webapp/src/routes/Home/TransactionInfo.js +++ b/webapp/src/routes/Home/TransactionInfo.js @@ -1,7 +1,6 @@ /* eslint camelcase: 0 */ import React, { useEffect, useState } from 'react' import { useLazyQuery } from '@apollo/client' -import { useTheme } from '@mui/material/styles' import PropTypes from 'prop-types' import moment from 'moment' @@ -14,16 +13,13 @@ import TransactionsChartContainer from '../../components/TransactionsChartContai const options = ['Live (30s)', ...rangeOptions] const TransactionInfo = ({ t, startTrackingInfo, stopTrackingInfo }) => { - const theme = useTheme() const [{ tps, tpb }] = useSharedState() const [graphicData, setGraphicData] = useState([ { name: t('transactionsPerSecond'), - color: theme.palette.secondary.main, }, { name: t('transactionsPerBlock'), - color: theme.palette.tertiary.main, }, ]) const [option, setOption] = useState(options[0]) @@ -62,12 +58,10 @@ const TransactionInfo = ({ t, startTrackingInfo, stopTrackingInfo }) => { setGraphicData([ { name: t('transactionsPerSecond'), - color: theme.palette.secondary.main, data: trxPerSecond, }, { name: t('transactionsPerBlock'), - color: theme.palette.tertiary.main, data: trxPerBlock, }, ]) @@ -90,7 +84,7 @@ const TransactionInfo = ({ t, startTrackingInfo, stopTrackingInfo }) => { }, }) // eslint-disable-next-line - }, [option, theme.palette, getTransactionHistory]) + }, [option, getTransactionHistory]) useEffect(() => { if (option === option[0]) return @@ -114,12 +108,11 @@ const TransactionInfo = ({ t, startTrackingInfo, stopTrackingInfo }) => { setGraphicData([ { name: t('transactions'), - color: theme.palette.secondary.main, data }, ]) // eslint-disable-next-line - }, [transactionsData, theme.palette, t]) + }, [transactionsData, t]) return ( ({ graphicBox: { - '& .MuiCard-root': { - height: '100%', - }, display: 'flex', marginBottom: '10px', gap: '10px', @@ -10,9 +7,6 @@ export default (theme) => ({ display: 'block', }, }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, divMargin: { display: 'flex', marginBottom: '10px', diff --git a/webapp/src/routes/Lacchain/LacchainManagmentStyle.js b/webapp/src/routes/Lacchain/LacchainManagmentStyle.js index a46d22051..92a9c0e59 100644 --- a/webapp/src/routes/Lacchain/LacchainManagmentStyle.js +++ b/webapp/src/routes/Lacchain/LacchainManagmentStyle.js @@ -22,7 +22,7 @@ const Styles = makeStyles((theme) => ({ fontSize: 20, }, tooltip: { - backgroundColor: 'rgba(97, 97, 97, 0.92)', + backgroundColor: theme.palette.neutral.main, borderRadius: theme.shape.borderRadius, padding: theme.spacing(1), }, diff --git a/webapp/src/routes/Lacchain/LacchainNetwork.js b/webapp/src/routes/Lacchain/LacchainNetwork.js index f83b51ca2..874f53b28 100644 --- a/webapp/src/routes/Lacchain/LacchainNetwork.js +++ b/webapp/src/routes/Lacchain/LacchainNetwork.js @@ -1,4 +1,5 @@ import React, { useCallback, useEffect } from 'react' +import { useTheme } from '@mui/material/styles' import zc from '@dvsl/zoomcharts' import { makeStyles } from '@mui/styles' import Card from '@mui/material/Card' @@ -17,26 +18,23 @@ const useStyles = makeStyles(() => ({ const LacchainNodesNetwork = () => { const classes = useStyles() + const theme = useTheme() const initData = useCallback(async () => { const nodeTypes = { 1: { type: 'validator', - color: '#34eba2', image: '/node-types/validator.svg' }, 2: { type: 'writer', - color: '#c23044', image: '/node-types/writer.svg' }, 3: { type: 'boot', - color: '#1836de', image: '/node-types/boot.svg' }, 4: { type: 'observer', - color: '#e8df8b', image: '/node-types/observer.svg' } } @@ -102,16 +100,16 @@ const LacchainNodesNetwork = () => { fillColor: 'transparent' }, nodeHovered: { - fillColor: '#e0e0e0', + fillColor: theme.palette.neutral.light, radius: 60 }, nodeLabel: { padding: 4, backgroundStyle: { - fillColor: '#e0e0e0' + fillColor: theme.palette.neutral.light }, textStyle: { - fillColor: 'black', + fillColor: theme.palette.text.primary, font: '18px Nunito,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol' } }, @@ -120,7 +118,7 @@ const LacchainNodesNetwork = () => { radius: 2 }, linkHovered: { - fillColor: 'red', + fillColor: theme.palette.error.main, radius: 4 }, nodeStyleFunction: (node) => { @@ -135,7 +133,7 @@ const LacchainNodesNetwork = () => { } }) chart.clearHistory() - }, []) + }, [theme.palette]) useEffect(() => { initData() diff --git a/webapp/src/routes/Lacchain/LacchainNodeConfig.js b/webapp/src/routes/Lacchain/LacchainNodeConfig.js index 62d8acd08..665f5d847 100644 --- a/webapp/src/routes/Lacchain/LacchainNodeConfig.js +++ b/webapp/src/routes/Lacchain/LacchainNodeConfig.js @@ -3,7 +3,6 @@ import { makeStyles } from '@mui/styles' import Autocomplete from '@mui/material/Autocomplete' import TextField from '@mui/material/TextField' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import Button from '@mui/material/Button' import { eosConfig } from '../../config' @@ -24,47 +23,43 @@ const LacchainNodeConfig = () => { ] = useLacchainNodeConfigState() return ( -
- - - node.name)} - value={nodeType || ''} - onChange={handleOnChangeNodeType} - renderInput={(params) => ( - - )} - /> + + node.name)} + value={nodeType || ''} + onChange={handleOnChangeNodeType} + renderInput={(params) => ( + + )} + /> - {ual.activeUser && ( - node.name)} - value={node || ''} - onChange={handleOnChangeNode} - renderInput={(params) => ( - - )} - /> + {ual.activeUser && ( + node.name)} + value={node || ''} + onChange={handleOnChangeNode} + renderInput={(params) => ( + )} + /> + )} - - - -
+ + ) } diff --git a/webapp/src/routes/MissedBlocks/index.js b/webapp/src/routes/MissedBlocks/index.js index 15d0068cb..0f03ee30f 100644 --- a/webapp/src/routes/MissedBlocks/index.js +++ b/webapp/src/routes/MissedBlocks/index.js @@ -3,8 +3,6 @@ import React, { useEffect, useState } from 'react' import { useLazyQuery } from '@apollo/client' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' -import Typography from '@mui/material/Typography' import LinearProgress from '@mui/material/LinearProgress' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' @@ -12,24 +10,13 @@ import TableCell from '@mui/material/TableCell' import TableContainer from '@mui/material/TableContainer' import TableHead from '@mui/material/TableHead' import TableRow from '@mui/material/TableRow' -import InputLabel from '@mui/material/InputLabel' -import MenuItem from '@mui/material/MenuItem' -import FormControl from '@mui/material/FormControl' -import Select from '@mui/material/Select' -import Highcharts from 'highcharts' -import HighchartsReact from 'highcharts-react-official' -import { makeStyles } from '@mui/styles' import { formatWithThousandSeparator, rangeOptions } from '../../utils' import { MISSED_BLOCKS } from '../../gql' -import styles from './styles' - -const useStyles = makeStyles(styles) +import HighchartsWrapper from '../../components/HighChartsWrapper' +import ChartHeader from 'components/ChartHeader' const options = { - time: { - timezoneOffset: new Date().getTimezoneOffset(), - }, title: { text: ' ', }, @@ -61,7 +48,6 @@ const BlockDistribution = () => { const [series, setSeries] = useState([]) const [producers, setProducers] = useState([]) const [load, { loading, data }] = useLazyQuery(MISSED_BLOCKS) - const classes = useStyles() useEffect(() => { load({ @@ -112,72 +98,55 @@ const BlockDistribution = () => { }, [data]) return ( - - -
- - {t('title')} - - - - {t('timeFrame')} - - - -
- {loading && } - {!loading && data?.items.length > 0 && ( - <> - - - - - - {t('account')} - {t('scheduledBlocks')} - {t('producedBlocks')} - {t('missedBlocks')} - {t('availability')} + + + {loading && } + {!loading && data?.items.length > 0 && ( + <> + + +
+ + + {t('account')} + {t('scheduledBlocks')} + {t('producedBlocks')} + {t('missedBlocks')} + {t('availability')} + + + + {producers.map((item, index) => ( + + {item.name} + + {formatWithThousandSeparator(item.scheduled)} + + + {formatWithThousandSeparator(item.produced)} + + + {formatWithThousandSeparator(item.missed)} + + + {formatWithThousandSeparator(item.availability, 2)}% + - - - {producers.map((item, index) => ( - - {item.name} - - {formatWithThousandSeparator(item.scheduled)} - - - {formatWithThousandSeparator(item.produced)} - - - {formatWithThousandSeparator(item.missed)} - - - {formatWithThousandSeparator(item.availability, 2)}% - - - ))} - -
-
- - )} -
+ ))} + + + + + )}
) } diff --git a/webapp/src/routes/MissedBlocks/styles.js b/webapp/src/routes/MissedBlocks/styles.js deleted file mode 100644 index d553b8c81..000000000 --- a/webapp/src/routes/MissedBlocks/styles.js +++ /dev/null @@ -1,15 +0,0 @@ -export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', - }, - formControl: { - display: 'flex', - flexDirection: 'row-reverse', - }, - textDiv: { - display: "flex", - justifyContent: "space-between", - alignItems: "center", - p: '{1} ' - } -}) diff --git a/webapp/src/routes/Nodes/index.js b/webapp/src/routes/Nodes/index.js index f06ebc751..616bc37fc 100644 --- a/webapp/src/routes/Nodes/index.js +++ b/webapp/src/routes/Nodes/index.js @@ -26,7 +26,7 @@ const Nodes = () => { return ( <> -
+
({ display: 'flex', justifyContent: 'center', }, - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15)', - }, searchWrapper: { marginTop: theme.spacing(3), marginBottom: theme.spacing(1), diff --git a/webapp/src/routes/NodesDistribution/index.js b/webapp/src/routes/NodesDistribution/index.js index 18dc392dc..f0e343c9e 100644 --- a/webapp/src/routes/NodesDistribution/index.js +++ b/webapp/src/routes/NodesDistribution/index.js @@ -1,7 +1,8 @@ /* eslint camelcase: 0 */ import React, { lazy } from 'react' -import LinearProgress from '@mui/material/LinearProgress' import { makeStyles } from '@mui/styles' +import Card from '@mui/material/Card' +import LinearProgress from '@mui/material/LinearProgress' import useNodeDistributionState from '../../hooks/customHooks/useNodeDistributionState' @@ -18,14 +19,14 @@ const Nodes = () => { return ( <> -
- -
+ + + {loading && } {!loading && } diff --git a/webapp/src/routes/NodesDistribution/styles.js b/webapp/src/routes/NodesDistribution/styles.js index 3a13c7d8e..ab16525fd 100644 --- a/webapp/src/routes/NodesDistribution/styles.js +++ b/webapp/src/routes/NodesDistribution/styles.js @@ -1,12 +1,13 @@ export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15)', - }, searchWrapper: { marginTop: theme.spacing(3), marginBottom: theme.spacing(2), '& .MuiGrid-root': { paddingTop: '0px !important', }, + '& .MuiPaper-root': { + boxShadow: 'none !important', + padding: 0, + }, }, }) diff --git a/webapp/src/routes/NonCompliantBPs/index.js b/webapp/src/routes/NonCompliantBPs/index.js index f90b0820f..c012bd235 100644 --- a/webapp/src/routes/NonCompliantBPs/index.js +++ b/webapp/src/routes/NonCompliantBPs/index.js @@ -1,6 +1,7 @@ /* eslint camelcase: 0 */ import React, { memo } from 'react' import { makeStyles } from '@mui/styles' +import Card from '@mui/material/Card' import LinearProgress from '@mui/material/LinearProgress' import useNonCompliantState from '../../hooks/customHooks/useNonCompliantState' @@ -29,12 +30,12 @@ const NonCompliantBPs = () => {
{items.map((producer, index) => ( -
-
+ ))}
diff --git a/webapp/src/routes/NonCompliantBPs/styles.js b/webapp/src/routes/NonCompliantBPs/styles.js index 1bd987509..5f6343dc2 100644 --- a/webapp/src/routes/NonCompliantBPs/styles.js +++ b/webapp/src/routes/NonCompliantBPs/styles.js @@ -1,7 +1,4 @@ export default (theme) => ({ - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, statsText: { textAlign: 'center', }, @@ -51,9 +48,6 @@ export default (theme) => ({ display: 'flex', flexFlow: 'row nowrap', minHeight: '125px', - padding: theme.spacing(2), - background: theme.palette.common.white, - borderRadius: theme.spacing(1), '& .MuiTypography-h6': { display: 'flex', }, diff --git a/webapp/src/routes/ProducerProfile/ProfileCard.js b/webapp/src/routes/ProducerProfile/ProfileCard.js index b6dc18d00..7961a8383 100644 --- a/webapp/src/routes/ProducerProfile/ProfileCard.js +++ b/webapp/src/routes/ProducerProfile/ProfileCard.js @@ -28,9 +28,9 @@ const ProfileCard = ({ producer }) => { {data.map((url, index) => ( ))} diff --git a/webapp/src/routes/ProducerProfile/index.js b/webapp/src/routes/ProducerProfile/index.js index 4e0d0231c..5d9c1445b 100644 --- a/webapp/src/routes/ProducerProfile/index.js +++ b/webapp/src/routes/ProducerProfile/index.js @@ -3,6 +3,7 @@ import { useParams, Navigate, useLocation } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { makeStyles } from '@mui/styles' import CircularProgress from '@mui/material/CircularProgress' +import Card from '@mui/material/Card' import Typography from '@mui/material/Typography' import { eosConfig } from '../../config' @@ -46,10 +47,10 @@ const ProducerProfile = () => { const WrapperContainer = ({ title, children }) => { return ( -
+ {title}
{children}
-
+ ) } @@ -61,9 +62,9 @@ const ProducerProfile = () => { metaDescription={metaDescription} ldJson={ldJson} /> -
+ -
+ {producer?.hasEmptyBPJson && ( diff --git a/webapp/src/routes/ProducerProfile/styles.js b/webapp/src/routes/ProducerProfile/styles.js index 36ef3ff6c..c2fcf3b3f 100644 --- a/webapp/src/routes/ProducerProfile/styles.js +++ b/webapp/src/routes/ProducerProfile/styles.js @@ -21,6 +21,8 @@ export default (theme) => ({ backgroundImage: 'url(https://antelope.tools/images/profile-bg-image.webp)', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', + backgroundBlendMode: theme.palette.mode === 'light' ? 'normal' : 'soft-light', + backgroundColor: theme.palette.background.default, [theme.breakpoints.down('sm')]: { flexDirection: 'column' }, @@ -76,7 +78,7 @@ export default (theme) => ({ flexWrap: 'wrap', padding: theme.spacing(4), borderBottom: `2px solid ${theme.palette.primary.main}`, - boxShadow: '0px -2px 8px 0px #0000004D', + boxShadow: theme.palette.shadows.profileCard, backgroundColor: theme.palette.background.light, [theme.breakpoints.down('md')]: { gap: theme.spacing(4), diff --git a/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js b/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js index 94e396887..52d5bf148 100644 --- a/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js +++ b/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js @@ -4,7 +4,6 @@ import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' import Button from '@mui/material/Button' import Card from '@mui/material/Card' -import CardContent from '@mui/material/CardContent' import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import Typography from '@mui/material/Typography' import Skeleton from '@mui/material/Skeleton' @@ -16,12 +15,7 @@ import { eosConfig } from '../../config' import styles from './styles' import TokenToUSD from './TokenToUSD' -const lowestRewardsColor = '#B6EBF3' -const highestRewardsColor = '#265F63' - -const useStyles = makeStyles((theme) => - styles(theme, lowestRewardsColor, highestRewardsColor), -) +const useStyles = makeStyles(styles) const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { const classes = useStyles() @@ -30,8 +24,8 @@ const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { return (
- - + +
{t('dailyRewards')}
@@ -61,12 +55,12 @@ const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { )}
- +
- - + +
{t('topCountryDailyRewards')} @@ -102,12 +96,12 @@ const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { onClick={handlePopoverOpen(summary?.topCountryByRewards)} />
-
+
- - + +
{t('paidProducers')} {!!summary?.producersWithoutProperBpJson.quantity && ( @@ -156,12 +150,12 @@ const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { /> )} - +
- - + +
{ )}
- +
diff --git a/webapp/src/routes/RewardsDistribution/index.js b/webapp/src/routes/RewardsDistribution/index.js index 149fd6bf1..b1c766bd8 100644 --- a/webapp/src/routes/RewardsDistribution/index.js +++ b/webapp/src/routes/RewardsDistribution/index.js @@ -1,6 +1,7 @@ /* eslint camelcase: 0 */ import React, { useState, useCallback } from 'react' import { makeStyles } from '@mui/styles' +import { useTheme } from '@mui/material/styles' import { useTranslation } from 'react-i18next' import Typography from '@mui/material/Typography' import Link from '@mui/material/Link' @@ -24,19 +25,16 @@ import RewardsDistributionStats from './RewardsDistributionStats' import TokenToUSD from './TokenToUSD' import useRewardsDistributionState from 'hooks/customHooks/useRewardsDistributionState' -const lowestRewardsColor = '#B6EBF3' -const highestRewardsColor = '#265F63' const geoUrl = 'https://raw.githubusercontent.com/zcreativelabs/react-simple-maps/v2/topojson-maps/world-110m.json' -const useStyles = makeStyles((theme) => - styles(theme, lowestRewardsColor, highestRewardsColor), -) +const useStyles = makeStyles(styles) const RewardsDistribution = () => { const [anchorEl, setAnchorEl] = useState(null) const [currentNode, setCurrentNode] = useState(null) const classes = useStyles() + const theme = useTheme() const { t } = useTranslation('rewardsDistributionRoute') const open = Boolean(anchorEl) const [{ loading, nodes, setting, summary }] = useRewardsDistributionState() @@ -56,9 +54,9 @@ const RewardsDistribution = () => { const colorScale = useCallback( scaleLinear() .domain([0, summary?.topCountryByRewards?.rewards - 1]) - .range([lowestRewardsColor, highestRewardsColor]) + .range([theme.palette.primary.light, theme.palette.primary.dark]) .interpolate(interpolateHcl), - [summary], + [summary, theme.palette.primary], ) return ( @@ -67,7 +65,6 @@ const RewardsDistribution = () => { aria-haspopup="true" > { handlePopoverOpen={handlePopoverOpen} /> {!loading && ( - + { className={classes.geography} key={geo.rsmKey} geography={geo} - stroke="#8F9DA4" + stroke={theme.palette.neutral.main} + strokeWidth={0.8} fill={ nodeData && nodeData.rewards > 0 ? colorScale(parseInt(nodeData.rewards)) - : '#EEEEEE' + : theme.palette.neutral.light } /> ) diff --git a/webapp/src/routes/RewardsDistribution/styles.js b/webapp/src/routes/RewardsDistribution/styles.js index 83a600f6e..12653386a 100644 --- a/webapp/src/routes/RewardsDistribution/styles.js +++ b/webapp/src/routes/RewardsDistribution/styles.js @@ -1,4 +1,4 @@ -export default (theme, lowestRewardsColor, highestRewardsColor) => ({ +export default (theme) => ({ spaceBetween: { display: 'flex', alignItems: 'center', @@ -41,10 +41,10 @@ export default (theme, lowestRewardsColor, highestRewardsColor) => ({ display: 'inline-block', }, lowestRewards: { - backgroundColor: lowestRewardsColor, + backgroundColor: theme.palette.primary.light, }, highestRewards: { - backgroundColor: highestRewardsColor, + backgroundColor: theme.palette.primary.dark, }, rewardsColorSchema: { display: 'flex', @@ -73,9 +73,6 @@ export default (theme, lowestRewardsColor, highestRewardsColor) => ({ boxPadding: { padding: '10px', }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, divMargin: { display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', @@ -116,12 +113,6 @@ export default (theme, lowestRewardsColor, highestRewardsColor) => ({ paddingBottom: theme.spacing(2), }, }, - shadow: { - '& .MuiPaper-root': { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15)', - padding: theme.spacing(1), - }, - }, nonCompliantButton: { height: '30px', fontSize: '12px !important', diff --git a/webapp/src/routes/RicardianContract/index.js b/webapp/src/routes/RicardianContract/index.js index fb0ae7335..5863d4b3e 100644 --- a/webapp/src/routes/RicardianContract/index.js +++ b/webapp/src/routes/RicardianContract/index.js @@ -15,16 +15,14 @@ const RicardianContract = () => { const { t } = useTranslation('ricardianContractRoute') return ( - -
- -
+ + ) } diff --git a/webapp/src/routes/RicardianContract/styles.js b/webapp/src/routes/RicardianContract/styles.js index 0c2bf0019..ec8bccb8e 100644 --- a/webapp/src/routes/RicardianContract/styles.js +++ b/webapp/src/routes/RicardianContract/styles.js @@ -1,6 +1,5 @@ export default (theme) => ({ root: { - padding: theme.spacing(2), '& svg': { fontSize: '35px !important', }, @@ -8,6 +7,9 @@ export default (theme) => ({ fontSize: '15px !important', fontWeight: '600', }, + '& h6': { + color: theme.palette.neutral.dark + }, '& a': { lineBreak: 'anywhere', }, @@ -15,14 +17,10 @@ export default (theme) => ({ '& svg': { fontSize: '45px !important', }, - '& h4': { fontSize: '34px !important', fontWeight: 'normal', }, }, }, - cardShadow: { - boxShadow: '0px 1px 3px 1px rgba(0, 0, 0, 0.15) !important', - }, }) diff --git a/webapp/src/theme/components.js b/webapp/src/theme/components.js index 2c2556eae..3eb9aa24b 100644 --- a/webapp/src/theme/components.js +++ b/webapp/src/theme/components.js @@ -2,12 +2,9 @@ const components = { MuiCssBaseline: { styleOverrides: theme => ` - .simple-card { - background-color: ${theme.palette.background.main}; - box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.15); - border-radius: 4px; - padding: ${theme.spacing(4)}; - }, + body { + background-color: ${theme.palette.background.light}; + } .MuiTypography-capSubtitle { color: ${theme.palette.neutral.dark}; } @@ -20,6 +17,28 @@ const components = { }, }, }, + MuiPaper: { + styleOverrides: { + root: ({ theme }) => ({ + boxShadow: theme.palette.shadows.card, + backgroundImage: 'none', + }), + }, + }, + MuiCard: { + styleOverrides: { + root: { + padding: 16 + }, + }, + }, + MuiAppBar: { + styleOverrides: { + root: ({ theme }) => ({ + backgroundColor: theme.palette.background.paper, + }), + }, + }, MuiButton: { styleOverrides: { root: { diff --git a/webapp/src/theme/index.js b/webapp/src/theme/index.js index 2f0b2d2ed..2e94781ab 100644 --- a/webapp/src/theme/index.js +++ b/webapp/src/theme/index.js @@ -20,9 +20,6 @@ const theme = (variant) => { }, { name: variant.name, - body: variant.body, - header: variant.header, - sidebar: variant.sidebar } ) } diff --git a/webapp/src/theme/variants.js b/webapp/src/theme/variants.js index 2ad4e38a7..dd50c3dcb 100644 --- a/webapp/src/theme/variants.js +++ b/webapp/src/theme/variants.js @@ -3,135 +3,229 @@ import { blue, green, grey } from '@mui/material/colors' const lightVariant = { name: 'Light', palette: { + mode: 'light', primary: { main: blue[800], contrastText: '#FFF', }, secondary: { - main: blue[600], - contrastText: '#FFF', - }, - tertiary: { - main: '#00C853', + main: green.A700, contrastText: '#FFF', }, text: { primary: '#000', }, background: { - main: '#FFF', - light: '#F6F9FD', + light: '#F7F9FC', + default: '#FFF', + paper: '#FFF', }, neutral: { lighter: '#F0F3FA', light: '#E0E0E0', + main: '#858585', dark: '#4E4E4E', - darker: '#3D3D3DDE' - } - }, - header: { - color: grey[500], - background: '#FFF', - search: { - color: grey[800], + darker: '#2E2E2E', }, - indicator: { - background: blue[600], + error: { + main: '#D32F2F', + light: '#EF5350', + dark: '#C62828', + contrastText: '#FFF', }, - }, - sidebar: { - color: grey[900], - background: '#FFF', - header: { - color: blue[800], - background: '#FFF', - brand: { - color: blue[800], - }, - }, - footer: { - color: '#424242', - background: '#FFF', - }, - category: { - fontWeight: 'normal', - }, - badge: { - color: '#FFF', + warning: { + main: '#ED6C02', + light: '#FF9800', + dark: '#E65100', + contrastText: '#FFF', + }, + info: { + main: '#0288D1', + light: '#03A9F4', + dark: '#01579B', + contrastText: '#FFF', + }, + success: { + main: '#2E7D32', + light: '#4CAF50', + dark: '#1B5E20', + contrastText: '#FFF', + }, + action: { + active: 'rgba(0, 0, 0, 0.54)', + hover: 'rgba(0, 0, 0, 0.04)', + hoverOpacity: '0.04', + selected: 'rgba(0, 0, 0, 0.08)', + selectedOpacity: '0.08', + disabled: 'rgba(0, 0, 0, 0.26)', + disabledBackground: 'rgba(0, 0, 0, 0.12)', + disabledOpacity: '0.38', + focus: 'rgba(0, 0, 0, 0.12)', + focusOpacity: '0.12', + activatedOpacity: '0.12', + }, + shadows: { + card: '0px 1px 3px 1px rgba(0, 0, 0, 0.15)', + nodeCard: '2px 3px 4px 0px #0000002E', + profileCard: '0px -2px 8px 0px #0000004D', + hover: `0px 0px 40px -30px ${blue[800]}bf inset`, + authBox: `0px 0px 3px 3px ${blue[800]}`, + }, + sidebar: { + activeLink: '#E6ECF0', + }, + charts: { + colors: [ + '#1565c0', + '#00c853', + '#24CBE5', + '#664021', + '#434348', + '#6AF9C4', + '#DA1F07', + '#058DC7', + '#996404', + '#2C445B', + '#1F6E6D', + '#1214C2', + '#73283A', + '#487874', + '#C310C3', + '#FF9655', + '#1663B7', + '#C50943', + '#50B432', + '#484B87', + '#59511C', + '#DE1214', + '#DDDF00', + '#ED561B', + '#A45E12', + '#1909DA', + '#AC33E8', + '#AC3E3E', + '#952CC9', + '#0B09B8', + ], }, - }, - body: { - background: '#F7F9FC', }, } const darkVariant = { name: 'Dark', palette: { + mode: 'dark', primary: { - main: blue[700], - contrastText: '#FFF', + main: '#1CCBFF', + light: '#0D4380', + contrastText: '#000', }, secondary: { - main: blue[600], - contrastText: '#FFF', - }, - tertiary: { main: '#00C853', - contrastText: '#FFF', + light: '#F3E5F5', + dark: '#AB47BC', + contrastText: 'rgba(0, 0, 0, 0.87)', }, text: { primary: '#FFF', + secondary: 'rgba(255, 255, 255, 0.7)', + disabled: 'rgba(255, 255, 255, 0.5)', + icon: 'rgba(255, 255, 255, 0.12)', }, background: { - main: '#1B2430', - light: '#F6F9FD', + light: '#041426', + default: '#051B34', + paper: '#051B34', }, neutral: { - lighter: '#f0f3fa', - light: '#E0E0E0', - dark: '#4E4E4E', - darker: '#3D3D3DDE' - } - }, - header: { - color: grey[500], - background: '#FFFFFF', - search: { - color: grey[800], - }, - indicator: { - background: blue[600], + lighter: '#0E4480', + light: '#FFFFFF33', + main: grey[300], + dark: grey[200], + darker: grey[100], + }, + error: { + main: '#F44336', + light: '#E57373', + dark: '#D32F2F', + contrastText: '#FFF', }, - }, - sidebar: { - color: grey[200], - background: '#1B2430', - header: { - color: grey[200], - background: '#232f3e', - brand: { - color: blue[500], - }, - }, - footer: { - color: grey[200], - background: '#232f3e', - online: { - background: green[500], - }, - }, - category: { - fontWeight: 400, - }, - badge: { - color: '#FFF', - background: blue[500], + warning: { + main: '#FFA726', + light: '#FFB74D', + dark: '#F57C00', + contrastText: 'rgba(0, 0, 0, 0.87)', + }, + info: { + main: '#29B6F6', + light: '#4FC3F7', + dark: '#0288D1', + contrastText: 'rgba(0, 0, 0, 0.87)', + }, + success: { + main: '#66BB6A', + light: '#81C784', + dark: '#388E3C', + contrastText: 'rgba(0, 0, 0, 0.87)', + }, + action: { + active: '#FFF', + hover: 'rgba(255, 255, 255, 0.08)', + hoverOpacity: '0.08', + selected: 'rgba(255, 255, 255, 0.16)', + selectedOpacity: '0.16', + disabled: 'rgba(255, 255, 255, 0.3)', + disabledBackground: 'rgba(255, 255, 255, 0.12)', + disabledOpacity: '0.38', + focus: 'rgba(255, 255, 255, 0.12)', + focusOpacity: '0.12', + activatedOpacity: '0.24', + }, + shadows: { + card: '0px 0px 14px 0px #3540520D', + nodeCard: '2px 3px 4px 0px #FFFFFF0A', + profileCard: '0px 0px 8px 0px #FFFFFF4D', + hover: `0px 0px 40px -30px #1CCBFFBF inset`, + authBox: `0px 0px 3px 1px #1CCBFF`, + }, + sidebar: { + activeLink: '#166CCD', + }, + charts: { + colors: [ + '#1CCBFF', + '#00C853', + '#7cb5ec', + '#BD7B44', + '#898993', + '#90ed7d', + '#FD6762', + '#058DC7', + '#f7a35c', + '#989CFC', + '#34A8A6', + '#42CECD', + '#FD7C97', + '#11FF86', + '#F016F0', + '#f45b5b', + '#228AFB', + '#FF2E19', + '#50B432', + '#7C81E1', + '#A7993C', + '#DE1214', + '#e4d354', + '#64E572', + '#ED561B', + '#28BBFF', + '#AC33E8', + '#06FFFD', + '#1093CC', + '#91e8e1', + ], }, }, - body: { - background: '#F7F9FC', - }, } const variants = [lightVariant, darkVariant]