diff --git a/.github/workflows/ci-lint-cvat-recording-oracle.yaml b/.github/workflows/ci-lint-cvat-recording-oracle.yaml index 046a857d0b..baa61a0dae 100644 --- a/.github/workflows/ci-lint-cvat-recording-oracle.yaml +++ b/.github/workflows/ci-lint-cvat-recording-oracle.yaml @@ -29,5 +29,5 @@ jobs: python-version: '3.10' cache: 'poetry' cache-dependency-path: ${{ env.WORKING_DIR }}/poetry.lock - - run: poetry install --no-root --only lint + - run: poetry install --no-root --only dev - run: poetry run pre-commit run --all-files diff --git a/.github/workflows/ci-test-cvat-exchange-oracle.yaml b/.github/workflows/ci-test-cvat-exchange-oracle.yaml index 8ec4a147ba..8f49f2b7f4 100644 --- a/.github/workflows/ci-test-cvat-exchange-oracle.yaml +++ b/.github/workflows/ci-test-cvat-exchange-oracle.yaml @@ -15,4 +15,4 @@ jobs: - uses: actions/checkout@v7 - name: CVAT Exchange Oracle tests working-directory: ./packages/examples/cvat/exchange-oracle - run: docker compose -f docker-compose.test.yml up --attach test --exit-code-from test + run: docker compose -f docker-compose.test.yml -f docker-compose.test.head.yml up --attach test --exit-code-from test diff --git a/.github/workflows/ci-test-cvat-recording-oracle.yaml b/.github/workflows/ci-test-cvat-recording-oracle.yaml index bf975f3ce1..944e079de2 100644 --- a/.github/workflows/ci-test-cvat-recording-oracle.yaml +++ b/.github/workflows/ci-test-cvat-recording-oracle.yaml @@ -15,4 +15,4 @@ jobs: - uses: actions/checkout@v7 - name: CVAT Recording Oracle tests working-directory: ./packages/examples/cvat/recording-oracle - run: docker compose -f docker-compose.test.yml up --attach test --exit-code-from test + run: docker compose -f docker-compose.test.yml -f docker-compose.test.head.yml up --attach test --exit-code-from test diff --git a/docker-setup/Makefile b/docker-setup/Makefile index 724723d377..39d57fd2e6 100644 --- a/docker-setup/Makefile +++ b/docker-setup/Makefile @@ -16,15 +16,15 @@ infra-up: check-env-file infra-stop: @docker compose --env-file .env.compose.local stop postgres redis minio minio-client +# TODO: Revisit compose-native parallel builds once Docker Compose v5 parallel limits are reliable again. build-services: check-env-file - @# TODO: Revisit compose-native parallel builds once Docker Compose v5 parallel limits are reliable again. @docker compose --env-file .env.compose.local config --services | \ xargs -n $(DOCKER_PARALLEL) docker compose --env-file .env.compose.local build @docker compose --env-file .env.compose.local up --no-start +# TODO: Revisit compose-native parallel builds once Docker Compose v5 parallel limits are reliable again. services-up: check-env-file @service_names="$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))"; \ - @# TODO: Revisit compose-native parallel builds once Docker Compose v5 parallel limits are reliable again. if [ -n "$$service_names" ]; then \ printf '%s\n' $$service_names | xargs -n $(DOCKER_PARALLEL) docker compose --env-file .env.compose.local up -d; \ else \ diff --git a/packages/apps/dashboard/client/package.json b/packages/apps/dashboard/client/package.json index 884bd43dbf..54c43c6c7c 100644 --- a/packages/apps/dashboard/client/package.json +++ b/packages/apps/dashboard/client/package.json @@ -25,7 +25,7 @@ "@mui/styled-engine-sc": "9.0.1", "@mui/system": "^9.0.1", "@mui/x-data-grid": "^8.7.0", - "@mui/x-date-pickers": "^9.2.0", + "@mui/x-date-pickers": "^9.9.0", "@tanstack/react-query": "^5.91.3", "@types/react-router-dom": "^5.3.3", "@types/recharts": "^1.8.29", @@ -35,10 +35,10 @@ "react": "^19.2.6", "react-dom": "^19.2.6", "react-number-format": "^5.4.5", - "react-router-dom": "^7.18.0", + "react-router-dom": "^7.18.1", "recharts": "^2.13.0-alpha.4", "simplebar-react": "^3.3.2", - "styled-components": "^6.3.11", + "styled-components": "^6.4.3", "swiper": "^11.1.3", "use-debounce": "^10.1.0", "vite-plugin-node-polyfills": "^0.25.0", diff --git a/packages/apps/dashboard/server/package.json b/packages/apps/dashboard/server/package.json index d6f2b10fac..d18d0ed3a1 100644 --- a/packages/apps/dashboard/server/package.json +++ b/packages/apps/dashboard/server/package.json @@ -27,7 +27,7 @@ "@keyv/redis": "^5.1.5", "@nestjs/axios": "^4.0.1", "@nestjs/cache-manager": "^3.1.0", - "@nestjs/common": "^11.1.12", + "@nestjs/common": "^11.1.27", "@nestjs/config": "^4.0.2", "@nestjs/core": "^11.1.12", "@nestjs/mapped-types": "^2.1.1", @@ -35,14 +35,14 @@ "@nestjs/schedule": "^6.1.3", "@nestjs/swagger": "^11.2.5", "axios": "^1.3.1", - "cache-manager": "7.2.8", + "cache-manager": "7.2.9", "class-transformer": "^0.5.1", "class-validator": "0.14.1", "dayjs": "^1.11.20", "ethers": "~6.17.0", "joi": "^17.13.3", "keyv": "^5.5.5", - "lodash": "^4.17.21", + "lodash": "^4.18.1", "minio": "8.0.7", "reflect-metadata": "^0.2.2", "rxjs": "^7.2.0" diff --git a/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts b/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts index f7c6350826..049a763aed 100644 --- a/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts +++ b/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts @@ -1,4 +1,4 @@ -import { CacheModuleAsyncOptions } from '@nestjs/common/cache'; +import { CacheModuleAsyncOptions } from '@nestjs/cache-manager'; import { ConfigModule } from '@nestjs/config'; import * as _ from 'lodash'; diff --git a/packages/apps/faucet/client/package.json b/packages/apps/faucet/client/package.json index b24b6c5666..620c0f82a3 100644 --- a/packages/apps/faucet/client/package.json +++ b/packages/apps/faucet/client/package.json @@ -26,7 +26,7 @@ "react": "^19.2.6", "react-dom": "^19.2.6", "react-loading-skeleton": "^3.3.1", - "react-router-dom": "^7.18.0", + "react-router-dom": "^7.18.1", "serve": "^14.2.6", "viem": "^2.52.2" }, diff --git a/packages/apps/fortune/exchange-oracle/client/package.json b/packages/apps/fortune/exchange-oracle/client/package.json index 7d2542af36..80351990c1 100644 --- a/packages/apps/fortune/exchange-oracle/client/package.json +++ b/packages/apps/fortune/exchange-oracle/client/package.json @@ -32,14 +32,14 @@ "@human-protocol/sdk": "workspace:^", "@mui/icons-material": "^7.3.8", "@mui/material": "^5.16.7", - "@tanstack/query-sync-storage-persister": "^5.68.0", + "@tanstack/query-sync-storage-persister": "^5.101.2", "@tanstack/react-query": "^5.91.3", "@tanstack/react-query-persist-client": "^5.80.7", "axios": "^1.7.2", "ethers": "^6.17.0", "react": "^19.2.6", "react-dom": "^19.2.6", - "react-router-dom": "^7.18.0", + "react-router-dom": "^7.18.1", "serve": "^14.2.6", "viem": "^2.52.2", "wagmi": "^3.6.15" diff --git a/packages/apps/fortune/exchange-oracle/server/package.json b/packages/apps/fortune/exchange-oracle/server/package.json index cc725d61fa..3ee2d456da 100644 --- a/packages/apps/fortune/exchange-oracle/server/package.json +++ b/packages/apps/fortune/exchange-oracle/server/package.json @@ -33,7 +33,7 @@ "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^4.0.1", - "@nestjs/common": "^11.1.12", + "@nestjs/common": "^11.1.27", "@nestjs/config": "^4.0.2", "@nestjs/core": "^11.1.12", "@nestjs/passport": "^11.0.5", diff --git a/packages/apps/fortune/recording-oracle/package.json b/packages/apps/fortune/recording-oracle/package.json index aa930343df..8e4aa52d58 100644 --- a/packages/apps/fortune/recording-oracle/package.json +++ b/packages/apps/fortune/recording-oracle/package.json @@ -26,7 +26,7 @@ "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^4.0.1", - "@nestjs/common": "^11.1.12", + "@nestjs/common": "^11.1.27", "@nestjs/config": "^4.0.2", "@nestjs/core": "^11.1.12", "@nestjs/platform-express": "^11.1.12", diff --git a/packages/apps/human-app/frontend/package.json b/packages/apps/human-app/frontend/package.json index 79b2befa5c..2c41645461 100644 --- a/packages/apps/human-app/frontend/package.json +++ b/packages/apps/human-app/frontend/package.json @@ -25,10 +25,9 @@ "@hcaptcha/react-hcaptcha": "^1.14.0", "@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/x-date-pickers": "^9.2.0", + "@mui/icons-material": "^9.2.0", + "@mui/material": "^9.2.0", + "@mui/x-date-pickers": "^9.9.0", "@reown/appkit": "^1.8.20", "@reown/appkit-adapter-wagmi": "^1.8.20", "@synaps-io/verify-sdk": "^4.0.45", @@ -38,9 +37,8 @@ "ethers": "^6.17.0", "i18next": "^25.8.0", "jwt-decode": "^4.0.0", - "lodash": "^4.17.21", + "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", @@ -50,7 +48,7 @@ "react-i18next": "^15.1.0", "react-imask": "^7.4.0", "react-number-format": "^5.4.5", - "react-router-dom": "^7.18.0", + "react-router-dom": "^7.18.1", "serve": "^14.2.6", "viem": "^2.52.2", "vite-plugin-svgr": "^4.2.0", @@ -62,8 +60,7 @@ "@eslint/js": "^10.0.1", "@tanstack/eslint-plugin-query": "^5.60.1", "@tanstack/react-query-devtools": "^5.59.16", - "@types/lodash": "^4.17.12", - "@types/mui-image": "^1.0.5", + "@types/lodash": "^4.17.24", "@types/node": "^22.10.5", "@types/prop-types": "^15", "@types/react": "^19.2.15", @@ -80,7 +77,7 @@ "husky": "^9.1.6", "jsdom": "^29.1.1", "prettier": "^3.8.1", - "typescript": "^5.6.3", + "typescript": "^6.0.2", "typescript-eslint": "^8.57.0", "vite": "^6.2.4", "vitest": "^4.0.18" diff --git a/packages/apps/human-app/frontend/src/main.tsx b/packages/apps/human-app/frontend/src/main.tsx index bf9aaa190f..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'; @@ -23,7 +21,6 @@ import { HomePageStateProvider } from '@/shared/contexts/homepage-state'; import { NotificationProvider } from '@/shared/providers/notifications-provider'; import { ModalProvider } from './shared/contexts/modal-context'; import { GlobalModal } from './shared/components/ui/modal/global-modal'; -import { UiConfigProvider } from './shared/providers/ui-config-provider'; const root = document.getElementById('root'); if (!root) throw Error('root element is undefined'); @@ -40,30 +37,25 @@ createRoot(root).render( - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx b/packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx index 13b9001fed..2b2478b5f4 100644 --- a/packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx +++ b/packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx @@ -11,7 +11,6 @@ const userDataSchema = z.object({ user_id: z.number(), reputation_network: z.string(), exp: z.number(), - is_stake_eligible: z.boolean(), }); export type UserData = z.infer; 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-up.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-up.tsx index 7ec945c879..488b5d88d5 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-up.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-up.tsx @@ -1,35 +1,38 @@ -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 OperatorSignUp() { const { colorPalette, isDarkMode } = useColorMode(); const { t } = useTranslation(); - const isMobile = useIsMobile('lg'); 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/hooks/use-exchange-api-keys.ts b/packages/apps/human-app/frontend/src/modules/worker/hooks/use-exchange-api-keys.ts deleted file mode 100644 index c958791ca7..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/hooks/use-exchange-api-keys.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { - deleteExchangeApiKeys, - enrollExchangeApiKeys, - getExchangeApiKeys, - getSupportedExchanges, -} from '../services/exchangeApiKeys.service'; - -function useGetSupportedExchanges() { - return useQuery({ - queryKey: ['supported-exchanges'], - queryFn: () => getSupportedExchanges(), - }); -} - -function useGetExchangeApiKeys() { - return useQuery({ - queryKey: ['exchange-api-keys'], - queryFn: () => getExchangeApiKeys(), - }); -} - -function useEnrollExchangeApiKeys() { - const queryClient = useQueryClient(); - - return useMutation({ - mutationKey: ['enroll-exchange-api-keys'], - mutationFn: (data: { - exchange: string; - apiKey: string; - secretKey: string; - }) => enrollExchangeApiKeys(data), - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['exchange-api-keys'] }); - queryClient.invalidateQueries({ queryKey: ['staking-summary'] }); - }, - }); -} - -function useDeleteExchangeApiKeys() { - const queryClient = useQueryClient(); - - return useMutation({ - mutationKey: ['delete-exchange-api-keys'], - mutationFn: () => deleteExchangeApiKeys(), - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['exchange-api-keys'] }); - queryClient.invalidateQueries({ queryKey: ['staking-summary'] }); - }, - }); -} - -export { - useGetSupportedExchanges, - useDeleteExchangeApiKeys, - useGetExchangeApiKeys, - useEnrollExchangeApiKeys, -}; diff --git a/packages/apps/human-app/frontend/src/modules/worker/hooks/use-staking.ts b/packages/apps/human-app/frontend/src/modules/worker/hooks/use-staking.ts deleted file mode 100644 index 1556c072d6..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/hooks/use-staking.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; -import { getStakingSummary } from '../services/staking.service'; - -function useGetStakingSummary() { - return useQuery({ - queryKey: ['staking-summary'], - queryFn: () => getStakingSummary(), - }); -} - -export { useGetStakingSummary }; 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/available-jobs/hooks/use-available-jobs-filter-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/hooks/use-available-jobs-filter-modal.tsx index 6ce55c5c48..f90e919961 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/hooks/use-available-jobs-filter-modal.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/available-jobs/hooks/use-available-jobs-filter-modal.tsx @@ -1,17 +1,17 @@ import { useModal } from '@/shared/contexts/modal-context'; -import { useUiConfig } from '@/shared/providers/ui-config-provider'; +import { useGetUiConfig } from '@/shared/hooks'; import { AvailableJobsFilterModal } from '../available-jobs-filter-modal'; export function useAvailableJobsFilterModal() { const { openModal, closeModal } = useModal(); - const { uiConfig } = useUiConfig(); + const { data: uiConfigData } = useGetUiConfig(); return { openModal: () => { openModal({ content: ( ), 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 deleted file mode 100644 index a6fa175b58..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/api-key-data.tsx +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100644 index 6a75d44423..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/delete-api-key-modal.tsx +++ /dev/null @@ -1,118 +0,0 @@ -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 deleted file mode 100644 index 9141eb9b02..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/edit-api-key-modal.tsx +++ /dev/null @@ -1,280 +0,0 @@ -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/index.ts b/packages/apps/human-app/frontend/src/modules/worker/profile/components/index.ts index 7df62f04b8..7b2eadb361 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/index.ts +++ b/packages/apps/human-app/frontend/src/modules/worker/profile/components/index.ts @@ -2,9 +2,3 @@ export * from './wallet-connect-done'; export * from './profile-data'; export * from './identity-verification-control'; export * from './wallet-connection-control'; -export * from './staking-info'; -export * from './api-key-data'; -export * from './custom-text-field'; -export * from './add-api-key-modal'; -export * from './edit-api-key-modal'; -export * from './delete-api-key-modal'; 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 deleted file mode 100644 index 889d26aaae..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx +++ /dev/null @@ -1,225 +0,0 @@ -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/hooks/use-api-key-modals.tsx b/packages/apps/human-app/frontend/src/modules/worker/profile/hooks/use-api-key-modals.tsx deleted file mode 100644 index 5d7db03586..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/profile/hooks/use-api-key-modals.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { useModal } from '@/shared/contexts/modal-context'; -import { - AddApiKeyModal, - EditApiKeyModal, - DeleteApiKeyModal, -} from '../components'; - -export function useAddApiKeyModal() { - const { openModal, closeModal, setDisableClose } = useModal(); - - return { - openModal: () => - openModal({ - content: ( - - ), - }), - }; -} - -export function useEditApiKeyModal() { - const { openModal, closeModal, setDisableClose } = useModal(); - - return { - openModal: (exchangeName: string) => - openModal({ - content: ( - - ), - }), - }; -} - -export function useDeleteApiKeyModal() { - const { openModal, closeModal, setDisableClose } = useModal(); - - return { - openModal: () => - openModal({ - content: ( - - ), - }), - }; -} 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 3fa42e64b9..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 @@ -12,10 +12,7 @@ import { ProfileData, IdentityVerificationControl, WalletConnectionControl, - StakingInfo, } from '../components'; -import { PageCardLoader } from '@/shared/components/ui/page-card/page-card-loader'; -import { useUiConfig } from '@/shared/providers/ui-config-provider'; export function WorkerProfilePage() { const { user } = useAuthenticatedUser(); @@ -23,7 +20,6 @@ export function WorkerProfilePage() { const { isConnected, initializing, web3ProviderMutation } = useWalletConnect(); const { showNotification } = useNotification(); - const { uiConfig, isUiConfigLoading } = useUiConfig(); useEffect(() => { if (initializing) return; @@ -50,10 +46,6 @@ export function WorkerProfilePage() { showNotification, ]); - if (isUiConfigLoading) { - return ; - } - return ( - + - {!!user.wallet_address && uiConfig?.stakingEligibilityEnabled && ( - - )} ); diff --git a/packages/apps/human-app/frontend/src/modules/worker/providers/require-stake.tsx b/packages/apps/human-app/frontend/src/modules/worker/providers/require-stake.tsx deleted file mode 100644 index 83802a5467..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/providers/require-stake.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import type { ReactNode } from 'react'; -import { useAuthenticatedUser } from '@/modules/auth/hooks/use-authenticated-user'; -import { routerPaths } from '@/router/router-paths'; -import { protectedRoutes } from '@/router/routes'; -import { useUiConfig } from '@/shared/providers/ui-config-provider'; -import { Navigate, useLocation, matchPath } from 'react-router-dom'; - -const stakeProtectedPaths = protectedRoutes - .map((route) => route.routerProps.path) - .filter((path) => path !== routerPaths.worker.profile); - -export function RequireStake({ children }: Readonly<{ children: ReactNode }>) { - const { user } = useAuthenticatedUser(); - const location = useLocation(); - const { uiConfig } = useUiConfig(); - - const isStakeProtectedRoute = stakeProtectedPaths.some( - (path) => path && matchPath(path, location.pathname) - ); - - if ( - uiConfig?.stakingEligibilityEnabled && - !user?.is_stake_eligible && - isStakeProtectedRoute - ) { - return ; - } - - return children; -} 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/modules/worker/services/exchangeApiKeys.service.ts b/packages/apps/human-app/frontend/src/modules/worker/services/exchangeApiKeys.service.ts deleted file mode 100644 index 41db9404e2..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/services/exchangeApiKeys.service.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { authorizedHumanAppApiClient } from '@/api'; - -interface ExchangeApiKey { - api_key: string; - exchange_name: string; -} - -interface Exchange { - name: string; - display_name: string; -} - -async function getSupportedExchanges(): Promise { - const response = await authorizedHumanAppApiClient.get( - '/exchange-api-keys/supported-exchanges' - ); - return response || []; -} - -async function getExchangeApiKeys(): Promise { - const response = - await authorizedHumanAppApiClient.get('/exchange-api-keys'); - return response || null; -} - -async function enrollExchangeApiKeys(data: { - exchange: string; - apiKey: string; - secretKey: string; -}): Promise { - const { exchange, ...body } = data; - await authorizedHumanAppApiClient.post(`/exchange-api-keys/${exchange}`, { - body, - }); -} - -async function deleteExchangeApiKeys(): Promise { - await authorizedHumanAppApiClient.delete('/exchange-api-keys'); -} - -export { - enrollExchangeApiKeys, - getExchangeApiKeys, - deleteExchangeApiKeys, - getSupportedExchanges, -}; diff --git a/packages/apps/human-app/frontend/src/modules/worker/services/staking.service.ts b/packages/apps/human-app/frontend/src/modules/worker/services/staking.service.ts deleted file mode 100644 index d4a38a65b3..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/services/staking.service.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { authorizedHumanAppApiClient } from '@/api'; - -interface StakeSummary { - exchange_stake: string; - exchange_error?: string; - on_chain_stake: string; - on_chain_error?: string; -} - -async function getStakingSummary(): Promise { - const response = - await authorizedHumanAppApiClient.get('/staking/summary'); - return response || null; -} - -export { getStakingSummary }; diff --git a/packages/apps/human-app/frontend/src/router/components/drawer-menu-items/drawer-menu-items-worker.tsx b/packages/apps/human-app/frontend/src/router/components/drawer-menu-items/drawer-menu-items-worker.tsx index 5c39359e16..427bba124b 100644 --- a/packages/apps/human-app/frontend/src/router/components/drawer-menu-items/drawer-menu-items-worker.tsx +++ b/packages/apps/human-app/frontend/src/router/components/drawer-menu-items/drawer-menu-items-worker.tsx @@ -9,21 +9,14 @@ import type { UserData } from '@/modules/auth/context/auth-context'; import { routerPaths } from '@/router/router-paths'; import { KycStatus } from '@/modules/worker/profile/types'; import { type MenuItem } from '../layout/protected'; -import { UiConfig } from '@/shared/services/ui-config.service'; -export const workerDrawerTopMenuItems = ( - user: UserData | null, - uiConfig: UiConfig | undefined -): MenuItem[] => { +export const workerDrawerTopMenuItems = (user: UserData | null): MenuItem[] => { return [ { label: t('components.DrawerNavigation.jobs'), icon: , link: routerPaths.worker.jobsDiscovery, - disabled: - !user?.wallet_address || - (uiConfig?.stakingEligibilityEnabled && !user?.is_stake_eligible) || - user.kyc_status !== KycStatus.APPROVED, + disabled: !user?.wallet_address || user.kyc_status !== KycStatus.APPROVED, }, ]; }; 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 && } - - - - + + - - + +