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 c694ab548e..a0c2415e16 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 @@ -1,25 +1,18 @@ -import { Grid, List, ListItemText, Typography } from '@mui/material'; +import { Grid, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; -import { Button } from '@/shared/components/ui/button'; -import { useIsMobile } from '@/shared/hooks/use-is-mobile'; -import { routerPaths } from '@/router/router-paths'; import { PageCard } from '@/shared/components/ui/page-card'; import type { HomePageStageType } from '@/modules/homepage/views/home.page'; -import { useColorMode } from '@/shared/contexts/color-mode'; -import { onlyDarkModeColor } from '@/shared/styles/dark-color-palette'; import { useHomePageState } from '@/shared/contexts/homepage-state'; +import { WorkerSignUp } from './worker-sign-up'; +import { OperatorSignUp } from './operator-sign-up'; interface ChooseSignUpAccountType { setStage: (step: HomePageStageType) => void; } export function ChooseSignUpAccountType() { - const { colorPalette, isDarkMode } = useColorMode(); const { setPageView } = useHomePageState(); const { t } = useTranslation(); - const isMobile = useIsMobile('lg'); - const isMobileMd = useIsMobile('md'); const backToWelcomeStage = () => { setPageView('welcome'); @@ -30,7 +23,6 @@ export function ChooseSignUpAccountType() { backNavigation={backToWelcomeStage} cancelNavigation={backToWelcomeStage} childrenMaxWidth="876px" - showCancelButton={isMobileMd} maxContentWidth="748px" title={{t('homepage.welcome')} 👋} > @@ -38,150 +30,8 @@ export function ChooseSignUpAccountType() { {t('homepage.howWillUse')} - - - - - {t('homepage.iWantToEarn')} - - - - - - - - - {t('homepage.signUpToComplete')} - - - - - - - - {t('homepage.joinAsOperator')} - - - - - - - - - {t('homepage.signAsOperator')} - - - + + ); diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/index.ts b/packages/apps/human-app/frontend/src/modules/homepage/components/index.ts new file mode 100644 index 0000000000..c8bab39a3b --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/index.ts @@ -0,0 +1,3 @@ +export * from './home-container'; +export * from './welcome'; +export * from './choose-sign-up-account-type'; diff --git a/packages/apps/human-app/frontend/src/modules/homepage/hooks/use-operator-signin.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx similarity index 100% rename from packages/apps/human-app/frontend/src/modules/homepage/hooks/use-operator-signin.tsx rename to packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-in.tsx 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 new file mode 100644 index 0000000000..7ec945c879 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/operator-sign-up.tsx @@ -0,0 +1,85 @@ +import { Grid, Typography, List, ListItemText, Button } 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')} + + + + + + + + + {t('homepage.signAsOperator')} + + + + ); +} 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 5c844d81f0..23ad2f1c66 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 @@ -9,11 +9,11 @@ import { } from '@/shared/components/ui/icons'; import { Button } from '@/shared/components/ui/button'; import { useIsMobile } from '@/shared/hooks/use-is-mobile'; -import { OperatorSignIn } from '@/modules/homepage/hooks/use-operator-signin'; -import { WorkerSignIn } from '@/modules/homepage/components/worker-signin'; +import { WorkerSignIn } from '@/modules/homepage/components/worker-sign-in'; import { useColorMode } from '@/shared/contexts/color-mode'; import { useHomePageState } from '@/shared/contexts/homepage-state'; import { useBackgroundContext } from '@/shared/contexts/background'; +import { OperatorSignIn } from './operator-sign-in'; export function Welcome() { const { colorPalette, isDarkMode } = useColorMode(); diff --git a/packages/apps/human-app/frontend/src/modules/homepage/components/worker-signin.tsx b/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-in.tsx similarity index 100% rename from packages/apps/human-app/frontend/src/modules/homepage/components/worker-signin.tsx rename to packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-in.tsx 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 new file mode 100644 index 0000000000..8ec2dcab12 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/homepage/components/worker-sign-up.tsx @@ -0,0 +1,91 @@ +import { Grid, Typography, List, ListItemText, Button } 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')} + + + + + + + + + {t('homepage.signUpToComplete')} + + + + + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/homepage/index.ts b/packages/apps/human-app/frontend/src/modules/homepage/index.ts new file mode 100644 index 0000000000..7929623807 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/homepage/index.ts @@ -0,0 +1 @@ +export * from './views'; 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 83821bd2ab..29d03570d6 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 @@ -1,23 +1,20 @@ import Box from '@mui/material/Box'; import { Paper } from '@mui/material'; import { Navigate } from 'react-router-dom'; -import { t } from 'i18next'; import { useIsMobile } from '@/shared/hooks/use-is-mobile'; import { useWeb3Auth } from '@/modules/auth-web3/hooks/use-web3-auth'; import { useAuth } from '@/modules/auth/hooks/use-auth'; import { routerPaths } from '@/router/router-paths'; -import { Button } from '@/shared/components/ui/button'; import { useColorMode } from '@/shared/contexts/color-mode'; -import { HomeContainer } from '@/modules/homepage/components/home-container'; +import { HomeContainer } from '@/modules/homepage/components'; import { useHomePageState } from '@/shared/contexts/homepage-state'; export type HomePageStageType = 'welcome' | 'chooseSignUpAccountType'; export function HomePage() { const { colorPalette, isDarkMode } = useColorMode(); - const { pageView, setPageView } = useHomePageState(); + const { pageView } = useHomePageState(); const isMobile = useIsMobile(); - const isMobileMd = useIsMobile('md'); const { user: worker } = useAuth(); const { user: operator } = useWeb3Auth(); @@ -54,16 +51,6 @@ export function HomePage() { }} > - {pageView === 'chooseSignUpAccountType' && !isMobileMd ? ( - { - setPageView('welcome'); - }} - sx={{ position: 'absolute', top: '24px', right: '24px' }} - > - {t('homepage.cancel')} - - ) : null} ); diff --git a/packages/apps/human-app/frontend/src/modules/homepage/views/index.ts b/packages/apps/human-app/frontend/src/modules/homepage/views/index.ts new file mode 100644 index 0000000000..9879f4ab7b --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/homepage/views/index.ts @@ -0,0 +1 @@ +export * from './home.page'; diff --git a/packages/apps/human-app/frontend/src/router/routes.tsx b/packages/apps/human-app/frontend/src/router/routes.tsx index 0f07b20ec3..2f46ca7010 100644 --- a/packages/apps/human-app/frontend/src/router/routes.tsx +++ b/packages/apps/human-app/frontend/src/router/routes.tsx @@ -20,7 +20,6 @@ import { AddKeysOperatorPage } from '@/modules/operator/views/sign-up/add-keys.p import { AddStakeOperatorPage } from '@/modules/operator/views/sign-up/add-stake.page'; import { ConnectWalletOperatorPage } from '@/modules/operator/views/sign-up/connect-wallet.page'; import { Playground } from '@/modules/playground/views/playground.page'; -import { HomePage } from '@/modules/homepage/views/home.page'; import { HcaptchaLabelingPage, UserStatsAccordion, @@ -35,6 +34,7 @@ import { JobsDiscoveryPage } from '@/modules/worker/jobs-discovery'; import { WorkerProfilePage } from '@/modules/worker/profile'; import { SignUpWorkerPage } from '@/modules/signup/worker'; import { OperatorProfilePage } from '@/modules/operator/profile'; +import { HomePage } from '@/modules/homepage'; export const unprotectedRoutes: RouteProps[] = [ {