mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): rename cloudPage
to onboardPage
(#3207)
This commit is contained in:
parent
72f4adc0f0
commit
a63e79c8b4
6 changed files with 20 additions and 19 deletions
|
@ -15,8 +15,8 @@ import TextInput from '@/components/TextInput';
|
|||
import ActionBar from '../../components/ActionBar';
|
||||
import { CardSelector, MultiCardSelector } from '../../components/CardSelector';
|
||||
import type { Questionnaire } from '../../types';
|
||||
import { CloudPage } from '../../types';
|
||||
import { getCloudPagePathname } from '../../utils';
|
||||
import { OnboardPage } from '../../types';
|
||||
import { getOnboardPagePathname } from '../../utils';
|
||||
import * as styles from './index.module.scss';
|
||||
import { titleOptions, companySizeOptions, reasonOptions } from './options';
|
||||
|
||||
|
@ -43,11 +43,11 @@ const About = () => {
|
|||
|
||||
const onNext = async () => {
|
||||
await onSubmit();
|
||||
navigate(getCloudPagePathname(CloudPage.SignInExperience));
|
||||
navigate(getOnboardPagePathname(OnboardPage.SignInExperience));
|
||||
};
|
||||
|
||||
const onBack = async () => {
|
||||
navigate(getCloudPagePathname(CloudPage.Welcome));
|
||||
navigate(getOnboardPagePathname(OnboardPage.Welcome));
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -13,8 +13,8 @@ import Divider from '@/components/Divider';
|
|||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||
import { AppEndpointsContext } from '@/containers/AppEndpointsProvider';
|
||||
|
||||
import { CloudPage } from '../../types';
|
||||
import { getCloudPagePathname } from '../../utils';
|
||||
import { OnboardPage } from '../../types';
|
||||
import { getOnboardPagePathname } from '../../utils';
|
||||
import * as styles from './index.module.scss';
|
||||
|
||||
const Congrats = () => {
|
||||
|
@ -28,7 +28,7 @@ const Congrats = () => {
|
|||
};
|
||||
|
||||
const handleBack = () => {
|
||||
navigate(getCloudPagePathname(CloudPage.SignInExperience));
|
||||
navigate(getOnboardPagePathname(OnboardPage.SignInExperience));
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -2,8 +2,8 @@ import { conditional } from '@silverhand/essentials';
|
|||
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||
|
||||
import useUserOnboardingData from '@/cloud/hooks/use-user-onboarding-data';
|
||||
import { CloudPage } from '@/cloud/types';
|
||||
import { getCloudPagePathname } from '@/cloud/utils';
|
||||
import { OnboardPage } from '@/cloud/types';
|
||||
import { getOnboardPagePathname } from '@/cloud/utils';
|
||||
import NotFound from '@/pages/NotFound';
|
||||
|
||||
import About from '../About';
|
||||
|
@ -11,7 +11,7 @@ import Congrats from '../Congrats';
|
|||
import Welcome from '../Welcome';
|
||||
import * as styles from './index.module.scss';
|
||||
|
||||
const welcomePathname = getCloudPagePathname(CloudPage.Welcome);
|
||||
const welcomePathname = getOnboardPagePathname(OnboardPage.Welcome);
|
||||
|
||||
const Onboard = () => {
|
||||
const {
|
||||
|
@ -27,15 +27,15 @@ const Onboard = () => {
|
|||
<div className={styles.onBoard}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate replace to={welcomePathname} />} />
|
||||
<Route path={CloudPage.Welcome} element={<Welcome />} />
|
||||
<Route path={OnboardPage.Welcome} element={<Welcome />} />
|
||||
<Route
|
||||
path={CloudPage.AboutUser}
|
||||
path={OnboardPage.AboutUser}
|
||||
element={
|
||||
conditional(questionnaire && <About />) ?? <Navigate replace to={welcomePathname} />
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={CloudPage.Congrats}
|
||||
path={OnboardPage.Congrats}
|
||||
element={
|
||||
conditional(questionnaire && <Congrats />) ?? <Navigate replace to={welcomePathname} />
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ import FormField from '@/components/FormField';
|
|||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||
|
||||
import type { Questionnaire } from '../../types';
|
||||
import { CloudPage } from '../../types';
|
||||
import { getCloudPagePathname } from '../../utils';
|
||||
import { OnboardPage } from '../../types';
|
||||
import { getOnboardPagePathname } from '../../utils';
|
||||
import * as styles from './index.module.scss';
|
||||
import { deploymentTypeOptions, projectOptions } from './options';
|
||||
|
||||
|
@ -45,7 +45,7 @@ const Welcome = () => {
|
|||
|
||||
const onNext = async () => {
|
||||
await onSubmit();
|
||||
navigate(getCloudPagePathname(CloudPage.AboutUser));
|
||||
navigate(getOnboardPagePathname(OnboardPage.AboutUser));
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -4,7 +4,7 @@ export enum CloudRoute {
|
|||
Onboard = 'onboard',
|
||||
}
|
||||
|
||||
export enum CloudPage {
|
||||
export enum OnboardPage {
|
||||
Welcome = 'welcome',
|
||||
AboutUser = 'about-user',
|
||||
SignInExperience = 'sign-in-experience',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import type { CloudPage } from './types';
|
||||
import type { OnboardPage } from './types';
|
||||
import { CloudRoute } from './types';
|
||||
|
||||
export const getCloudPagePathname = (page: CloudPage) => `/cloud/${page}`;
|
||||
export const getOnboardPagePathname = (page: OnboardPage) => `/${CloudRoute.Onboard}/${page}`;
|
||||
|
|
Loading…
Reference in a new issue