Skip to content

Commit

Permalink
Unify fontSize values using pxToRem from the theme (#1744)
Browse files Browse the repository at this point in the history
* Upate font sizes - initail commit

* Update font sizes

* Add theme import in Grid component

* add theme imports

* Fix lint errors

* Fix lint errors

* Fix lint error

---------

Co-authored-by: ani-kalpachka <[email protected]>
  • Loading branch information
ani-kalpachka and ani-kalpachka authored Mar 20, 2024
1 parent 3afbf5a commit 2917df7
Show file tree
Hide file tree
Showing 30 changed files with 93 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/components/admin/affiliates/AffiliatesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import LoopIcon from '@mui/icons-material/Loop'
const addIconStyles = {
color: '#4ac3ff',
background: 'transperent',
fontSize: '40px',
fontSize: theme.typography.pxToRem(40),
cursor: 'pointer',
padding: 0.7,
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/countries/grid/CountryGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const classes = {
const Root = styled('div')({
[`& .${classes.gridColumn}`]: {
'& .MuiDataGrid-columnHeaderTitle': {
fontSize: '14px',
fontSize: theme.typography.pxToRem(14),
fontWeight: '700',
},
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/admin/expenses/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import DetailsModal from './DetailsModal'
import DeleteModal from './DeleteModal'
import { moneyPublic } from 'common/util/money'

import theme from 'common/theme'

const PREFIX = 'Grid'

const classes = {
Expand All @@ -33,11 +35,11 @@ const Root = styled('div')({
marginTop: '30px',
marginRight: '40px',
},
fontSize: '12px',
fontSize: theme.typography.pxToRem(12),
},
[`& .${classes.gridColumn}`]: {
'& .MuiDataGrid-columnHeaderTitle': {
fontSize: '14px',
fontSize: theme.typography.pxToRem(14),
fontWeight: '700',
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/auth/profile/AffiliateProgramTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ const Root = styled(Box)(({ theme }) => ({
[`& .${classes.h1}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '30px',
fontSize: theme.typography.pxToRem(30),
lineHeight: '65px',
paddingLeft: 2,
},
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
[`& .${classes.h2}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '23px',
fontSize: theme.typography.pxToRem(23),
lineHeight: '116.7%',
marginBottom: theme.spacing(3),
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/auth/profile/CertificatesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
[`& .${classes.thinFont}`]: {
fontStyle: 'normal',
fontWeight: 400,
fontSize: '24px',
fontSize: theme.typography.pxToRem(24),
lineHeight: '123.5%',
letterSpacing: '0.25px',
color: theme.palette.common.black,
Expand All @@ -35,7 +35,7 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.smallText}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '15px',
fontSize: theme.typography.pxToRem(15),
lineHeight: '160%',
letterSpacing: '0.15px',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/auth/profile/DonationTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.h1}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '30px',
fontSize: theme.typography.pxToRem(30),
lineHeight: '65px',
paddingLeft: 2,
},
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
[`& .${classes.h2}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '23px',
fontSize: theme.typography.pxToRem(23),
lineHeight: '116.7%',
marginBottom: theme.spacing(3),
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/auth/profile/MyCampaignsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
[`& .${classes.thinFont}`]: {
fontStyle: 'normal',
fontWeight: 400,
fontSize: '24px',
fontSize: theme.typography.pxToRem(24),
lineHeight: '123.5%',
letterSpacing: '0.25px',
color: theme.palette.common.black,
Expand All @@ -37,7 +37,7 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.smallText}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '15px',
fontSize: theme.typography.pxToRem(15),
lineHeight: '160%',
letterSpacing: '0.15px',
},
Expand Down
7 changes: 3 additions & 4 deletions src/components/client/auth/profile/MyNotificationsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
[`& .${classes.thinFont}`]: {
fontStyle: 'normal',
fontWeight: 400,
fontSize: '24px',
fontSize: theme.typography.pxToRem(24),
lineHeight: '123.5%',
letterSpacing: '0.25px',
// color: theme.palette.common.black,
margin: 0,
},
[`& .${classes.smallText}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '15px',
fontSize: theme.typography.pxToRem(15),
lineHeight: '160%',
letterSpacing: '0.15px',
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/client/auth/profile/PersonalInfoTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.heading}`]: {
fontStyle: 'normal',
fontWeight: 400,
fontSize: '24px',
fontSize: theme.typography.pxToRem(24),
lineHeight: '123.5%',
letterSpacing: '0.25px',
color: theme.palette.common.black,
Expand All @@ -57,22 +57,22 @@ const Root = styled('div')(({ theme }) => ({
[`& .${classes.graySpan}`]: {
fontStyle: 'normal',
fontWeight: '400',
fontSize: '18px',
fontSize: theme.typography.pxToRem(18),
lineHeight: '133.4%',
color: '#909090',
},

[`& .${classes.h5}`]: {
fontStyle: 'normal',
fontWeight: '600',
fontSize: '22px',
fontSize: theme.typography.pxToRem(22),
lineHeight: '133.4%',
},

[`& .${classes.h3}`]: {
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '116.7%',
margin: '0',
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/auth/profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const StyledLayout = styled(Layout)({
[`& .${classes.h1}`]: {
fontStyle: 'normal',
fontWeight: 500,
fontSize: '45px',
fontSize: theme.typography.pxToRem(45),
lineHeight: '112px',
letterSpacing: '-1.5px',
color: theme.palette.common.black,
Expand Down
4 changes: 3 additions & 1 deletion src/components/client/auth/register/RegisterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
} from 'gql/user-registration'
import RegisterSuccess from './RegisterSuccess'

import theme from 'common/theme'

const providerIcons = {
google: <Google style={{ width: 43.55, height: 43.55 }} />,
}
Expand Down Expand Up @@ -146,7 +148,7 @@ export default function RegisterPage({ providers }: RegisterPageProps) {
<Divider
sx={{
py: 3,
fontSize: 16,
fontSize: theme.typography.pxToRem(16),
textTransform: 'uppercase',
color: '#444444',
':before': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { useCampaignExpensesList } from 'common/hooks/expenses'
import { moneyPublic } from 'common/util/money'
import { ModalStoreImpl } from 'stores/dashboard/ModalStore'

import theme from 'common/theme'

const PREFIX = 'Grid'

type Props = { slug: string }
Expand All @@ -37,11 +39,11 @@ const Root = styled('div')({
marginTop: '30px',
marginRight: '40px',
},
fontSize: '12px',
fontSize: theme.typography.pxToRem(12),
},
[`& .${classes.gridColumn}`]: {
'& .MuiDataGrid-columnHeaderTitle': {
fontSize: '14px',
fontSize: theme.typography.pxToRem(14),
fontWeight: '700',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { routes } from 'common/routes'
import AddIcon from '@mui/icons-material/Add'
import Link from 'next/link'

import theme from 'common/theme'

const PREFIX = 'NewsAdminPage'

const classes = {
Expand All @@ -25,7 +27,7 @@ const classes = {
const Root = styled(Layout)({
[`& .${classes.gridColumn}`]: {
'& .MuiDataGrid-columnHeaderTitle': {
fontSize: '15px',
fontSize: theme.typography.pxToRem(15),
fontWeight: '700',
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/campaigns/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
},

['& .ql-editor']: {
fontSize: theme.spacing(2),
fontSize: theme.typography.pxToRem(16),
fontWeight: 500,
lineHeight: theme.spacing(4),
paddingLeft: '0',
Expand Down Expand Up @@ -109,10 +109,10 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
},
},
[`& .${classes.financeSummary}`]: {
fontSize: `1.2rem`,
fontSize: theme.typography.pxToRem(19),
[theme.breakpoints.up('sm')]: {
marginLeft: theme.spacing(2),
fontSize: `1.3rem`,
fontSize: theme.typography.pxToRem(21),
},
},
}))
Expand Down
8 changes: 4 additions & 4 deletions src/components/client/campaigns/CampaignsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Root = styled(Layout)(({ theme }) => ({
fontWeight: '500',
color: '#2196F3',
fontStyle: 'normal',
fontSize: '45px',
fontSize: theme.typography.pxToRem(45),
lineHeight: '45px',
alignItems: 'center',
textAlign: 'center',
Expand All @@ -42,7 +42,7 @@ const Root = styled(Layout)(({ theme }) => ({
marginTop: theme.spacing(3),
fontStyle: 'normal',
fontWeight: '400',
fontSize: '16px',
fontSize: theme.typography.pxToRem(16),
lineHeight: '175 %',
textAlign: 'center',
letterSpacing: '0.15px',
Expand All @@ -52,7 +52,7 @@ const Root = styled(Layout)(({ theme }) => ({
marginBottom: theme.spacing(3),
fontStyle: 'normal',
fontWeight: '500',
fontSize: '25px',
fontSize: theme.typography.pxToRem(25),
lineHeight: '120%',
textAlign: 'center',
color: '#2196F3',
Expand All @@ -66,7 +66,7 @@ const Root = styled(Layout)(({ theme }) => ({
},

[`& .${classes.arrowIcon}`]: {
fontSize: theme.spacing(8),
fontSize: theme.typography.pxToRem(48),
},
}))

Expand Down
2 changes: 1 addition & 1 deletion src/components/client/campaigns/DonationWishes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function DonationWishes({ campaignId, pageSize = 5 }: Props) {
component="h4"
sx={{
color: theme.palette.common.black,
fontSize: '2rem',
fontSize: theme.typography.pxToRem(32),
paddingBottom: '1rem',
}}>
{t('campaign.messages')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/campaigns/InlineDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
display: 'flex',
justifyContent: 'center',
width: '50%',
fontSize: '13px',
fontSize: theme.typography.pxToRem(13),
backgroundColor: 'transparant',
paddingBottom: theme.spacing(0.2),
borderRadius: '60px',
Expand Down
4 changes: 3 additions & 1 deletion src/components/client/irregularity/helpers/Remark.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Grid, Typography } from '@mui/material'

import theme from 'common/theme'

type RemarkProps = {
text: string
}

const textStyles = {
fontSize: '13px',
fontSize: theme.typography.pxToRem(13),
marginTop: '100px',
}

Expand Down
Loading

0 comments on commit 2917df7

Please sign in to comment.