mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -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 ActionBar from '../../components/ActionBar';
|
||||||
import { CardSelector, MultiCardSelector } from '../../components/CardSelector';
|
import { CardSelector, MultiCardSelector } from '../../components/CardSelector';
|
||||||
import type { Questionnaire } from '../../types';
|
import type { Questionnaire } from '../../types';
|
||||||
import { CloudPage } from '../../types';
|
import { OnboardPage } from '../../types';
|
||||||
import { getCloudPagePathname } from '../../utils';
|
import { getOnboardPagePathname } from '../../utils';
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
||||||
import { titleOptions, companySizeOptions, reasonOptions } from './options';
|
import { titleOptions, companySizeOptions, reasonOptions } from './options';
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ const About = () => {
|
||||||
|
|
||||||
const onNext = async () => {
|
const onNext = async () => {
|
||||||
await onSubmit();
|
await onSubmit();
|
||||||
navigate(getCloudPagePathname(CloudPage.SignInExperience));
|
navigate(getOnboardPagePathname(OnboardPage.SignInExperience));
|
||||||
};
|
};
|
||||||
|
|
||||||
const onBack = async () => {
|
const onBack = async () => {
|
||||||
navigate(getCloudPagePathname(CloudPage.Welcome));
|
navigate(getOnboardPagePathname(OnboardPage.Welcome));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -13,8 +13,8 @@ import Divider from '@/components/Divider';
|
||||||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||||
import { AppEndpointsContext } from '@/containers/AppEndpointsProvider';
|
import { AppEndpointsContext } from '@/containers/AppEndpointsProvider';
|
||||||
|
|
||||||
import { CloudPage } from '../../types';
|
import { OnboardPage } from '../../types';
|
||||||
import { getCloudPagePathname } from '../../utils';
|
import { getOnboardPagePathname } from '../../utils';
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
||||||
|
|
||||||
const Congrats = () => {
|
const Congrats = () => {
|
||||||
|
@ -28,7 +28,7 @@ const Congrats = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
navigate(getCloudPagePathname(CloudPage.SignInExperience));
|
navigate(getOnboardPagePathname(OnboardPage.SignInExperience));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { conditional } from '@silverhand/essentials';
|
||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
import useUserOnboardingData from '@/cloud/hooks/use-user-onboarding-data';
|
import useUserOnboardingData from '@/cloud/hooks/use-user-onboarding-data';
|
||||||
import { CloudPage } from '@/cloud/types';
|
import { OnboardPage } from '@/cloud/types';
|
||||||
import { getCloudPagePathname } from '@/cloud/utils';
|
import { getOnboardPagePathname } from '@/cloud/utils';
|
||||||
import NotFound from '@/pages/NotFound';
|
import NotFound from '@/pages/NotFound';
|
||||||
|
|
||||||
import About from '../About';
|
import About from '../About';
|
||||||
|
@ -11,7 +11,7 @@ import Congrats from '../Congrats';
|
||||||
import Welcome from '../Welcome';
|
import Welcome from '../Welcome';
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
||||||
|
|
||||||
const welcomePathname = getCloudPagePathname(CloudPage.Welcome);
|
const welcomePathname = getOnboardPagePathname(OnboardPage.Welcome);
|
||||||
|
|
||||||
const Onboard = () => {
|
const Onboard = () => {
|
||||||
const {
|
const {
|
||||||
|
@ -27,15 +27,15 @@ const Onboard = () => {
|
||||||
<div className={styles.onBoard}>
|
<div className={styles.onBoard}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route index element={<Navigate replace to={welcomePathname} />} />
|
<Route index element={<Navigate replace to={welcomePathname} />} />
|
||||||
<Route path={CloudPage.Welcome} element={<Welcome />} />
|
<Route path={OnboardPage.Welcome} element={<Welcome />} />
|
||||||
<Route
|
<Route
|
||||||
path={CloudPage.AboutUser}
|
path={OnboardPage.AboutUser}
|
||||||
element={
|
element={
|
||||||
conditional(questionnaire && <About />) ?? <Navigate replace to={welcomePathname} />
|
conditional(questionnaire && <About />) ?? <Navigate replace to={welcomePathname} />
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path={CloudPage.Congrats}
|
path={OnboardPage.Congrats}
|
||||||
element={
|
element={
|
||||||
conditional(questionnaire && <Congrats />) ?? <Navigate replace to={welcomePathname} />
|
conditional(questionnaire && <Congrats />) ?? <Navigate replace to={welcomePathname} />
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ import FormField from '@/components/FormField';
|
||||||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||||
|
|
||||||
import type { Questionnaire } from '../../types';
|
import type { Questionnaire } from '../../types';
|
||||||
import { CloudPage } from '../../types';
|
import { OnboardPage } from '../../types';
|
||||||
import { getCloudPagePathname } from '../../utils';
|
import { getOnboardPagePathname } from '../../utils';
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
||||||
import { deploymentTypeOptions, projectOptions } from './options';
|
import { deploymentTypeOptions, projectOptions } from './options';
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ const Welcome = () => {
|
||||||
|
|
||||||
const onNext = async () => {
|
const onNext = async () => {
|
||||||
await onSubmit();
|
await onSubmit();
|
||||||
navigate(getCloudPagePathname(CloudPage.AboutUser));
|
navigate(getOnboardPagePathname(OnboardPage.AboutUser));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -4,7 +4,7 @@ export enum CloudRoute {
|
||||||
Onboard = 'onboard',
|
Onboard = 'onboard',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CloudPage {
|
export enum OnboardPage {
|
||||||
Welcome = 'welcome',
|
Welcome = 'welcome',
|
||||||
AboutUser = 'about-user',
|
AboutUser = 'about-user',
|
||||||
SignInExperience = 'sign-in-experience',
|
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