Skip to content

Commit 792e4e7

Browse files
authored
[Human App Frontend] refactor: update theme (#4003)
1 parent de19696 commit 792e4e7

90 files changed

Lines changed: 904 additions & 1823 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.
Binary file not shown.
Binary file not shown.

‎packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { z } from 'zod';
2+
23
import { createAuthProvider } from '@/shared/contexts/generic-auth-context';
3-
import { KycStatus } from '@/modules/worker/profile/types';
4+
import { KycStatus } from '@/shared/types/entity.type';
45

56
const userDataSchema = z.object({
67
site_key: z.string().optional().nullable(),

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

Lines changed: 11 additions & 13 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
}}
@@ -113,9 +111,9 @@ export function GovernanceBanner() {
113111
href={env.VITE_GOVERNANCE_URL}
114112
target="_blank"
115113
rel="noopener noreferrer"
114+
variant="body1"
116115
sx={{
117-
color: text.secondary,
118-
fontWeight: 500,
116+
color: 'common.white',
119117
textDecoration: 'none',
120118
'&:hover': {
121119
textDecoration: 'underline',
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
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
>
25-
<Typography variant="h1">{logoTextSplit[0]}</Typography>
26-
<Typography variant="h1" sx={{ fontWeight: '400', ml: 2.5 }}>
27-
{logoTextSplit[1]}
24+
<Typography variant="h1">
25+
{logoTextSplit[0]}
26+
<Typography
27+
component="span"
28+
variant="h1"
29+
sx={{ fontWeight: '400', ml: 2.5 }}
30+
>
31+
{logoTextSplit[1]}
32+
</Typography>
2833
</Typography>
2934
</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-
>
35+
<Typography variant="h5" sx={{ textAlign: { xs: 'center', md: 'left' } }}>
3936
{t('homepage.completeJobs')}
4037
</Typography>
41-
</Grid>
38+
</Stack>
4239
);
4340
}

‎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' }}>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './use-start-idv';
2+
export * from './use-start-idv-mutation';
3+
export * from './use-register-address';
4+
export * from './use-register-address-notifications';

packages/apps/human-app/frontend/src/modules/worker/hooks/use-register-address-notifications.tsx renamed to packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address-notifications.tsx

File renamed without changes.

packages/apps/human-app/frontend/src/modules/worker/hooks/use-register-address.ts renamed to packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ResponseError } from '@/shared/types/global.type';
55
import { useWalletConnect } from '@/shared/contexts/wallet-connect';
66
import { usePrepareSignature } from '@/shared/hooks';
77
import { PrepareSignatureType } from '@/shared/services/signature.service';
8-
import * as profileService from '../profile/services/profile.service';
8+
import * as profileService from '../services/profile.service';
99
import { useAuth } from '@/modules/auth/hooks/use-auth';
1010

1111
interface RegisterAddressCallbacks {

0 commit comments

Comments
 (0)