0
Fork 0
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:
Xiao Yijun 2023-02-24 16:43:59 +08:00 committed by GitHub
parent 72f4adc0f0
commit a63e79c8b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 19 deletions

View file

@ -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 (

View file

@ -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 (

View file

@ -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} />
}

View file

@ -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 (

View file

@ -4,7 +4,7 @@ export enum CloudRoute {
Onboard = 'onboard',
}
export enum CloudPage {
export enum OnboardPage {
Welcome = 'welcome',
AboutUser = 'about-user',
SignInExperience = 'sign-in-experience',

View file

@ -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}`;