From 05c4505f5aa2a6292c9b7e9ac8243658bab494ec Mon Sep 17 00:00:00 2001 From: KirillKirill Date: Fri, 10 Jul 2026 16:17:35 +0300 Subject: [PATCH 1/6] chore: bump materialUI to v9 --- packages/apps/human-app/frontend/package.json | 5 +- packages/apps/human-app/frontend/src/main.tsx | 2 - .../components/governance-banner.tsx | 72 +++-- .../choose-sign-up-account-type.tsx | 2 +- .../homepage/components/logo-section.tsx | 50 +-- .../homepage/components/operator-sign-in.tsx | 1 + .../homepage/components/operator-sign-up.tsx | 60 ++-- .../modules/homepage/components/welcome.tsx | 10 +- .../homepage/components/worker-sign-up.tsx | 64 ++-- .../src/modules/homepage/views/home.page.tsx | 2 +- .../profile/components/operator-info.tsx | 6 +- .../profile/components/operator-stats.tsx | 8 +- .../modules/operator/profile/profile.page.tsx | 6 +- .../modules/signin/worker/sign-in-form.tsx | 15 +- .../components/add-keys/add-keys-form.tsx | 14 +- .../add-keys/edit-existing-keys-form.tsx | 7 +- .../add-keys/existing-keys-form.tsx | 14 +- .../components/add-keys/existing-keys.tsx | 26 +- .../operator/components/add-stake/buttons.tsx | 8 +- .../components/add-stake/stake-form.tsx | 6 +- .../signup/operator/views/add-stake.page.tsx | 10 +- .../views/edit-existing-keys-success.page.tsx | 2 +- .../worker/views/sign-up-worker.page.tsx | 4 +- .../email-verification-success-message.tsx | 2 +- .../resend-verification-email-form.tsx | 8 +- .../components/user-stats-details.tsx | 31 +- .../components/user-stats-drawer.tsx | 6 +- .../hcaptcha-labeling/enable-labeler.page.tsx | 13 +- .../hcaptcha-labeling.page.tsx | 15 +- .../components/oracles-table-item-mobile.tsx | 14 +- .../components/oracles-table.tsx | 2 +- .../jobs-discovery/jobs-discovery.page.tsx | 34 +-- .../available-jobs-filter-modal.tsx | 9 +- .../mobile/available-jobs-list-mobile.tsx | 29 +- ...ailable-jobs-reward-amount-sort-mobile.tsx | 2 +- .../components/escrow-address-search-form.tsx | 16 +- .../jobs/components/report-abuse-modal.tsx | 32 +- .../worker/jobs/components/reward-amount.tsx | 6 +- .../worker/jobs/components/sorting.tsx | 4 +- .../src/modules/worker/jobs/jobs.page.tsx | 6 +- .../components/desktop/status-chip.tsx | 2 +- .../mobile/my-jobs-expires-at-sort-mobile.tsx | 2 +- .../mobile/my-jobs-filter-modal.tsx | 9 +- .../components/mobile/my-jobs-list-mobile.tsx | 25 +- .../my-jobs-reward-amount-sort-mobile.tsx | 2 +- .../oracle-registration/registration-form.tsx | 2 +- .../oracle-registration/registration.page.tsx | 6 +- .../profile/components/add-api-key-modal.tsx | 259 ++++++++++++++++ .../profile/components/api-key-data.tsx | 105 +++++++ .../components/delete-api-key-modal.tsx | 123 ++++++++ .../profile/components/edit-api-key-modal.tsx | 289 ++++++++++++++++++ .../identity-verification-control.tsx | 2 +- .../profile/components/modal-states.tsx | 41 ++- .../profile/components/profile-data.tsx | 5 +- .../profile/components/staking-info.tsx | 225 ++++++++++++++ .../components/wallet-connect-done.tsx | 56 ++-- .../worker/profile/views/profile.page.tsx | 2 +- .../reset-password-success.page.tsx | 2 +- .../reset-password/reset-password.page.tsx | 2 +- .../send-reset-link-success.page.tsx | 18 +- .../send-reset-link/send-reset-link.page.tsx | 2 +- .../frontend/src/router/components/footer.tsx | 94 +++--- .../protected/bottom-menu-items-list.tsx | 9 +- .../layout/protected/drawer-navigation.tsx | 7 +- .../components/layout/protected/layout.tsx | 41 ++- .../components/layout/protected/navbar.tsx | 8 +- .../layout/protected/page-header.tsx | 76 ++--- .../layout/protected/top-menu-items-list.tsx | 30 +- .../components/layout/unprotected/layout.tsx | 18 +- .../components/layout/unprotected/navbar.tsx | 2 +- .../shared/components/data-entry/checkbox.tsx | 2 +- .../shared/components/data-entry/input.tsx | 23 +- .../data-entry/password/password.tsx | 50 ++- .../components/hcaptcha/h-captcha-form.tsx | 2 +- .../src/shared/components/ui/chip.tsx | 6 +- .../components/ui/empty-placeholder.tsx | 2 +- .../components/ui/modal/global-modal.tsx | 12 +- .../shared/components/ui/optional-text.tsx | 2 +- .../components/ui/page-card/page-card.tsx | 40 +-- .../ui/profile/profile-list-item.tsx | 17 +- .../shared/components/ui/success-label.tsx | 2 +- .../src/shared/components/ui/table-button.tsx | 6 +- .../ui/table/table-header-menu/filtering.tsx | 16 +- .../ui/table/table-header-menu/sorting.tsx | 14 +- .../components/ui/text-header-with-icon.tsx | 2 +- .../frontend/src/shared/styles/dark-theme.ts | 1 - .../frontend/src/shared/styles/theme.ts | 1 - .../frontend/src/shared/styles/typography.ts | 1 + .../apps/human-app/frontend/tsconfig.json | 1 - 89 files changed, 1654 insertions(+), 633 deletions(-) create mode 100644 packages/apps/human-app/frontend/src/modules/worker/profile/components/add-api-key-modal.tsx create mode 100644 packages/apps/human-app/frontend/src/modules/worker/profile/components/api-key-data.tsx create mode 100644 packages/apps/human-app/frontend/src/modules/worker/profile/components/delete-api-key-modal.tsx create mode 100644 packages/apps/human-app/frontend/src/modules/worker/profile/components/edit-api-key-modal.tsx create mode 100644 packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx diff --git a/packages/apps/human-app/frontend/package.json b/packages/apps/human-app/frontend/package.json index a9fb3a8fd3..7d8fd7bce6 100644 --- a/packages/apps/human-app/frontend/package.json +++ b/packages/apps/human-app/frontend/package.json @@ -26,8 +26,7 @@ "@hookform/resolvers": "^5.1.0", "@human-protocol/sdk": "workspace:*", "@mui/icons-material": "^7.3.8", - "@mui/material": "^5.16.7", - "@mui/system": "^9.0.1", + "@mui/material": "^9.2.0", "@mui/x-date-pickers": "^9.2.0", "@reown/appkit": "^1.8.20", "@reown/appkit-adapter-wagmi": "^1.8.20", @@ -40,7 +39,6 @@ "jwt-decode": "^4.0.0", "lodash": "^4.18.1", "material-react-table": "3.0.1", - "mui-image": "^1.0.7", "notistack": "^3.0.1", "prop-types": "^15.8.1", "query-string": "^9.0.0", @@ -63,7 +61,6 @@ "@tanstack/eslint-plugin-query": "^5.60.1", "@tanstack/react-query-devtools": "^5.59.16", "@types/lodash": "^4.17.24", - "@types/mui-image": "^1.0.5", "@types/node": "^22.10.5", "@types/prop-types": "^15", "@types/react": "^19.2.15", diff --git a/packages/apps/human-app/frontend/src/main.tsx b/packages/apps/human-app/frontend/src/main.tsx index ccf792a2b6..b50351ca33 100644 --- a/packages/apps/human-app/frontend/src/main.tsx +++ b/packages/apps/human-app/frontend/src/main.tsx @@ -7,12 +7,10 @@ import CssBaseline from '@mui/material/CssBaseline'; import { BrowserRouter } from 'react-router-dom'; import { AuthProvider } from '@/modules/auth/context/auth-context'; import { Router } from '@/router/router'; -import '@fontsource/inter'; import '@fontsource/inter/400.css'; import '@fontsource/inter/500.css'; import '@fontsource/inter/600.css'; import '@fontsource/inter/800.css'; -import '@fontsource/roboto'; import '@fontsource/roboto/400.css'; import '@fontsource/roboto/500.css'; import { WalletConnectProvider } from '@/shared/contexts/wallet-connect'; diff --git a/packages/apps/human-app/frontend/src/modules/governance-banner/components/governance-banner.tsx b/packages/apps/human-app/frontend/src/modules/governance-banner/components/governance-banner.tsx index a1096e1d3d..a72404c85f 100644 --- a/packages/apps/human-app/frontend/src/modules/governance-banner/components/governance-banner.tsx +++ b/packages/apps/human-app/frontend/src/modules/governance-banner/components/governance-banner.tsx @@ -17,6 +17,7 @@ function getProposalStatus(proposal: ProposalResponse): ProposalStatus { if (voteStart <= now && now < voteEnd) return 'active'; return 'pending'; } + export function GovernanceBanner() { const { t } = useTranslation(); const { data: proposal, isLoading, isError } = useProposalQuery(); @@ -53,45 +54,49 @@ export function GovernanceBanner() { return ( {/* Left side: Countdown & "X votes" */} - + - + {status === 'pending' ? t('governance.timeToStart', 'Voting starts in') : t('governance.timeToReveal', 'Time to reveal vote')} : - + {timeRemaining} {status === 'active' && ( {totalVotes} {t('governance.votes', 'votes')} @@ -100,19 +105,24 @@ export function GovernanceBanner() { {/* Right side: "More details" link */} {t('governance.moreDetails', 'More details')} → diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/choose-sign-up-account-type.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/choose-sign-up-account-type.tsx index a0c2415e16..bb7ebfe479 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/choose-sign-up-account-type.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/choose-sign-up-account-type.tsx @@ -27,7 +27,7 @@ export function ChooseSignUpAccountType() { title={{t('homepage.welcome')} 👋} > - + {t('homepage.howWillUse')} diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/logo-section.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/logo-section.tsx index 6116bb99a3..d8666f3fac 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/logo-section.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/logo-section.tsx @@ -15,55 +15,65 @@ export function LogoSection() { const isMobile = useIsMobile('lg'); return ( - + {isMobile ? ( ) : ( - + - + - + )} {logoTextSplit[0]} - + {logoTextSplit[1]} {t('homepage.completeJobs')} diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx index 2c215be780..a09315b084 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx @@ -26,6 +26,7 @@ export function OperatorSignIn() { }, [address, isConnected, signInMutation]); const getSnackBar = () => { + console.log('1'); return ( -
+ {t('homepage.joinAsOperator')} @@ -37,45 +40,48 @@ export function OperatorSignUp() { sx={{ listStyleType: 'disc', listStylePosition: 'inside', - paddingLeft: '0.5rem', + pl: 1, }} > -
+ diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/welcome.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/welcome.tsx index 2737034284..c6ba4099bb 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/welcome.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/welcome.tsx @@ -1,6 +1,5 @@ import { Grid } from '@mui/material'; import { useEffect } from 'react'; -import { useIsMobile } from '@/shared/hooks/use-is-mobile'; import { useColorMode } from '@/shared/contexts/color-mode'; import { useBackgroundContext } from '@/shared/contexts/background'; import { SignInSection } from './sign-in-section'; @@ -9,7 +8,6 @@ import { LogoSection } from './logo-section'; export function Welcome() { const { isDarkMode } = useColorMode(); const { setWhiteBackground } = useBackgroundContext(); - const isMobile = useIsMobile('lg'); useEffect(() => { if (!isDarkMode) { @@ -20,13 +18,13 @@ export function Welcome() { return ( - + - + diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-up.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-up.tsx index 8ec2dcab12..7fe567bce4 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-up.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-up.tsx @@ -1,24 +1,23 @@ -import { Grid, Typography, List, ListItemText, Button } from '@mui/material'; +import { + Grid, + Typography, + List, + ListItemText, + Button, + Stack, +} from '@mui/material'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { routerPaths } from '@/router/router-paths'; import { useColorMode } from '@/shared/contexts/color-mode'; -import { useIsMobile } from '@/shared/hooks/use-is-mobile'; import { onlyDarkModeColor } from '@/shared/styles/dark-color-palette'; export function WorkerSignUp() { const { colorPalette, isDarkMode } = useColorMode(); const { t } = useTranslation(); - const isMobile = useIsMobile('lg'); return ( - + -
+ {t('homepage.iWantToEarn')} @@ -42,45 +41,48 @@ export function WorkerSignUp() { sx={{ listStyleType: 'disc', listStylePosition: 'inside', - paddingLeft: '0.5rem', + pl: '0.5rem', }} > -
+ diff --git a/packages/apps/human-app/frontend/src/modules/homepage/views/home.page.tsx b/packages/apps/human-app/frontend/src/modules/homepage/views/home.page.tsx index 7176f2fa77..35ba3e9221 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/views/home.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/views/home.page.tsx @@ -34,7 +34,7 @@ export function HomePage() { })(); return ( - + {t('operator.profile.about.header')} - + ) { - const isMobile = useIsMobile('lg'); const { colorPalette } = useColorMode(); const { t } = useTranslation(); @@ -22,21 +20,21 @@ export function OperatorStats({ width: '100%', display: 'flex', flexDirection: 'column', - padding: isMobile ? '20px' : '40px', + padding: { xs: 2.5, md: 5 }, borderRadius: '20px', }} > {t('operator.profile.statistics.header')} - + - + - + diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx b/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx index 5aeca3562a..f08174d2cd 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx @@ -1,5 +1,5 @@ import { FormProvider, useForm } from 'react-hook-form'; -import { Box, Grid, Typography } from '@mui/material'; +import { Box, Grid, Link as MuiLink, Typography } from '@mui/material'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; @@ -44,7 +44,7 @@ export function SignInForm({ return (
- + - + - {t('worker.signInForm.forgotPassword')} - + diff --git a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/add-keys-form.tsx b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/add-keys-form.tsx index 84491fee32..fd45b334c5 100644 --- a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/add-keys-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/add-keys-form.tsx @@ -1,4 +1,4 @@ -import { Grid } from '@mui/material'; +import { Grid, Stack } from '@mui/material'; import { t } from 'i18next'; import { Link } from 'react-router-dom'; import { routerPaths } from '@/router/router-paths'; @@ -27,13 +27,11 @@ export function AddKeysForm({ }); return ( - -
+ {hasSomeNotEmptyKeys ? : null} @@ -47,7 +45,7 @@ export function AddKeysForm({ {t('operator.addKeysPage.skipBtn')} ) : null} -
+
); } diff --git a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/edit-existing-keys-form.tsx b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/edit-existing-keys-form.tsx index 7ef7b929f3..20914684fd 100644 --- a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/edit-existing-keys-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/edit-existing-keys-form.tsx @@ -107,9 +107,9 @@ export function EditExistingKeysForm({ {noChangesError ? (
{noChangesError} @@ -117,7 +117,10 @@ export function EditExistingKeysForm({ ) : null}
diff --git a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys-form.tsx b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys-form.tsx index d7b0687727..b78d59326b 100644 --- a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys-form.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Grid } from '@mui/material'; +import { Grid, Stack } from '@mui/material'; import { zodResolver } from '@hookform/resolvers/zod'; import { FormProvider, useForm } from 'react-hook-form'; import type { GetEthKVStoreValuesSuccessResponse } from '@/modules/operator/hooks/use-get-keys'; @@ -31,13 +31,11 @@ export function ExistingKeysForm({ useResetMutationErrors(existingKeysMethods.watch, existingKeysMutation.reset); return ( - -
+ @@ -66,7 +64,7 @@ export function ExistingKeysForm({ )} -
+
); } diff --git a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys.tsx b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys.tsx index 1eb854a9fc..272bdb3083 100644 --- a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys.tsx +++ b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-keys/existing-keys.tsx @@ -18,7 +18,7 @@ const existingKeysConfig: Record< (values: GetEthKVStoreValuesSuccessResponse) => React.ReactElement > = { [EthKVStoreKeys.Fee]: ({ fee }) => ( - + {t('operator.addKeysPage.existingKeys.fee')} @@ -30,38 +30,38 @@ const existingKeysConfig: Record< ), [EthKVStoreKeys.PublicKey]: ({ public_key }) => ( - - + + {t('operator.addKeysPage.existingKeys.publicKey')} - + ), [EthKVStoreKeys.Url]: ({ url }) => ( - - + + {t('operator.addKeysPage.existingKeys.url')} - + ), [EthKVStoreKeys.WebhookUrl]: ({ webhook_url }) => ( - + {t('operator.addKeysPage.existingKeys.webhookUrl')} - + ), [EthKVStoreKeys.Role]: ({ role }) => ( - + {t('operator.addKeysPage.existingKeys.role')}
{role ? : }
@@ -69,7 +69,7 @@ const existingKeysConfig: Record< ), [EthKVStoreKeys.JobTypes]: ({ job_types }) => ( - + {t('operator.addKeysPage.existingKeys.jobType')}
{job_types ? : }
@@ -94,7 +94,7 @@ export function ExistingKeys({ ); return ( - + {t('operator.addKeysPage.existingKeys.title')} @@ -111,7 +111,7 @@ export function ExistingKeys({ startIcon={} variant="contained" > - + {t('operator.addKeysPage.existingKeys.editBtn')} diff --git a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-stake/buttons.tsx b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-stake/buttons.tsx index b3a4b84a83..4a677bdaf8 100644 --- a/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-stake/buttons.tsx +++ b/packages/apps/human-app/frontend/src/modules/signup/operator/components/add-stake/buttons.tsx @@ -16,9 +16,9 @@ export function Buttons({ return ( diff --git a/packages/apps/human-app/frontend/src/modules/worker/hcaptcha-labeling/hcaptcha-labeling.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/hcaptcha-labeling/hcaptcha-labeling.page.tsx index 3efadc29da..232f127f4d 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/hcaptcha-labeling/hcaptcha-labeling.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/hcaptcha-labeling/hcaptcha-labeling.page.tsx @@ -4,7 +4,6 @@ import { Paper, Typography } from '@mui/material'; import { t } from 'i18next'; import { Navigate, useNavigate } from 'react-router-dom'; import { useRef } from 'react'; -import { useIsMobile } from '@/shared/hooks/use-is-mobile'; import { env } from '@/shared/env'; import { breakpoints } from '@/shared/styles/breakpoints'; import { Counter } from '@/shared/components/ui/counter'; @@ -67,7 +66,6 @@ export function HcaptchaLabelingPage() { error: dailyHmtSpentError, } = useDailyHmtSpent(); - const isMobile = useIsMobile(); const navigate = useNavigate(); const canSolveCaptcha = @@ -102,17 +100,14 @@ export function HcaptchaLabelingPage() { return ( @@ -155,11 +150,11 @@ export function HcaptchaLabelingPage() { /> ) : ( - + {t('worker.hcaptchaLabeling.noJobs')} - + { diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table-item-mobile.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table-item-mobile.tsx index 085b952125..730f41db79 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table-item-mobile.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table-item-mobile.tsx @@ -1,4 +1,4 @@ -import { Grid, Paper, type SxProps, Typography } from '@mui/material'; +import { Stack, Paper, type SxProps, Typography } from '@mui/material'; import { t } from 'i18next'; import { Chips } from '@/shared/components/ui/chips'; import { TableButton } from '@/shared/components/ui/table-button'; @@ -14,13 +14,13 @@ interface OraclesTableItemMobileProps { } const styles: SxProps = { - px: '16px', - py: '32px', - marginBottom: '20px', + px: 2, + py: 4, + mb: 2.5, borderRadius: '20px', display: 'flex', flexDirection: 'column', - gap: '1rem', + gap: 2, boxShadow: 'none', }; @@ -32,7 +32,7 @@ export function OraclesTableItemMobile({ return ( - + @@ -46,7 +46,7 @@ export function OraclesTableItemMobile({ )} /> - + { diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table.tsx index abb5fe312c..9e19e8af0e 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs-discovery/components/oracles-table.tsx @@ -51,7 +51,7 @@ export function OraclesTable() { } return isMobile ? ( - + {oraclesData.map((oracle) => ( - - - - - - - + + + + + + ); } diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/available-jobs-filter-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/available-jobs-filter-modal.tsx index 087a512020..f66e008a16 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/available-jobs-filter-modal.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/available-jobs-filter-modal.tsx @@ -43,16 +43,15 @@ export function AvailableJobsFilterModal({ variant="persistent" > {t('worker.jobs.network')} - + @@ -112,7 +111,7 @@ export function AvailableJobsFilterModal({ {t('worker.jobs.jobType')} - + diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-list-mobile.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-list-mobile.tsx index 0ece918fc8..da1da55a87 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-list-mobile.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-list-mobile.tsx @@ -40,34 +40,34 @@ export function AvailableJobsListMobile() { }, [resetFilterParams]); return ( - + {isTableError && ( {getErrorMessageForError(tableError)} )} {tableStatus === 'pending' && ( - + )} - {allPages.map((d) => ( - - + + {d.job_description} - + @@ -93,22 +92,22 @@ export function AvailableJobsListMobile() { /> - + {getNetworkName(d.chain_id)} - + - + { setPageParams(filterParams.page + 1, filterParams.page_size); void fetchNextPage(); }} - variant="outlined" > {t('worker.jobs.next')} diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-reward-amount-sort-mobile.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-reward-amount-sort-mobile.tsx index 5aa9807f7f..3f78e5fec9 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-reward-amount-sort-mobile.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/components/mobile/available-jobs-reward-amount-sort-mobile.tsx @@ -12,7 +12,7 @@ export function AvailableJobsRewardAmountSortMobile() { return ( + {t('worker.jobs.rewardAmount')} } diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/escrow-address-search-form.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/escrow-address-search-form.tsx index 77cebcfca9..472dbc17ca 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/escrow-address-search-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/escrow-address-search-form.tsx @@ -73,16 +73,18 @@ export function EscrowAddressSearchForm({ > - - - ), - }} fullWidth label={label} name="searchValue" + slotProps={{ + input: { + startAdornment: ( + + + + ), + }, + }} onChange={(e) => { methods.setValue('searchValue', e.target.value); }} diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx index 7db3ca047b..5cbfa52622 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx @@ -45,24 +45,23 @@ function ErrorState({ error }: { error: string }) { const errorColor = colorPalette.error.main; return ( - + {isAbuseError ? ( <> {t('worker.reportAbuse.modalHeaderAlreadyReportedError')} - + {t('worker.reportAbuse.modalParagraphAlreadyReportedError')} ) : ( - + {t('worker.reportAbuse.modalUnknownError')} )} @@ -73,11 +72,11 @@ function ErrorState({ error }: { error: string }) { function SuccessState() { const { t } = useTranslation(); return ( - + - + {t('worker.reportAbuse.modalSuccessHeader')} @@ -129,17 +128,22 @@ export function ReportAbuseModal({ return ( - + {t('worker.reportAbuse.modalHeader')} {isIdleOrLoading && ( <> - + {t('worker.reportAbuse.modalParagraph')} @@ -162,7 +166,7 @@ export function ReportAbuseModal({ {isPending && } {isError && } {isSuccess && } - + - + + )} + {(isPending || isSuccess) && ( + + )} + {isError && ( + + )} + + {t('worker.profile.apiKeyData.modalFooterAgreement')} + + + + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/api-key-data.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/api-key-data.tsx new file mode 100644 index 0000000000..a483011d17 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/api-key-data.tsx @@ -0,0 +1,105 @@ +import { IconButton, Stack, Typography } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { Chip } from '@/shared/components/ui/chip'; +import { CustomTextField, CustomTextFieldDark } from './custom-text-field'; +import { useColorMode } from '@/shared/contexts/color-mode'; +import { DeleteIcon, EditIcon } from '@/shared/components/ui/icons'; +import { + useDeleteApiKeyModal, + useEditApiKeyModal, +} from '../hooks/use-api-key-modals'; +import { useGetExchangeApiKeys } from '../../hooks/use-exchange-api-keys'; + +export function ApiKeyData({ + stakingExchangeError, +}: { + stakingExchangeError?: string; +}) { + const { isDarkMode } = useColorMode(); + const { t } = useTranslation(); + const { openModal: openEditApiKeyModal } = useEditApiKeyModal(); + const { openModal: openDeleteApiKeyModal } = useDeleteApiKeyModal(); + const { data: exchangeApiKeyData, isError: isExchangeApiKeyError } = + useGetExchangeApiKeys(); + + const textField = isDarkMode ? ( + + ) : ( + + ); + + return ( + + + + {t('worker.profile.apiKeyData.apiKey')} + + + + + {textField} + {exchangeApiKeyData?.exchange_name && ( + + + openEditApiKeyModal(exchangeApiKeyData.exchange_name) + } + > + + + + + + + )} + + + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/delete-api-key-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/delete-api-key-modal.tsx new file mode 100644 index 0000000000..10bf84cd71 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/delete-api-key-modal.tsx @@ -0,0 +1,123 @@ +import { Stack, Typography } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { Button } from '@/shared/components/ui/button'; +import { useIsMobile } from '@/shared/hooks'; +import { useDeleteExchangeApiKeys } from '../../hooks/use-exchange-api-keys'; +import { useEffect } from 'react'; +import { ModalError, ModalSuccess, ModalLoading } from './modal-states'; + +interface DeleteApiKeyModalProps { + onClose: () => void; + disableClose: (disable: boolean) => void; +} + +export function DeleteApiKeyModal({ + onClose, + disableClose, +}: DeleteApiKeyModalProps) { + const { t } = useTranslation(); + const { + mutate: deleteExchangeApiKey, + reset: resetMutation, + isSuccess, + isError, + isPending, + isIdle, + } = useDeleteExchangeApiKeys(); + const isMobile = useIsMobile(); + + const handleDeleteExchangeApiKey = () => { + deleteExchangeApiKey(); + }; + + useEffect(() => { + disableClose(isPending); + }, [isPending, disableClose]); + + useEffect(() => { + return () => { + resetMutation(); + }; + }, [resetMutation]); + + return ( + + + {t('worker.profile.apiKeyData.deleteApiKey')} + + {isPending && } + {isIdle && ( + <> + + {t('worker.profile.apiKeyData.deleteApiKeyConfirmation')} + + + {t('worker.profile.apiKeyData.deleteApiKeyDescription')} + + + )} + {isSuccess && ( + + + {t('worker.profile.apiKeyData.deleteKeySuccess')} + + + )} + {isError && ( + + )} + {isIdle && ( + + + + + )} + {(isPending || isSuccess) && ( + + )} + {isError && ( + + )} + + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/edit-api-key-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/edit-api-key-modal.tsx new file mode 100644 index 0000000000..7d83d94dce --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/edit-api-key-modal.tsx @@ -0,0 +1,289 @@ +import { zodResolver } from '@hookform/resolvers/zod'; +import { + Autocomplete, + Box, + FormControl, + FormHelperText, + Stack, + TextField, + Typography, +} from '@mui/material'; +import { Controller, useForm } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { z } from 'zod'; +import { Button } from '@/shared/components/ui/button'; +import { useIsMobile } from '@/shared/hooks'; +import { useEffect } from 'react'; +import { + useEnrollExchangeApiKeys, + useGetSupportedExchanges, +} from '../../hooks/use-exchange-api-keys'; +import { ModalError, ModalLoading, ModalSuccess } from './modal-states'; + +interface EditApiKeyModalProps { + exchangeName: string; + onClose: () => void; + disableClose: (disable: boolean) => void; +} + +export function EditApiKeyModal({ + onClose, + exchangeName, + disableClose, +}: EditApiKeyModalProps) { + const { t } = useTranslation(); + const isMobile = useIsMobile(); + const { + mutate: postExchangeApiKey, + reset: resetMutation, + error, + isSuccess, + isError, + isPending, + isIdle, + } = useEnrollExchangeApiKeys(); + const { data: supportedExchanges } = useGetSupportedExchanges(); + + const { + control, + handleSubmit, + formState: { errors }, + reset, + } = useForm({ + defaultValues: { + exchange: '', + apiKey: '', + secretKey: '', + }, + resolver: zodResolver( + z.object({ + exchange: z.string().min(1, t('validation.required')), + apiKey: z.string().trim().min(1, t('validation.required')), + secretKey: z.string().trim().min(1, t('validation.required')), + }) + ), + }); + + useEffect(() => { + if (exchangeName && supportedExchanges) { + reset({ + exchange: exchangeName, + apiKey: '', + secretKey: '', + }); + } + }, [exchangeName, reset, supportedExchanges]); + + useEffect(() => { + disableClose(isPending); + }, [isPending, disableClose]); + + useEffect(() => { + return () => { + reset(); + resetMutation(); + }; + }, [reset, resetMutation]); + + const onSubmit = (data: { + exchange: string; + apiKey: string; + secretKey: string; + }) => { + postExchangeApiKey(data); + }; + + return ( +
+ + + {t('worker.profile.apiKeyData.editApiKey')} + + {isPending && } + {isIdle && ( + <> + + {t('worker.profile.apiKeyData.modalDescription')} + + + + ( + exchange.name) || + [] + } + getOptionLabel={(option) => { + const exchange = supportedExchanges?.find( + (exchange) => exchange.name === option + ); + return exchange?.display_name || option || ''; + }} + renderInput={(params) => ( + + )} + renderOption={(props, option) => { + const exchange = supportedExchanges?.find( + (exchange) => exchange.name === option + ); + return ( + + + {exchange?.display_name || exchange?.name} + + + ); + }} + {...field} + onChange={(_, value) => field.onChange(value)} + /> + )} + /> + {errors.exchange && ( + + {errors.exchange.message} + + )} + + + ( + + )} + /> + {errors.apiKey && ( + {errors.apiKey.message} + )} + + + + ( + + )} + /> + {errors.secretKey && ( + + {errors.secretKey.message} + + )} + + + )} + {isSuccess && ( + + + {t('worker.profile.apiKeyData.editSuccess')} + + + )} + {isError && ( + + )} + {isIdle && ( + + + + + )} + {(isPending || isSuccess) && ( + + )} + {isError && ( + + )} + +
+ ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/identity-verification-control.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/identity-verification-control.tsx index 6acd2ab252..cd0463b88e 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/identity-verification-control.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/identity-verification-control.tsx @@ -27,7 +27,7 @@ export function IdentityVerificationControl() { } return ( - + {t('worker.profile.identityVerificationStatus')} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/modal-states.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/modal-states.tsx index 5225e3bd2b..929d1219c2 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/modal-states.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/modal-states.tsx @@ -7,11 +7,13 @@ import CloseIcon from '@mui/icons-material/Cancel'; export function ModalLoading() { return ( @@ -22,11 +24,13 @@ export function ModalSuccess({ children }: { children: React.ReactNode }) { return ( <> @@ -39,15 +43,20 @@ export function ModalError({ message }: { message: string }) { return ( <> - + {message} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/profile-data.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/profile-data.tsx index 42278a97c8..79b9d36d82 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/profile-data.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/profile-data.tsx @@ -12,13 +12,12 @@ export function ProfileData() { const { user } = useAuthenticatedUser(); const { t } = useTranslation(); return ( - + {t('worker.profile.email')} {user.email} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx new file mode 100644 index 0000000000..d1ae872907 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx @@ -0,0 +1,225 @@ +import { + Button, + IconButton, + Link, + Skeleton, + Stack, + Typography, +} from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { Chip } from '@/shared/components/ui/chip'; +import { env } from '@/shared/env'; +import { useAddApiKeyModal } from '../hooks/use-api-key-modals'; +import { ApiKeyData } from './'; +import { useGetStakingSummary } from '../../hooks/use-staking'; +import { RefreshIcon } from '@/shared/components/ui/icons'; +import { useGetExchangeApiKeys } from '../../hooks/use-exchange-api-keys'; +import { useAuthenticatedUser } from '@/modules/auth/hooks/use-authenticated-user'; +import { useEffect, useRef, useState } from 'react'; +import { useAccessTokenRefresh } from '@/api/hooks/use-access-token-refresh'; +import { colorPalette } from '@/shared/styles/color-palette'; +import { useGetUiConfig } from '@/shared/hooks/use-get-ui-config'; +import { + TopNotificationType, + useNotification, +} from '@/shared/hooks/use-notification'; + +export function StakingInfo() { + const [isPromptExpanded, setIsPromptExpanded] = useState(false); + const tokenRefreshLock = useRef(false); + + const { user, updateUserData } = useAuthenticatedUser(); + const { refreshAccessTokenAsync } = useAccessTokenRefresh(); + const { t } = useTranslation(); + const { showNotification } = useNotification(); + + const { openModal: openAddApiKeyModal } = useAddApiKeyModal(); + const { data: exchangeApiKeyData, isLoading: isExchangeApiKeyLoading } = + useGetExchangeApiKeys(); + const { + data: stakingSummary, + isLoading, + isError, + refetch, + isRefetching, + } = useGetStakingSummary(); + const { data: uiConfig, isLoading: isUiConfigLoading } = useGetUiConfig(); + + const isConnectButtonDisabled = + !!exchangeApiKeyData?.exchange_name || isExchangeApiKeyLoading; + + const stakedAmount = + Number(stakingSummary?.on_chain_stake || 0) + + Number(stakingSummary?.exchange_stake || 0); + + const isStaked = + isLoading || isError || isUiConfigLoading + ? false + : stakedAmount >= Number(uiConfig?.minThreshold || '0'); + + useEffect(() => { + const stakingSummaryError = + stakingSummary?.on_chain_error || stakingSummary?.exchange_error; + if (stakingSummaryError && !isLoading && !isRefetching) { + showNotification({ + type: TopNotificationType.WARNING, + message: stakingSummaryError, + }); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ + isLoading, + isRefetching, + stakingSummary?.on_chain_error, + stakingSummary?.exchange_error, + ]); + + useEffect(() => { + if (isRefetching || isLoading) return; + + if (isStaked !== user.is_stake_eligible) { + if (!tokenRefreshLock.current) { + tokenRefreshLock.current = true; + updateUserData({ is_stake_eligible: isStaked }); + void refreshAccessTokenAsync({ authType: 'web2' }); + } + } else { + tokenRefreshLock.current = false; + } + }, [ + isStaked, + user.is_stake_eligible, + refreshAccessTokenAsync, + isRefetching, + isLoading, + updateUserData, + ]); + + const handleRefreshStakingInfo = () => { + if (isRefetching || isLoading) return; + tokenRefreshLock.current = false; + refetch(); + }; + + return ( + + + + {t('worker.profile.stakingInfo.stakeHmt')} + + {isLoading || isRefetching ? ( + + ) : ( + + )} + + + {isPromptExpanded + ? t('worker.profile.stakingInfo.prompt', { + amount: uiConfig?.minThreshold, + }) + : t('worker.profile.stakingInfo.promptShort')}{' '} + {isPromptExpanded && ( + <> +
+ + {t('worker.profile.stakingInfo.howToCreateApiKeys')} + +
+ + )} + +
+ + + {t('worker.profile.stakingInfo.stakedAmount')} + + svg > path': { + fill: + isRefetching || isLoading + ? colorPalette.button.disabled + : 'primary.main', + }, + }} + onClick={handleRefreshStakingInfo} + > + + + + {isLoading || isRefetching ? ( + + ) : ( + + {stakedAmount} HMT + + )} + + + + + +
+ ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/components/wallet-connect-done.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/components/wallet-connect-done.tsx index f44d5580ed..f46d8592e1 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/wallet-connect-done.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/wallet-connect-done.tsx @@ -45,18 +45,20 @@ export function WalletConnectDone() { disabled fullWidth value={shortAddress} - InputProps={{ - endAdornment: ( - - - - - - ), + slotProps={{ + input: { + endAdornment: ( + + + + + + ), + }, }} /> ) : ( @@ -64,25 +66,27 @@ export function WalletConnectDone() { disabled fullWidth value={shortAddress} - InputProps={{ - endAdornment: ( - - - - - - ), + slotProps={{ + input: { + endAdornment: ( + + + + + + ), + }, }} /> ); return ( - - + + {t('worker.profile.wallet')} diff --git a/packages/apps/human-app/frontend/src/modules/worker/profile/views/profile.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/views/profile.page.tsx index d79116a913..017aad13fa 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/views/profile.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/views/profile.page.tsx @@ -59,7 +59,7 @@ export function WorkerProfilePage() { justifyContent: 'center', }} > - + diff --git a/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password-success.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password-success.page.tsx index b499e83aeb..77cca00e4b 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password-success.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password-success.page.tsx @@ -33,7 +33,7 @@ export function ResetPasswordWorkerSuccessPage() {
} > - + {t('worker.resetPasswordSuccess.description')} diff --git a/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password.page.tsx index afab645953..7b8aebe0f9 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/reset-password/reset-password.page.tsx @@ -66,7 +66,7 @@ export function ResetPasswordWorkerPage() { void methods.handleSubmit(handleWorkerResetPassword)(event); }} > - + {t('worker.resetPassword.description')} diff --git a/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link-success.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link-success.page.tsx index d379198a55..4ab0d39ef7 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link-success.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link-success.page.tsx @@ -60,30 +60,30 @@ export function SendResetLinkWorkerSuccessPage() { void methods.handleSubmit(handleWorkerSendResetLink)(event); }} > - + , + 1: , }} i18nKey="worker.sendResetLinkSuccess.paragraph1" values={{ email }} /> {t('worker.sendResetLinkSuccess.paragraph2')} , + 1: , }} i18nKey="worker.sendResetLinkSuccess.paragraph3" values={{ email }} @@ -107,7 +107,7 @@ export function SendResetLinkWorkerSuccessPage() { , + 1: , 2: , }} i18nKey="worker.sendResetLinkSuccess.paragraph4" diff --git a/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link.page.tsx index 912399b95d..c5a904db07 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/send-reset-link/send-reset-link.page.tsx @@ -58,7 +58,7 @@ export function SendResetLinkWorkerPage() { void methods.handleSubmit(handleWorkerSendResetLink)(event); }} > - + {t('worker.sendResetLinkForm.description')} diff --git a/packages/apps/human-app/frontend/src/router/components/footer.tsx b/packages/apps/human-app/frontend/src/router/components/footer.tsx index 25e00a70f5..116c060564 100644 --- a/packages/apps/human-app/frontend/src/router/components/footer.tsx +++ b/packages/apps/human-app/frontend/src/router/components/footer.tsx @@ -10,57 +10,43 @@ interface FooterProps { displayChatIcon?: boolean; isProtected?: boolean; } -export function Footer({ - isProtected, - displayChatIcon = true, -}: Readonly) { + +export function Footer({ isProtected, displayChatIcon = true }: FooterProps) { const { colorPalette } = useColorMode(); const { t } = useTranslation(); const isMobile = useIsMobile('md'); - const getLeftPadding = () => { - if (isMobile) { - return '0'; - } - if (isProtected) { - return '200px'; - } - return '0'; - }; - return ( @@ -68,9 +54,14 @@ export function Footer({ href={env.VITE_PRIVACY_POLICY_URL} rel="noreferrer" target="_blank" - underline="none" + sx={{ + textDecoration: 'none', + }} > - + {t('components.footer.privacyPolicy')} @@ -78,47 +69,60 @@ export function Footer({ href={env.VITE_TERMS_OF_SERVICE_URL} rel="noreferrer" target="_blank" - underline="none" + sx={{ + textDecoration: 'none', + }} > - + {t('components.footer.termsOfService')} - + {t('components.footer.humanProtocol')} {isMobile ? ( - + {t('components.footer.copyrightNote')} ) : null} {!isMobile ? ( - + {t('components.footer.copyrightNote')} ) : null} diff --git a/packages/apps/human-app/frontend/src/router/components/layout/protected/bottom-menu-items-list.tsx b/packages/apps/human-app/frontend/src/router/components/layout/protected/bottom-menu-items-list.tsx index 8bf0bafb4d..34d23acb0c 100644 --- a/packages/apps/human-app/frontend/src/router/components/layout/protected/bottom-menu-items-list.tsx +++ b/packages/apps/human-app/frontend/src/router/components/layout/protected/bottom-menu-items-list.tsx @@ -72,12 +72,13 @@ export function BottomMenuItemsList({ }} > {icon} diff --git a/packages/apps/human-app/frontend/src/router/components/layout/protected/drawer-navigation.tsx b/packages/apps/human-app/frontend/src/router/components/layout/protected/drawer-navigation.tsx index ac6d46a6b5..8dd0730b46 100644 --- a/packages/apps/human-app/frontend/src/router/components/layout/protected/drawer-navigation.tsx +++ b/packages/apps/human-app/frontend/src/router/components/layout/protected/drawer-navigation.tsx @@ -72,6 +72,7 @@ export function DrawerNavigation({ {!isMobile && ( { handleMainNavIconClick(); }} @@ -96,8 +95,8 @@ export function DrawerNavigation({ )} diff --git a/packages/apps/human-app/frontend/src/router/components/layout/protected/layout.tsx b/packages/apps/human-app/frontend/src/router/components/layout/protected/layout.tsx index ebe1e2ead6..2659f5304b 100644 --- a/packages/apps/human-app/frontend/src/router/components/layout/protected/layout.tsx +++ b/packages/apps/human-app/frontend/src/router/components/layout/protected/layout.tsx @@ -1,4 +1,4 @@ -import { Grid, styled } from '@mui/material'; +import { Box, Stack, styled } from '@mui/material'; import type { Dispatch, ReactElement, SetStateAction } from 'react'; import { useEffect, useRef, useState } from 'react'; import { Outlet } from 'react-router-dom'; @@ -74,15 +74,12 @@ export function ProtectedLayout({ }, [setGrayBackground]); return ( - - {renderGovernanceBanner && } - - - - + + - - + +