Skip to content

Commit 1cc32b9

Browse files
authored
Merge pull request #2126 from oasisprotocol/mz/headerFix
Fix headers colors after changing Explorer background
2 parents ae147e1 + ab71bfb commit 1cc32b9

5 files changed

Lines changed: 5 additions & 14 deletions

File tree

.changelog/2126.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix headers colors after changing Explorer background

src/app/components/CardHeaderWithCounter/index.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,33 @@ import { FC } from 'react'
22
import Box from '@mui/material/Box'
33
import Typography from '@mui/material/Typography'
44
import { COLORS } from 'styles/theme/colors'
5-
import { useScreenSize } from '../../hooks/useScreensize'
5+
import { useTheme } from '@mui/material/styles'
66

77
type CardHeaderWithCounterProps = {
88
label: string | undefined
99
totalCount: number | undefined
1010
isTotalCountClipped: boolean | undefined
11-
changeMobileColors?: boolean
1211
}
1312

1413
export const CardHeaderWithCounter: FC<CardHeaderWithCounterProps> = ({
1514
label,
1615
totalCount,
1716
isTotalCountClipped,
18-
changeMobileColors,
1917
}) => {
20-
const { isMobile } = useScreenSize()
18+
const theme = useTheme()
2119

2220
return (
2321
<Box sx={{ display: 'flex', alignItems: 'baseline' }} gap={'0.8ex'}>
2422
<Typography
2523
fontWeight={700}
2624
component="span"
27-
color={isMobile && changeMobileColors ? COLORS.white : COLORS.brandExtraDark}
25+
color={theme.palette.layout.titleOnBackground}
2826
fontSize="inherit"
2927
>
3028
{label}
3129
</Typography>
3230
{!!totalCount && (
33-
<Typography
34-
fontWeight="normal"
35-
component="span"
36-
color={isMobile && changeMobileColors ? COLORS.white : COLORS.grayMedium}
37-
fontSize="inherit"
38-
>
31+
<Typography fontWeight="normal" component="span" color={COLORS.grayMedium} fontSize="inherit">
3932
({`${isTotalCountClipped ? '>' : ''}${totalCount}`})
4033
</Typography>
4134
)}

src/app/pages/ConsensusAccountsPage/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const ConsensusAccountsPage: FC = () => {
5151
<SubPageCard
5252
title={
5353
<CardHeaderWithCounter
54-
changeMobileColors
5554
label={t('account.listTitle')}
5655
totalCount={accountsData?.total_count}
5756
isTotalCountClipped={accountsData?.is_total_count_clipped}

src/app/pages/ProposalsPage/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const ProposalsPage: FC = () => {
5151
<SubPageCard
5252
title={
5353
<CardHeaderWithCounter
54-
changeMobileColors
5554
label={t('networkProposal.listTitle')}
5655
totalCount={proposalsData?.total_count}
5756
isTotalCountClipped={proposalsData?.is_total_count_clipped}

src/app/pages/ValidatorsPage/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export const ValidatorsPage: FC = () => {
5252
<SubPageCard
5353
title={
5454
<CardHeaderWithCounter
55-
changeMobileColors
5655
label={t('validator.listTitle')}
5756
totalCount={validatorsData?.total_count}
5857
isTotalCountClipped={validatorsData?.is_total_count_clipped}

0 commit comments

Comments
 (0)