Skip to content

Commit a9b2318

Browse files
committed
feat: rework color palette and tokens, merge into one source of truth
1 parent de19696 commit a9b2318

71 files changed

Lines changed: 710 additions & 1285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/apps/human-app/frontend/src/modules/governance-banner/components/governance-banner.tsx‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import AccessTimeIcon from '@mui/icons-material/AccessTime';
2-
import { Box, Grid, Link as MuiLink, Typography } from '@mui/material';
31
import { useEffect, useState } from 'react';
42
import { useTranslation } from 'react-i18next';
3+
import AccessTimeIcon from '@mui/icons-material/AccessTime';
4+
import { Box, Grid, Link as MuiLink, Typography } from '@mui/material';
5+
56
import { env } from '@/shared/env';
6-
import { useColorMode } from '@/shared/contexts/color-mode';
77
import { useProposalQuery } from '../hooks/use-proposal-query';
88
import { formatCountdown } from '../../../shared/utils/time';
99
import { type ProposalResponse } from '../services/governance.service';
@@ -20,8 +20,6 @@ function getProposalStatus(proposal: ProposalResponse): ProposalStatus {
2020
export function GovernanceBanner() {
2121
const { t } = useTranslation();
2222
const { data: proposal, isLoading, isError } = useProposalQuery();
23-
const { colorPalette } = useColorMode();
24-
const { text, background } = colorPalette.banner;
2523
const [timeRemaining, setTimeRemaining] = useState('00:00:00');
2624

2725
useEffect(() => {
@@ -55,8 +53,8 @@ export function GovernanceBanner() {
5553
sx={{
5654
alignItems: { xs: 'flex-start', sm: 'center' },
5755
justifyContent: { xs: 'flex-start', sm: 'space-between' },
58-
bgcolor: background.primary,
59-
color: text.secondary,
56+
bgcolor: 'primary.main',
57+
color: 'common.white',
6058
borderRadius: '8px',
6159
p: 2,
6260
gap: 2,
@@ -75,13 +73,13 @@ export function GovernanceBanner() {
7573
>
7674
<Box sx={{ display: 'flex', alignItems: 'center' }}>
7775
<AccessTimeIcon sx={{ mr: 1 }} />
78-
<Typography variant="body2" sx={{ color: text.secondary }}>
76+
<Typography variant="body2" sx={{ color: 'common.white' }}>
7977
{status === 'pending'
8078
? t('governance.timeToStart', 'Voting starts in')
8179
: t('governance.timeToReveal', 'Time to reveal vote')}
8280
:
8381
</Typography>
84-
<Typography variant="body1" sx={{ ml: 1, color: text.primary }}>
82+
<Typography variant="body1" sx={{ ml: 1, color: 'text.primary' }}>
8583
{timeRemaining}
8684
</Typography>
8785
</Box>
@@ -90,8 +88,8 @@ export function GovernanceBanner() {
9088
variant="body1"
9189
sx={{
9290
ml: { xs: 0, md: 8 },
93-
color: text.primary,
94-
bgcolor: background.secondary,
91+
color: 'text.primary',
92+
bgcolor: 'background.paper',
9593
borderRadius: '8px',
9694
p: '4px 8px',
9795
}}
@@ -114,7 +112,7 @@ export function GovernanceBanner() {
114112
target="_blank"
115113
rel="noopener noreferrer"
116114
sx={{
117-
color: text.secondary,
115+
color: 'common.white',
118116
fontWeight: 500,
119117
textDecoration: 'none',
120118
'&:hover': {
Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,34 @@
1-
import { Grid, Stack, Typography } from '@mui/material';
1+
import { Stack, Typography } from '@mui/material';
22
import { useTranslation } from 'react-i18next';
33

44
export function LogoSection() {
55
const { t } = useTranslation();
6-
const logoText: string = t('homepage.humanApp');
7-
const logoTextSplit: string[] = logoText.split(' ');
6+
7+
const logoText = t('homepage.humanApp');
8+
const logoTextSplit = logoText.split(' ');
89

910
return (
10-
<Grid
11-
container
11+
<Stack
1212
sx={{
13-
flexDirection: 'column',
1413
justifyContent: 'center',
1514
alignItems: { xs: 'center', lg: 'flex-start' },
15+
gap: 4,
1616
}}
1717
>
1818
<Stack
1919
direction="row"
2020
sx={{
2121
justifyContent: { xs: 'center', md: 'flex-start' },
22-
mt: 0,
2322
}}
2423
>
2524
<Typography variant="h1">{logoTextSplit[0]}</Typography>
2625
<Typography variant="h1" sx={{ fontWeight: '400', ml: 2.5 }}>
2726
{logoTextSplit[1]}
2827
</Typography>
2928
</Stack>
30-
<Typography
31-
variant="h6"
32-
sx={{
33-
mt: 4,
34-
mb: 8,
35-
typography: { md: 'h5' },
36-
textAlign: { xs: 'center', md: 'left' },
37-
}}
38-
>
29+
<Typography variant="h5" sx={{ textAlign: { xs: 'center', md: 'left' } }}>
3930
{t('homepage.completeJobs')}
4031
</Typography>
41-
</Grid>
32+
</Stack>
4233
);
4334
}

‎packages/apps/human-app/frontend/src/modules/homepage/components/sign-in-section.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { Paper, Button } from '@mui/material';
21
import { Link } from 'react-router-dom';
32
import { useTranslation } from 'react-i18next';
4-
import { useColorMode } from '@/shared/contexts/color-mode';
3+
import { Paper, Button } from '@mui/material';
4+
55
import { routerPaths } from '@/router/router-paths';
66

77
export function SignInSection() {
8-
const { colorPalette } = useColorMode();
98
const { t } = useTranslation();
109

1110
return (
1211
<Paper
12+
elevation={0}
1313
sx={{
1414
display: 'flex',
1515
flexDirection: 'column',
1616
px: { xs: 2, lg: 8 },
1717
py: { xs: 4, lg: 10 },
18-
backgroundColor: colorPalette.paper.light,
18+
bgcolor: 'background.light',
1919
boxShadow: 'none',
2020
borderRadius: '20px',
2121
gap: 2,

‎packages/apps/human-app/frontend/src/modules/homepage/views/home.page.tsx‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Box, Container, Grid, Paper } from '@mui/material';
22
import { Navigate } from 'react-router-dom';
33

4-
import { routerPaths } from '@/router/router-paths';
5-
import { useColorMode } from '@/shared/contexts/color-mode';
64
import { LogoSection } from '../components/logo-section';
75
import { SignInSection } from '../components/sign-in-section';
6+
import { routerPaths } from '@/router/router-paths';
7+
import { useColorMode } from '@/shared/contexts/color-mode';
88
import { useIsUserVerified } from '@/shared/hooks';
99

1010
export function HomePage() {
11-
const { colorPalette } = useColorMode();
11+
const { isDarkMode } = useColorMode();
1212
const isUserVerified = useIsUserVerified();
1313

1414
if (isUserVerified) {
@@ -22,7 +22,7 @@ export function HomePage() {
2222
sx={{
2323
position: 'relative',
2424
mx: { xs: 0, md: 4 },
25-
bgcolor: colorPalette.backgroundColor,
25+
bgcolor: isDarkMode ? 'background.default' : 'common.white',
2626
}}
2727
>
2828
<Container>
@@ -31,7 +31,10 @@ export function HomePage() {
3131
spacing={{ xs: 0, lg: 10 }}
3232
sx={{ width: '100%', alignItems: 'center', pb: { xs: 5, lg: 0 } }}
3333
>
34-
<Grid size={{ xs: 12, lg: 6 }} sx={{ justifyContent: 'center' }}>
34+
<Grid
35+
size={{ xs: 12, lg: 6 }}
36+
sx={{ justifyContent: 'center', mb: { xs: 4, sm: 8, lg: 0 } }}
37+
>
3538
<LogoSection />
3639
</Grid>
3740
<Grid size={{ xs: 12, lg: 6 }} sx={{ justifyContent: 'flex-end' }}>

‎packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Link } from 'react-router-dom';
88
import { Input } from '@/shared/components/data-entry/input';
99
import { Button } from '@/shared/components/ui/button';
1010
import { Password } from '@/shared/components/data-entry/password';
11-
import { useColorMode } from '@/shared/contexts/color-mode/use-color-mode';
1211
import { useResetMutationErrors } from '@/shared/hooks/use-reset-mutation-errors';
1312
import { HCaptchaForm } from '@/shared/components/hcaptcha';
1413
import { routerPaths } from '@/router/router-paths';
@@ -29,7 +28,6 @@ export function SignInForm({
2928
resetMutation,
3029
}: SignInFormProps) {
3130
const { t } = useTranslation();
32-
const { colorPalette } = useColorMode();
3331

3432
const methods = useForm({
3533
defaultValues: {
@@ -64,11 +62,9 @@ export function SignInForm({
6462
<MuiLink
6563
component={Link}
6664
to={routerPaths.sendResetLink}
67-
variant="body1"
65+
variant="body2"
6866
sx={{
69-
color: colorPalette.text.primary,
70-
fontSize: '14px',
71-
lineHeight: '150%',
67+
color: 'text.primary',
7268
fontWeight: 600,
7369
textDecoration: 'underline',
7470
}}
@@ -94,12 +90,12 @@ export function SignInForm({
9490
fontWeight: 700,
9591
lineHeight: '125%',
9692
letterSpacing: '0.25px',
97-
color: colorPalette.text.primary,
93+
color: 'text.primary',
9894
position: 'absolute',
9995
top: '50%',
10096
left: '50%',
10197
transform: 'translate(-50%, -50%)',
102-
bgcolor: colorPalette.background.paper,
98+
bgcolor: 'background.paper',
10399
}}
104100
>
105101
{t('worker.signInForm.or')}
@@ -117,25 +113,21 @@ export function SignInForm({
117113
}}
118114
>
119115
<Typography
116+
variant="body2"
120117
sx={{
121-
fontSize: '14px',
122118
fontWeight: 500,
123-
lineHeight: '26px',
124-
letterSpacing: '0.1px',
125-
color: colorPalette.text.auxiliary200,
119+
color: 'text.auxiliary200',
126120
}}
127121
>
128122
{t('worker.signInForm.dontHaveAccount')}
129123
</Typography>{' '}
130124
<MuiLink
131125
component={Link}
132126
to={routerPaths.signUp}
127+
variant="body2"
133128
sx={{
134-
color: colorPalette.accent.main,
135-
fontSize: '14px',
129+
color: 'accent.main',
136130
fontWeight: 600,
137-
lineHeight: '26px',
138-
letterSpacing: '0.1px',
139131
textDecoration: 'underline',
140132
}}
141133
>

‎packages/apps/human-app/frontend/src/modules/signin/worker/sign-in.page.tsx‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
useNotification,
1414
} from '@/shared/hooks/use-notification';
1515
import { BackButton } from '@/shared/components/ui/page-card/back-button';
16-
import { useColorMode } from '@/shared/contexts/color-mode';
1716
import { useAuth } from '@/modules/auth/hooks/use-auth';
1817
import { routerPaths } from '@/router/router-paths';
1918
import { useIsUserVerified } from '@/shared/hooks';
@@ -31,7 +30,6 @@ export function SignInPage() {
3130
const { showNotification } = useNotification();
3231
const navigate = useNavigate();
3332
const { user, status, signOut } = useAuth();
34-
const { colorPalette } = useColorMode();
3533
const isUserVerified = useIsUserVerified();
3634

3735
const { signIn, error, isError, isLoading, reset } = useSignIn();
@@ -88,15 +86,14 @@ export function SignInPage() {
8886
alignItems: 'center',
8987
justifyContent: 'center',
9088
my: { xs: 0, md: 4 },
91-
bgcolor: colorPalette.background.paper,
9289
borderRadius: '30px',
9390
borderBottomLeftRadius: { xs: 0, md: '30px' },
9491
borderBottomRightRadius: { xs: 0, md: '30px' },
9592
border: { xs: 'none', md: '1px solid' },
96-
borderColor: {
93+
borderColor: (theme) => ({
9794
xs: 'none',
98-
md: colorPalette.border.main,
99-
},
95+
md: theme.palette.border.main,
96+
}),
10097
overflow: 'hidden',
10198
}}
10299
>
@@ -148,7 +145,7 @@ export function SignInPage() {
148145
<Typography
149146
component="h1"
150147
variant="h4"
151-
sx={{ color: colorPalette.text.auxiliary100 }}
148+
sx={{ color: 'text.auxiliary100' }}
152149
>
153150
{t('worker.signInForm.title')}
154151
</Typography>

‎packages/apps/human-app/frontend/src/modules/signin/worker/verification-flow.tsx‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { useCallback, useState } from 'react';
2-
import { Box, Stack, Typography } from '@mui/material';
2+
import { Box, Chip, Stack, Typography } from '@mui/material';
33
import { t } from 'i18next';
44

5-
import { Chip } from '@/shared/components/ui/chip';
6-
import { useColorMode } from '@/shared/contexts/color-mode/use-color-mode';
75
import {
86
IdentityVerificationControl,
97
WalletConnectionControl,
@@ -35,7 +33,6 @@ export function VerificationFlow({
3533
);
3634

3735
const { user } = useAuth();
38-
const { colorPalette } = useColorMode();
3936
const isMobile = useIsMobile();
4037

4138
const kycStatus = user?.kyc_status as KycStatus;
@@ -54,7 +51,7 @@ export function VerificationFlow({
5451
<Stack sx={{ mt: { xs: 3, md: 0 }, px: 2, width: 400 }}>
5552
<Typography
5653
variant="h4"
57-
sx={{ color: colorPalette.text.auxiliary100, mb: { xs: 2.5, md: 5 } }}
54+
sx={{ color: 'text.auxiliary100', mb: { xs: 2.5, md: 5 } }}
5855
>
5956
{t('worker.profile.beforeWeGetStarted')}
6057
</Typography>
@@ -67,18 +64,15 @@ export function VerificationFlow({
6764
width: 90,
6865
height: 10,
6966
borderRadius: '7px',
70-
bgcolor: colorPalette.primary.main,
67+
bgcolor: 'primary.main',
7168
}}
7269
/>
7370
<Box
7471
sx={{
7572
width: 90,
7673
height: 10,
7774
borderRadius: '7px',
78-
bgcolor:
79-
step === 'wallet'
80-
? colorPalette.primary.main
81-
: colorPalette.background.default,
75+
bgcolor: step === 'wallet' ? 'primary.main' : 'background.default',
8276
}}
8377
/>
8478
</Stack>
@@ -91,14 +85,21 @@ export function VerificationFlow({
9185
display: 'flex',
9286
alignItems: 'center',
9387
gap: 1,
94-
color: colorPalette.text.auxiliary100,
88+
color: 'text.auxiliary100',
9589
fontWeight: 600,
9690
mb: { xs: 3, md: 2 },
9791
}}
9892
>
9993
{t('worker.profile.identityVerification')}
10094
{isKycStarted && label && (
101-
<Chip label={label} backgroundColor={getChipColor(kycStatus)} />
95+
<Chip
96+
label={label}
97+
sx={{
98+
bgcolor: getChipColor(kycStatus),
99+
border: 'none',
100+
color: 'common.white',
101+
}}
102+
/>
102103
)}
103104
</Typography>
104105
<IdentityVerificationControl
@@ -113,7 +114,7 @@ export function VerificationFlow({
113114
component="h6"
114115
variant={isMobile ? 'body1' : 'h6'}
115116
sx={{
116-
color: colorPalette.text.auxiliary100,
117+
color: 'text.auxiliary100',
117118
fontWeight: 600,
118119
mb: { xs: 3, md: 5 },
119120
}}

0 commit comments

Comments
 (0)