diff --git a/packages/apps/human-app/frontend/src/api/auth-service.ts b/packages/apps/human-app/frontend/src/api/auth-service.ts index f54a1a49c5..967ca6c662 100644 --- a/packages/apps/human-app/frontend/src/api/auth-service.ts +++ b/packages/apps/human-app/frontend/src/api/auth-service.ts @@ -1,5 +1,5 @@ import { jwtDecode } from 'jwt-decode'; -import { type SignInDto } from '@/modules/signin/worker/schemas'; +import { type SignInDto } from '@/modules/signin/schemas'; import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; import { type AuthTokensSuccessResponse, diff --git a/packages/apps/human-app/frontend/src/api/authorized-http-api-client.ts b/packages/apps/human-app/frontend/src/api/authorized-http-api-client.ts index 92a427d161..4907c45090 100644 --- a/packages/apps/human-app/frontend/src/api/authorized-http-api-client.ts +++ b/packages/apps/human-app/frontend/src/api/authorized-http-api-client.ts @@ -6,7 +6,7 @@ import { } from './http-api-client'; import { AuthService, type AuthProvider } from './auth-service'; -export class AuthorizedHttpApiClient extends HttpApiClient { +class AuthorizedHttpApiClient extends HttpApiClient { constructor( baseUrl: string, private readonly authProvider: AuthProvider diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/sign-in-section.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/sign-in-section.tsx index 7777bf8002..dc39b438bb 100644 --- a/packages/apps/human-app/frontend/src/modules/homepage/components/sign-in-section.tsx +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/sign-in-section.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { Paper, Button } from '@mui/material'; +import { Paper, Button, Typography } from '@mui/material'; import { routerPaths } from '@/router/router-paths'; @@ -21,7 +21,7 @@ export function SignInSection() { gap: 2, }} > - + */} + + {t('homepage.signUpClosed')} + ); } 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/components/sign-in-form.tsx similarity index 82% rename from packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx rename to packages/apps/human-app/frontend/src/modules/signin/components/sign-in-form.tsx index 6e996acc33..3f6621465f 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in-form.tsx +++ b/packages/apps/human-app/frontend/src/modules/signin/components/sign-in-form.tsx @@ -1,6 +1,6 @@ import { type SubmitEvent } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -import { Box, Divider, Grid, Link as MuiLink, Typography } from '@mui/material'; +import { Box, Grid, Link as MuiLink } from '@mui/material'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; @@ -11,7 +11,7 @@ import { Password } from '@/shared/components/data-entry/password'; import { useResetMutationErrors } from '@/shared/hooks/use-reset-mutation-errors'; import { HCaptchaForm } from '@/shared/components/hcaptcha'; import { routerPaths } from '@/router/router-paths'; -import { type SignInDto, signInDtoSchema } from './schemas'; +import { type SignInDto, signInDtoSchema } from '../schemas'; interface SignInFormProps { onSubmit: (data: SignInDto) => void; @@ -47,14 +47,10 @@ export function SignInForm({
- + @@ -67,7 +63,7 @@ export function SignInForm({ textDecoration: 'underline', }} > - {t('worker.signInForm.forgotPassword')} + {t('signInForm.forgotPassword')} @@ -78,9 +74,9 @@ export function SignInForm({ fullWidth loading={isLoading} > - {t('worker.signInForm.submitBtn')} + {t('signInForm.submitBtn')} - + {/* - {t('worker.signInForm.or')} + {t('signInForm.or')} - {t('worker.signInForm.dontHaveAccount')} + {t('signInForm.dontHaveAccount')} {' '} - {t('worker.signInForm.signUp')} + {t('signInForm.signUp')} - + */}
diff --git a/packages/apps/human-app/frontend/src/modules/signin/hooks/index.ts b/packages/apps/human-app/frontend/src/modules/signin/hooks/index.ts deleted file mode 100644 index cda829b154..0000000000 --- a/packages/apps/human-app/frontend/src/modules/signin/hooks/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './use-start-idv'; -export * from './use-start-idv-mutation'; -export * from './use-register-address'; -export * from './use-register-address-notifications'; diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in-mutation.ts b/packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in-mutation.ts similarity index 92% rename from packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in-mutation.ts rename to packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in-mutation.ts index cf75008640..ee2ea03125 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in-mutation.ts +++ b/packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in-mutation.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query'; import { env } from '@/shared/env'; import { AuthService, HttpApiClient } from '@/api'; import { useAuth } from '@/modules/auth/hooks/use-auth'; -import { type SignInDto } from './schemas'; +import { type SignInDto } from '../schemas'; function signInMutationFn(data: SignInDto) { const httpClient = new HttpApiClient(env.VITE_API_URL); diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in.tsx b/packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in.tsx similarity index 94% rename from packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in.tsx rename to packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in.tsx index 477abd65c1..16698fbed9 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/use-sign-in.tsx +++ b/packages/apps/human-app/frontend/src/modules/signin/hooks/use-sign-in.tsx @@ -1,7 +1,8 @@ import { useEffect } from 'react'; + import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; import { useSignInMutation } from './use-sign-in-mutation'; -import { type SignInDto } from './schemas'; +import { type SignInDto } from '../schemas'; export function useSignIn() { const { diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/schemas.ts b/packages/apps/human-app/frontend/src/modules/signin/schemas.ts similarity index 100% rename from packages/apps/human-app/frontend/src/modules/signin/worker/schemas.ts rename to packages/apps/human-app/frontend/src/modules/signin/schemas.ts diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in.page.tsx b/packages/apps/human-app/frontend/src/modules/signin/sign-in.page.tsx similarity index 95% rename from packages/apps/human-app/frontend/src/modules/signin/worker/sign-in.page.tsx rename to packages/apps/human-app/frontend/src/modules/signin/sign-in.page.tsx index ca4c557482..179db6ec7e 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/sign-in.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/signin/sign-in.page.tsx @@ -5,8 +5,8 @@ import { Box, Grid, Typography } from '@mui/material'; import { getErrorMessageForError } from '@/shared/errors'; import { ApiClientError } from '@/api'; -import { useSignIn } from './use-sign-in'; -import { SignInForm } from './sign-in-form'; +import { useSignIn } from './hooks/use-sign-in'; +import { SignInForm } from './components/sign-in-form'; import signInImage from '@/assets/background-images/signin-background.png'; import { TopNotificationType, @@ -23,7 +23,7 @@ function formattedSignInErrorMessage( unknownError: unknown ): string | undefined { if (unknownError instanceof ApiClientError && unknownError.status === 401) { - return t('worker.signInForm.errors.invalidCredentials'); + return t('signInForm.errors.invalidCredentials'); } } @@ -134,7 +134,7 @@ export function SignInPage() { variant="h4" sx={{ color: 'text.auxiliary100' }} > - {t('worker.signInForm.title')} + {t('signInForm.title')} ) => { + const handleSubmit = (event: SubmitEvent) => { void methods.handleSubmit(signUp)(event); }; @@ -106,22 +106,19 @@ export function SignUpPage() { variant="h4" sx={{ color: 'text.auxiliary100' }} > - {t('worker.signUpForm.title')} + {t('signUpForm.title')}
- + ), }} - i18nKey="worker.signUpForm.termsOfServiceAndPrivacyPolicy" + i18nKey="signUpForm.termsOfServiceAndPrivacyPolicy" /> @@ -161,7 +158,7 @@ export function SignUpPage() { fullWidth loading={isLoading} > - {t('worker.signUpForm.submitBtn')} + {t('signUpForm.submitBtn')} @@ -176,7 +173,7 @@ export function SignUpPage() { fontWeight: 700, }} > - {t('worker.signUpForm.or')} + {t('signUpForm.or')} - {t('worker.signUpForm.alreadyHaveAccount')} + {t('signUpForm.alreadyHaveAccount')} {' '} - {t('worker.signUpForm.signIn')} + {t('signUpForm.signIn')} diff --git a/packages/apps/human-app/frontend/src/modules/signup/worker/index.ts b/packages/apps/human-app/frontend/src/modules/signup/worker/index.ts deleted file mode 100644 index 3c0e3dddf5..0000000000 --- a/packages/apps/human-app/frontend/src/modules/signup/worker/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './views/sign-up-worker.page'; diff --git a/packages/apps/human-app/frontend/src/modules/smart-contracts/chains.ts b/packages/apps/human-app/frontend/src/modules/smart-contracts/chains.ts index 7666fcd23d..8f79e50d7e 100644 --- a/packages/apps/human-app/frontend/src/modules/smart-contracts/chains.ts +++ b/packages/apps/human-app/frontend/src/modules/smart-contracts/chains.ts @@ -5,14 +5,13 @@ // function import { ChainId } from '@human-protocol/sdk/src/enums'; import { NETWORKS } from '@human-protocol/sdk/src/constants'; -import { env } from '@/shared/env'; import { MainnetContracts, TestnetContracts, type ContractsAddresses, } from '@/modules/smart-contracts/contracts'; -export interface Chain { +interface Chain { explorerUrl: string; name: string; chainId: number; @@ -23,22 +22,22 @@ export type ChainWithAddresses = Chain & { addresses: ContractsAddresses; }; -export const TestnetChainsIds = [ +const TestnetChainsIds = [ ChainId.POLYGON_AMOY, ChainId.SEPOLIA, ChainId.BSC_TESTNET, ChainId.LOCALHOST, ] as const; -export const MainnetChainsIds = [ +const MainnetChainsIds = [ ChainId.POLYGON, ChainId.MAINNET, ChainId.BSC_MAINNET, ChainId.ALL, ] as const; -export type TestnetNarrow = Exclude; -export type MainnetNarrow = Exclude; +type TestnetNarrow = Exclude; +type MainnetNarrow = Exclude; export const TestnetChains: readonly ChainWithAddresses[] = [ { @@ -87,28 +86,3 @@ function getChainConfigsForChainIds( } return result; } - -const handleFilterChains = ( - chainsArr: ChainWithAddresses[], - chainIdsEnabled: number[] -) => { - return chainsArr.filter((chain) => - chainIdsEnabled.some((el) => el === chain.chainId) - ); -}; - -export const getTestnetChainsEnabled = (chainIdsEnabled: number[]) => { - return handleFilterChains(AllTestnetsChains, chainIdsEnabled); -}; - -export const getMainnetChainsEnabled = (chainIdsEnabled: number[]) => { - return handleFilterChains(AllMainnetChains, chainIdsEnabled); -}; - -export const getEnabledChainsByUiConfig = ( - chainIdsEnabled: number[] -): Chain[] => - (env.VITE_NETWORK === 'mainnet' - ? getMainnetChainsEnabled(chainIdsEnabled) - : getTestnetChainsEnabled(chainIdsEnabled) - ).map(({ addresses: _, ...chainData }) => chainData); diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/identity-verification-control.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/components/identity-verification-control.tsx similarity index 92% rename from packages/apps/human-app/frontend/src/modules/signin/worker/identity-verification-control.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/components/identity-verification-control.tsx index 6647abf5be..6558d1eafb 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/identity-verification-control.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/components/identity-verification-control.tsx @@ -3,7 +3,7 @@ import { useTranslation, Trans } from 'react-i18next'; import { Box, keyframes, Link, Stack, Typography } from '@mui/material'; import { jwtDecode } from 'jwt-decode'; -import { useStartIdv } from '../hooks'; +import { useStartIdv } from '../hooks/use-start-idv'; import { KycStatus } from '@/shared/types/entity.type'; import { env } from '@/shared/env'; import { HourglassIcon, VeriffIcon } from '@/shared/components/ui/icons'; @@ -113,7 +113,7 @@ export function IdentityVerificationControl({ components={{ 1: , }} - i18nKey="worker.profile.verificationDeclined" + i18nKey="verifyUser.verificationDeclined" /> ); @@ -135,7 +135,7 @@ export function IdentityVerificationControl({ }} > - {t('worker.profile.verificationOpenedInNewTab')} + {t('verifyUser.verificationOpenedInNewTab')} - {t('worker.profile.completeYourVerification')} + {t('verifyUser.completeYourVerification')} - {t('worker.profile.waitingForVerification')} + {t('verifyUser.waitingForVerification')} @@ -175,7 +175,7 @@ export function IdentityVerificationControl({ loading={isRefreshingAccessToken} onClick={handleCheckVerificationStatus} > - {t('worker.profile.checkVerificationStatus')} + {t('verifyUser.checkVerificationStatus')} @@ -188,7 +188,7 @@ export function IdentityVerificationControl({ variant="body4" sx={{ color: 'text.auxiliary200', mb: { xs: 3, md: 5 } }} > - {t('worker.profile.veriffCopy')} + {t('verifyUser.veriffCopy')} - {t('worker.profile.poweredBy')} + {t('verifyUser.poweredBy')} @@ -214,7 +214,7 @@ export function IdentityVerificationControl({ loading={idvStartIsPending} onClick={startIdv} > - {t('worker.profile.completeIdentityVerification')} + {t('verifyUser.completeIdentityVerification')} ); diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/register-address-btn.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/components/register-address-btn.tsx similarity index 93% rename from packages/apps/human-app/frontend/src/modules/signin/worker/register-address-btn.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/components/register-address-btn.tsx index a644e09cec..2479ece814 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/register-address-btn.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/components/register-address-btn.tsx @@ -19,7 +19,7 @@ export function RegisterAddressBtn() { loading={isPending} onClick={mutate.bind(undefined, undefined)} > - {t('worker.profile.registerAddress')} + {t('verifyUser.registerAddress')} ); } diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/verification-flow.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/components/verification-flow.tsx similarity index 92% rename from packages/apps/human-app/frontend/src/modules/signin/worker/verification-flow.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/components/verification-flow.tsx index 2132065914..29fc8b94ce 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/verification-flow.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/components/verification-flow.tsx @@ -35,9 +35,7 @@ export function VerificationFlow({ const kycStatus = user?.kyc_status as KycStatus; - const label = kycStatus - ? t(`worker.profile.idvStatusValues.${kycStatus}`) - : ''; + const label = kycStatus ? t(`verifyUser.idvStatusValues.${kycStatus}`) : ''; const isKycDeclined = kycStatus === KycStatus.DECLINED; const isKycStarted = kycStatus !== KycStatus.NONE; @@ -51,7 +49,7 @@ export function VerificationFlow({ variant="h4" sx={{ color: 'text.auxiliary100', mb: { xs: 2.5, md: 5 } }} > - {t('worker.profile.beforeWeGetStarted')} + {t('verifyUser.beforeWeGetStarted')} - {t('worker.profile.identityVerification')} + {t('verifyUser.identityVerification')} {isKycStarted && label && ( - {t('worker.profile.connectYourWallet')} + {t('verifyUser.connectYourWallet')} diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/wallet-connection-control.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/components/wallet-connection-control.tsx similarity index 83% rename from packages/apps/human-app/frontend/src/modules/signin/worker/wallet-connection-control.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/components/wallet-connection-control.tsx index af2b13f2ad..7affcb96d1 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/wallet-connection-control.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/components/wallet-connection-control.tsx @@ -1,8 +1,9 @@ import { useTranslation } from 'react-i18next'; import { Stack, Typography } from '@mui/material'; + +import { RegisterAddressBtn } from './register-address-btn'; import { Button } from '@/shared/components/ui/button'; import { useWalletConnect } from '@/shared/contexts/wallet-connect'; -import { RegisterAddressBtn } from '../worker/register-address-btn'; import { useAuth } from '@/modules/auth/hooks/use-auth'; export function WalletConnectionControl() { @@ -17,7 +18,7 @@ export function WalletConnectionControl() { - {t('worker.profile.walletAddressMessage')} + {t('verifyUser.walletAddressMessage')} ); @@ -30,7 +31,7 @@ export function WalletConnectionControl() { fullWidth onClick={() => void openModal()} > - {t('components.wallet.connectBtn.connect')} + {t('verifyUser.connectWallet')} ); } diff --git a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address-notifications.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address-notifications.tsx similarity index 92% rename from packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address-notifications.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address-notifications.tsx index 506e6e87c0..e1ba19f51a 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address-notifications.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address-notifications.tsx @@ -12,7 +12,7 @@ export function useRegisterAddressNotifications() { const onSuccess = () => { showNotification({ type: TopNotificationType.SUCCESS, - message: t('worker.registerAddress.success'), + message: t('verifyUser.registerAddressSuccess'), }); }; const onError = (error: ResponseError) => { diff --git a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address.ts b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address.ts similarity index 93% rename from packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address.ts rename to packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address.ts index 0dca7cb04e..569d4295b6 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-register-address.ts +++ b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-register-address.ts @@ -1,11 +1,12 @@ import { useMutation } from '@tanstack/react-query'; import { t } from 'i18next'; + import { useAccessTokenRefresh } from '@/api/hooks/use-access-token-refresh'; import type { ResponseError } from '@/shared/types/global.type'; import { useWalletConnect } from '@/shared/contexts/wallet-connect'; import { usePrepareSignature } from '@/shared/hooks'; import { PrepareSignatureType } from '@/shared/services/signature.service'; -import * as profileService from '../services/profile.service'; +import * as verifyUserService from '../services/verify-user.service'; import { useAuth } from '@/modules/auth/hooks/use-auth'; interface RegisterAddressCallbacks { @@ -36,7 +37,7 @@ function useRegisterAddressMutation(callbacks: RegisterAddressCallbacks) { // wallet address is part of the JWT payload // so we need to refresh the token after the address is registered - await profileService.registerAddress({ address, chainId, signature }); + await verifyUserService.registerAddress({ address, chainId, signature }); await refreshAccessTokenAsync({}); updateUserData({ wallet_address: address, diff --git a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-start-idv-mutation.ts b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-start-idv-mutation.ts similarity index 66% rename from packages/apps/human-app/frontend/src/modules/signin/hooks/use-start-idv-mutation.ts rename to packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-start-idv-mutation.ts index c64cb15770..433d2596b0 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-start-idv-mutation.ts +++ b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-start-idv-mutation.ts @@ -1,12 +1,13 @@ import { useMutation } from '@tanstack/react-query'; -import * as profileService from '../services/profile.service'; + +import * as verifyUserService from '../services/verify-user.service'; import { useAuth } from '@/modules/auth/hooks/use-auth'; export function useIdvStartMutation() { const { user } = useAuth(); return useMutation({ - mutationFn: async () => profileService.startIdv(), + mutationFn: async () => verifyUserService.startIdv(), mutationKey: ['idvStart', user?.email], }); } diff --git a/packages/apps/human-app/frontend/src/modules/signin/hooks/use-start-idv.ts b/packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-start-idv.ts similarity index 100% rename from packages/apps/human-app/frontend/src/modules/signin/hooks/use-start-idv.ts rename to packages/apps/human-app/frontend/src/modules/verify-user/hooks/use-start-idv.ts diff --git a/packages/apps/human-app/frontend/src/modules/signin/services/profile.service.ts b/packages/apps/human-app/frontend/src/modules/verify-user/services/verify-user.service.ts similarity index 100% rename from packages/apps/human-app/frontend/src/modules/signin/services/profile.service.ts rename to packages/apps/human-app/frontend/src/modules/verify-user/services/verify-user.service.ts diff --git a/packages/apps/human-app/frontend/src/modules/signin/worker/verify-user.page.tsx b/packages/apps/human-app/frontend/src/modules/verify-user/verify-user.page.tsx similarity index 96% rename from packages/apps/human-app/frontend/src/modules/signin/worker/verify-user.page.tsx rename to packages/apps/human-app/frontend/src/modules/verify-user/verify-user.page.tsx index 6fee0f4938..debb6a8b5c 100644 --- a/packages/apps/human-app/frontend/src/modules/signin/worker/verify-user.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/verify-user/verify-user.page.tsx @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { Navigate, useNavigate } from 'react-router-dom'; import { Stack } from '@mui/material'; -import { VerificationFlow } from './verification-flow'; +import { VerificationFlow } from './components/verification-flow'; import { useAuth } from '@/modules/auth/hooks/use-auth'; import { routerPaths } from '@/router/router-paths'; import { KycStatus } from '@/shared/types/entity.type'; diff --git a/packages/apps/human-app/frontend/src/modules/worker/email-verification/components/email-verification-form-container.tsx b/packages/apps/human-app/frontend/src/modules/worker/email-verification/components/email-verification-form-container.tsx index 80a2ccbd75..24dcda7b19 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/email-verification/components/email-verification-form-container.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/email-verification/components/email-verification-form-container.tsx @@ -114,7 +114,7 @@ export function EmailVerificationFormContainer() { }} > {!!user && ( diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/my-jobs/components/mobile/my-jobs-card-mobile.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/my-jobs/components/mobile/my-jobs-card-mobile.tsx index 62e5356d7b..1d835fe187 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/my-jobs/components/mobile/my-jobs-card-mobile.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/my-jobs/components/mobile/my-jobs-card-mobile.tsx @@ -1,3 +1,4 @@ +import { type ReactNode } from 'react'; import { Chip, Paper, Stack, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; @@ -23,8 +24,8 @@ const Row = ({ children, }: { label: string; - icon: React.ReactNode; - children: React.ReactNode; + icon: ReactNode; + children: ReactNode; }) => { return ( , }, - { - path: routerPaths.signUp, - element: , - }, + // { + // path: routerPaths.signUp, + // element: , + // }, { path: routerPaths.emailVerification, element: , diff --git a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/human-currency.tsx b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/human-currency.tsx index 140a41b2d2..5f6efc4e2d 100644 --- a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/human-currency.tsx +++ b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/human-currency.tsx @@ -1,18 +1,12 @@ import { t } from 'i18next'; -import type { ForwardRefExoticComponent, RefAttributes } from 'react'; import { forwardRef } from 'react'; -import type { NumericFormatProps } from 'react-number-format'; -import { NumericFormat } from 'react-number-format'; +import { NumericFormat, type NumericFormatProps } from 'react-number-format'; interface CustomProps { onChange: (event: { target: { name: string; value: string } }) => void; name: string; } -export type InputMaskComponent = ForwardRefExoticComponent< - CustomProps & RefAttributes ->; - export const HumanCurrencyInputMask = forwardRef< NumericFormatProps, CustomProps diff --git a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/index.ts b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/index.ts index 675216357f..58cc5d4298 100644 --- a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/index.ts +++ b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/index.ts @@ -4,5 +4,3 @@ import { PercentsInputMask } from '@/shared/components/data-entry/input-masks/pe export type InputMask = | typeof HumanCurrencyInputMask | typeof PercentsInputMask; - -export { HumanCurrencyInputMask, PercentsInputMask }; diff --git a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/percents.tsx b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/percents.tsx index 2985abf67d..6fe8cc1cc0 100644 --- a/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/percents.tsx +++ b/packages/apps/human-app/frontend/src/shared/components/data-entry/input-masks/percents.tsx @@ -1,18 +1,12 @@ import { t } from 'i18next'; -import type { ForwardRefExoticComponent, RefAttributes } from 'react'; import { forwardRef } from 'react'; -import type { NumericFormatProps } from 'react-number-format'; -import { NumericFormat } from 'react-number-format'; +import { NumericFormat, type NumericFormatProps } from 'react-number-format'; interface CustomProps { onChange: (event: { target: { name: string; value: string } }) => void; name: string; } -export type InputMaskComponent = ForwardRefExoticComponent< - CustomProps & RefAttributes ->; - export const PercentsInputMask = forwardRef( function NumericFormatCustom(props, ref) { const { onChange, ...other } = props; diff --git a/packages/apps/human-app/frontend/src/shared/components/data-entry/input.tsx b/packages/apps/human-app/frontend/src/shared/components/data-entry/input.tsx index 49ff1cf5d1..a232c51896 100644 --- a/packages/apps/human-app/frontend/src/shared/components/data-entry/input.tsx +++ b/packages/apps/human-app/frontend/src/shared/components/data-entry/input.tsx @@ -1,3 +1,4 @@ +import { type ReactNode } from 'react'; import { Controller } from 'react-hook-form'; import { type TextFieldProps, TextField, Typography } from '@mui/material'; @@ -8,7 +9,7 @@ export interface InputProps extends OmittedProps { name: string; label?: string; autoComplete?: string; - customError?: React.ReactNode; + customError?: ReactNode; mask?: InputMask; } diff --git a/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha-form.tsx b/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha-form.tsx index e1821ee9f1..acc69b60d5 100644 --- a/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha-form.tsx +++ b/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha-form.tsx @@ -10,7 +10,7 @@ interface HCaptchaFormProps { error?: unknown; } -export function HCaptchaForm({ name, error }: Readonly) { +export function HCaptchaForm({ name, error }: HCaptchaFormProps) { const { setValue, formState } = useFormContext>(); const customCaptchaRef = useRef(null); diff --git a/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha.tsx b/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha.tsx index f548c4c862..8189fb030e 100644 --- a/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha.tsx +++ b/packages/apps/human-app/frontend/src/shared/components/hcaptcha/h-captcha.tsx @@ -1,4 +1,4 @@ -import { forwardRef, useImperativeHandle, useRef } from 'react'; +import { forwardRef, useImperativeHandle, useRef, type Ref } from 'react'; import HCaptcha from '@hcaptcha/react-hcaptcha'; import { env } from '@/shared/env'; @@ -12,7 +12,7 @@ interface CustomHCaptchaProps { function InternalHCaptcha( { onVerify }: CustomHCaptchaProps, - ref: React.Ref + ref: Ref ) { const captchaRef = useRef(null); diff --git a/packages/apps/human-app/frontend/src/shared/contexts/generic-auth-context.tsx b/packages/apps/human-app/frontend/src/shared/contexts/generic-auth-context.tsx index 15b5158301..e2f5955298 100644 --- a/packages/apps/human-app/frontend/src/shared/contexts/generic-auth-context.tsx +++ b/packages/apps/human-app/frontend/src/shared/contexts/generic-auth-context.tsx @@ -1,7 +1,8 @@ -import React, { createContext, useState, useEffect } from 'react'; +import { createContext, useState, useEffect, type ReactNode } from 'react'; import { jwtDecode } from 'jwt-decode'; import { type ZodType } from 'zod'; import { useQueryClient } from '@tanstack/react-query'; + import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; import { type AuthTokensSuccessResponse } from '@/shared/schemas'; import { type UserData } from '@/modules/auth/context/auth-context'; @@ -37,7 +38,7 @@ export function createAuthProvider(config: { AuthenticatedUserContextType | UnauthenticatedUserContextType | null >(null); - function AuthProvider({ children }: Readonly<{ children: React.ReactNode }>) { + function AuthProvider({ children }: { children: ReactNode }) { const queryClient = useQueryClient(); const [authState, setAuthState] = useState<{ user: T | null; diff --git a/packages/apps/human-app/frontend/src/shared/contexts/jwt-expiration-check.tsx b/packages/apps/human-app/frontend/src/shared/contexts/jwt-expiration-check.tsx index 7c4f920abc..e079390ba0 100644 --- a/packages/apps/human-app/frontend/src/shared/contexts/jwt-expiration-check.tsx +++ b/packages/apps/human-app/frontend/src/shared/contexts/jwt-expiration-check.tsx @@ -1,14 +1,10 @@ -import type React from 'react'; -import { useEffect, useRef } from 'react'; +import { useEffect, useRef, type ReactNode } from 'react'; import { useLocation } from 'react-router-dom'; + import { useAccessTokenRefresh } from '@/api/hooks/use-access-token-refresh'; import { useAuth } from '@/modules/auth/hooks/use-auth'; -export function JWTExpirationCheck({ - children, -}: { - children: React.ReactElement; -}) { +export function JWTExpirationCheck({ children }: { children: ReactNode }) { const checksOnProfile = useRef(0); const auth = useAuth(); const location = useLocation(); diff --git a/packages/apps/human-app/frontend/src/shared/contexts/modal-context.tsx b/packages/apps/human-app/frontend/src/shared/contexts/modal-context.tsx index daf1e32eab..e415c802a3 100644 --- a/packages/apps/human-app/frontend/src/shared/contexts/modal-context.tsx +++ b/packages/apps/human-app/frontend/src/shared/contexts/modal-context.tsx @@ -1,4 +1,5 @@ -import React, { +import { + type ReactNode, createContext, useCallback, useContext, @@ -8,7 +9,7 @@ import React, { interface ModalContextType { open: boolean; - content: React.ReactNode; + content: ReactNode; showCloseButton: boolean; disableClose: boolean; openModal: ({ content, showCloseButton }: OpenModalProps) => void; @@ -18,17 +19,15 @@ interface ModalContextType { } interface OpenModalProps { - content: React.ReactNode; + content: ReactNode; showCloseButton?: boolean; } const ModalContext = createContext(undefined); -export function ModalProvider({ - children, -}: Readonly<{ children: React.ReactNode }>) { +export function ModalProvider({ children }: { children: ReactNode }) { const [open, setOpen] = useState(false); - const [content, setContent] = useState(null); + const [content, setContent] = useState(null); const [showCloseButton, setShowCloseButton] = useState(true); const [disableClose, setDisableClose] = useState(false); diff --git a/packages/apps/human-app/frontend/src/shared/contexts/wallet-connect/wallet-connect.tsx b/packages/apps/human-app/frontend/src/shared/contexts/wallet-connect/wallet-connect.tsx index 2f6c27d5e8..bb684e7fb1 100644 --- a/packages/apps/human-app/frontend/src/shared/contexts/wallet-connect/wallet-connect.tsx +++ b/packages/apps/human-app/frontend/src/shared/contexts/wallet-connect/wallet-connect.tsx @@ -1,9 +1,10 @@ -import React, { +import { createContext, useCallback, useEffect, useMemo, useState, + type ReactNode, } from 'react'; import { useAppKit, @@ -15,6 +16,7 @@ import { import { WagmiProvider } from 'wagmi'; import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'; import { polygonAmoy, polygon } from '@reown/appkit/networks'; + import { env } from '@/shared/env'; import { useWeb3Provider } from '@/shared/hooks/use-web3-provider'; import { JsonRpcError } from '@/modules/smart-contracts/json-rpc-error'; @@ -52,7 +54,7 @@ export const WalletConnectContext = createContext< | null >(null); -function AppKitWrapper({ children }: { children: React.ReactNode }) { +function AppKitWrapper({ children }: { children: ReactNode }) { const [initializing, setInitializing] = useState(true); const web3ProviderMutation = useWeb3Provider(); const { open } = useAppKit(); @@ -125,11 +127,7 @@ function AppKitWrapper({ children }: { children: React.ReactNode }) { ); } -export function WalletConnectProvider({ - children, -}: { - children: React.ReactNode; -}) { +export function WalletConnectProvider({ children }: { children: ReactNode }) { return ( {children} diff --git a/packages/apps/human-app/frontend/src/shared/errors/handlers.ts b/packages/apps/human-app/frontend/src/shared/errors/handlers.ts deleted file mode 100644 index 671633a5c5..0000000000 --- a/packages/apps/human-app/frontend/src/shared/errors/handlers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { t } from 'i18next'; -import { JsonRpcError } from '@/modules/smart-contracts/json-rpc-error'; - -export function jsonRpcErrorHandler(unknownError: unknown) { - if (unknownError instanceof JsonRpcError) { - return unknownError.message; - } - return t('errors.unknown'); -} diff --git a/packages/apps/human-app/frontend/src/shared/errors/index.ts b/packages/apps/human-app/frontend/src/shared/errors/index.ts index 20193c41fd..1a749c1e42 100644 --- a/packages/apps/human-app/frontend/src/shared/errors/index.ts +++ b/packages/apps/human-app/frontend/src/shared/errors/index.ts @@ -1,2 +1 @@ export * from './get-error-message-for-error'; -export * from './handlers'; diff --git a/packages/apps/human-app/frontend/src/shared/i18n/en.json b/packages/apps/human-app/frontend/src/shared/i18n/en.json index d9f1bd89fe..5325a4c6ae 100644 --- a/packages/apps/human-app/frontend/src/shared/i18n/en.json +++ b/packages/apps/human-app/frontend/src/shared/i18n/en.json @@ -15,27 +15,18 @@ "required": "Required", "min": "Password should have at least eight characters.", "max": "Max {{count}} characters", - "passwordWeak": "Password should be at least 8 characters long and contain at least one uppercase and one lowercase letter, one number and one special character", "passwordMismatch": "Passwords are not the same", "captcha": "Please complete the captcha", "passwordMissing": "Please enter your password.", "invalidEmail": "Please enter a valid email address.", - "invalidOracleAddress": "Invalid oracle address.", - "publicKeyLengthError": "Public key must be exactly 128 characters long", - "publicKeyHexadecimalStringError": "Public key must be a valid hexadecimal string", - "urlValidationError": "Invalid URL", - "feeValidationError": "Fee value must be an integer between 0 and 100", - "notANumber": "Not a number" + "invalidOracleAddress": "Invalid oracle address." }, "errors": { - "errorWithMessage": "Error with message: {{message}}", "errorWithStatusCode": "Error with status code: {{code}}", "unknown": "An error occurred, please try again.", - "unknownNetwork": "Unknown network", "jsonRpcError": "JSON-RPC error", "unsupportedNetwork": "Network selected in wallet is unsupported.", "unsupportedNetworkWithName": "Network '{{networkName}}' is unsupported.", - "invalidEscrowAddress": "Please enter a valid escrow address.", "noAddress": "No wallet address found.", "cannotSignMessage": "Cannot sign message." }, @@ -64,12 +55,6 @@ "humanProtocol": "HUMAN Protocol", "copyrightNote": "© 2021 HPF. HUMAN Protocol® is a registered trademark" }, - "wallet": { - "connectBtn": { - "disconnect": "Disconnect Wallet", - "connect": "Connect Wallet" - } - }, "pageCardError": { "reload": "Reload", "goHome": "Home Page" @@ -81,46 +66,74 @@ "humanApp": "HUMAN App", "completeJobs": "Complete jobs, earn HMT.", "signUp": "Sign Up", + "signUpClosed": "Registrations are currently closed. We are not accepting new users at this time.", "signIn": "Sign In" }, - "worker": { - "signUpForm": { - "fields": { - "createPassword": "Create Password", - "password": "Create Password", - "confirmPassword": "Confirm Password", - "email": "your@email.com" - }, - "errors": { - "emailTaken": "Email is already taken. Please sign in." - }, - "title": "Sign Up", - "submitBtn": "Sign Up", - "passwordDetailedValidation": "Password must contain at least:", - "termsOfServiceAndPrivacyPolicy": "By clicking Sign Up, you agree to our <1>Terms of Service and that you have read our <2>Privacy Policy", - "or": "Or", - "alreadyHaveAccount": "Already have an account?", - "signIn": "Sign In" + "signUpForm": { + "fields": { + "createPassword": "Create Password", + "password": "Create Password", + "confirmPassword": "Confirm Password", + "email": "your@email.com" }, - "signInForm": { - "fields": { - "password": "Password", - "email": "your@email.com" - }, - "errors": { - "invalidCredentials": "Incorrect email or password!" - }, - "title": "Sign In", - "submitBtn": "Sign In", - "forgotPassword": "Forgot Password?", - "or": "Or", - "dontHaveAccount": "Don't have an account?", - "signUp": "Sign Up" + "errors": { + "emailTaken": "Email is already taken. Please sign in." + }, + "title": "Sign Up", + "submitBtn": "Sign Up", + "passwordDetailedValidation": "Password must contain at least:", + "termsOfServiceAndPrivacyPolicy": "By clicking Sign Up, you agree to our <1>Terms of Service and that you have read our <2>Privacy Policy", + "or": "Or", + "alreadyHaveAccount": "Already have an account?", + "signIn": "Sign In" + }, + "signInForm": { + "fields": { + "password": "Password", + "email": "your@email.com" + }, + "errors": { + "invalidCredentials": "Incorrect email or password!" }, + "title": "Sign In", + "submitBtn": "Sign In", + "forgotPassword": "Forgot Password?", + "or": "Or", + "dontHaveAccount": "Don't have an account?", + "signUp": "Sign Up" + }, + "verifyUser": { + "beforeWeGetStarted": "Before we get started", + "identityVerification": "Identity verification", + "connectYourWallet": "Connect your wallet", + "veriffCopy": "We use Veriff to verify your identity. You'll need: keep your phone & Government ID handy.", + "poweredBy": "Powered by", + "completeIdentityVerification": "Complete Identity Verification", + "verificationOpenedInNewTab": "Verification opened in a new tab", + "completeYourVerification": "Complete your verification there, then return here to continue", + "waitingForVerification": "Waiting for verification...", + "checkVerificationStatus": "Check Verification Status", + "verificationDeclined": "We were unable to verify your identity with the information provided. Please <1>contact support", + "walletAddressMessage": "This address is the wallet address where you will receive payments for completing tasks.", + "connectWallet": "Connect Wallet", + "registerAddress": "Register Address", + "registerAddressSuccess": "The address has been successfully registered.", + "idvStatusValues": { + "none": "Not Started", + "approved": "Completed", + "resubmission_requested": "Resubmission Required", + "declined": "Failed", + "review": "Under Review", + "expired": "Expired", + "abandoned": "Abandoned" + } + }, + "worker": { "verifyEmail": { "title": "Verify Email", "checkYourInbox": "Check your inbox", "backToSignUp": "Back to Sign Up", + "backToSignIn": "Back to Sign In", "btn": "Resend Email", "paragraph1": "We sent a verification link to <1>{{email}}", "paragraph2": "Click the link in the email to verify your account. The link expires in 24 hours.", @@ -178,36 +191,8 @@ "walletAddress": "Wallet address", "resetPassword": "Reset Password", "logout": "Logout", - "beforeWeGetStarted": "Before we get started", - "identityVerification": "Identity verification", - "veriffCopy": "We use Veriff to verify your identity. You'll need: keep your phone & Government ID handy.", - "poweredBy": "Powered by", - "completeIdentityVerification": "Complete Identity Verification", - "verificationOpenedInNewTab": "Verification opened in a new tab", - "completeYourVerification": "Complete your verification there, then return here to continue", - "waitingForVerification": "Waiting for verification...", - "checkVerificationStatus": "Check Verification Status", - "verificationDeclined": "We were unable to verify your identity with the information provided. Please <1>contact support", - "confirmEmail": "Confirm email", - "walletAddressMessage": "This address is the wallet address where you will receive payments for completing tasks.", - "connectYourWallet": "Connect your wallet", - "connectWallet": "Connect Wallet", - "walletConnected": "Connected", - "addKYCInfoOnChain": "Add KYC Info On-chain", - "wrongWalletAddress": "Selected wallet address doesn't match the address assigned to the account.", - "registerAddress": "Register Address", - "emailNotifications": "Email Notifications", "topNotifications": { "completeSteps": "Please set up your profile by completing the steps below." - }, - "idvStatusValues": { - "none": "Not Started", - "approved": "Completed", - "resubmission_requested": "Resubmission Required", - "declined": "Failed", - "review": "Under Review", - "expired": "Expired", - "abandoned": "Abandoned" } }, "oraclesList": { @@ -312,9 +297,6 @@ "solvedSuccess": "HCaptcha solved!", "loadingLiveStatistics": "Loading live statistics" }, - "registerAddress": { - "success": "The address has been successfully registered." - }, "reportAbuse": { "modalHeader": "Report Abuse", "modalParagraph": "Notice something inappropriate or incorrect? Let us know if this task contains harmful, offensive, or misleading content. Your report will be reviewed confidentially.", diff --git a/packages/apps/human-app/frontend/src/shared/services/signature.service.ts b/packages/apps/human-app/frontend/src/shared/services/signature.service.ts index 27dc848e4e..be6d2f919a 100644 --- a/packages/apps/human-app/frontend/src/shared/services/signature.service.ts +++ b/packages/apps/human-app/frontend/src/shared/services/signature.service.ts @@ -27,7 +27,7 @@ const prepareSignatureSuccessSchema = z.object({ nonce: z.unknown(), }); -export type SignatureData = z.infer; +type SignatureData = z.infer; async function prepareSignature(data: PrepareSignatureBody) { try { diff --git a/packages/apps/human-app/frontend/src/shared/services/ui-config.service.ts b/packages/apps/human-app/frontend/src/shared/services/ui-config.service.ts index 0fadf37eaf..4343540456 100644 --- a/packages/apps/human-app/frontend/src/shared/services/ui-config.service.ts +++ b/packages/apps/human-app/frontend/src/shared/services/ui-config.service.ts @@ -9,7 +9,7 @@ const uiConfigSchema = z.object({ chainIdsEnabled: z.array(z.number()), }); -export type UiConfig = z.infer; +type UiConfig = z.infer; async function getUiConfig() { try {