mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
feat(console): add isCloud
constant (#3144)
This commit is contained in:
parent
0e11a2e7f2
commit
2147c1974b
26 changed files with 37 additions and 31 deletions
|
@ -39,6 +39,7 @@ import UserDetails from '@/pages/UserDetails';
|
||||||
import Users from '@/pages/Users';
|
import Users from '@/pages/Users';
|
||||||
import Welcome from '@/pages/Welcome';
|
import Welcome from '@/pages/Welcome';
|
||||||
|
|
||||||
|
import Cloud from './cloud/pages/Cloud';
|
||||||
import {
|
import {
|
||||||
ApiResourceDetailsTabs,
|
ApiResourceDetailsTabs,
|
||||||
ConnectorsTabs,
|
ConnectorsTabs,
|
||||||
|
@ -48,15 +49,11 @@ import {
|
||||||
adminTenantEndpoint,
|
adminTenantEndpoint,
|
||||||
getUserTenantId,
|
getUserTenantId,
|
||||||
} from './consts';
|
} from './consts';
|
||||||
|
import { isCloud } from './consts/cloud';
|
||||||
import AppContent from './containers/AppContent';
|
import AppContent from './containers/AppContent';
|
||||||
import AppEndpointsProvider, { AppEndpointsContext } from './containers/AppEndpointsProvider';
|
import AppEndpointsProvider, { AppEndpointsContext } from './containers/AppEndpointsProvider';
|
||||||
import ApiResourcePermissions from './pages/ApiResourceDetails/ApiResourcePermissions';
|
import ApiResourcePermissions from './pages/ApiResourceDetails/ApiResourcePermissions';
|
||||||
import ApiResourceSettings from './pages/ApiResourceDetails/ApiResourceSettings';
|
import ApiResourceSettings from './pages/ApiResourceDetails/ApiResourceSettings';
|
||||||
import Cloud from './pages/Cloud';
|
|
||||||
import CloudAboutUser from './pages/Cloud/pages/About';
|
|
||||||
import CloudCongrats from './pages/Cloud/pages/Congrats';
|
|
||||||
import CloudWelcome from './pages/Cloud/pages/Welcome';
|
|
||||||
import { CloudPage } from './pages/Cloud/types';
|
|
||||||
import Profile from './pages/Profile';
|
import Profile from './pages/Profile';
|
||||||
import RolePermissions from './pages/RoleDetails/RolePermissions';
|
import RolePermissions from './pages/RoleDetails/RolePermissions';
|
||||||
import RoleSettings from './pages/RoleDetails/RoleSettings';
|
import RoleSettings from './pages/RoleDetails/RoleSettings';
|
||||||
|
@ -84,13 +81,7 @@ const Main = () => {
|
||||||
<Route path="callback" element={<Callback />} />
|
<Route path="callback" element={<Callback />} />
|
||||||
<Route path="welcome" element={<Welcome />} />
|
<Route path="welcome" element={<Welcome />} />
|
||||||
<Route element={<AppLayout />}>
|
<Route element={<AppLayout />}>
|
||||||
<Route path="cloud" element={<Cloud />}>
|
{isCloud && <Route path="cloud/*" element={<Cloud />} />}
|
||||||
<Route index element={<Navigate replace to={CloudPage.Welcome} />} />
|
|
||||||
<Route path={CloudPage.Welcome} element={<CloudWelcome />} />
|
|
||||||
<Route path={CloudPage.AboutUser} element={<CloudAboutUser />} />
|
|
||||||
<Route path={CloudPage.Congrats} element={<CloudCongrats />} />
|
|
||||||
<Route path="*" element={<NotFound />} />
|
|
||||||
</Route>
|
|
||||||
<Route element={<AppContent />}>
|
<Route element={<AppContent />}>
|
||||||
<Route path="*" element={<NotFound />} />
|
<Route path="*" element={<NotFound />} />
|
||||||
<Route path="get-started" element={<GetStarted />} />
|
<Route path="get-started" element={<GetStarted />} />
|
||||||
|
|
|
@ -3,11 +3,11 @@ import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import Case from '@/assets/images/case.svg';
|
import Case from '@/assets/images/case.svg';
|
||||||
|
import * as pageLayout from '@/cloud/scss/layout.module.scss';
|
||||||
import Button from '@/components/Button';
|
import Button from '@/components/Button';
|
||||||
import FormField from '@/components/FormField';
|
import FormField from '@/components/FormField';
|
||||||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||||
import TextInput from '@/components/TextInput';
|
import TextInput from '@/components/TextInput';
|
||||||
import * as pageLayout from '@/pages/Cloud/layout.module.scss';
|
|
||||||
|
|
||||||
import ActionBar from '../../components/ActionBar';
|
import ActionBar from '../../components/ActionBar';
|
||||||
import { CardSelector, MultiCardSelector } from '../../components/CardSelector';
|
import { CardSelector, MultiCardSelector } from '../../components/CardSelector';
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Option as SelectorOption } from '@/pages/Cloud/components/CardSelector';
|
import type { Option as SelectorOption } from '@/cloud/components/CardSelector';
|
||||||
|
|
||||||
import { CompanySize, Reason, Title } from '../../types';
|
import { CompanySize, Reason, Title } from '../../types';
|
||||||
|
|
23
packages/console/src/cloud/pages/Cloud/index.tsx
Normal file
23
packages/console/src/cloud/pages/Cloud/index.tsx
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { CloudPage } from '@/cloud/types';
|
||||||
|
import NotFound from '@/pages/NotFound';
|
||||||
|
|
||||||
|
import About from '../About';
|
||||||
|
import Congrats from '../Congrats';
|
||||||
|
import Welcome from '../Welcome';
|
||||||
|
import * as styles from './index.module.scss';
|
||||||
|
|
||||||
|
const Cloud = () => (
|
||||||
|
<div className={styles.cloud}>
|
||||||
|
<Routes>
|
||||||
|
<Route index element={<Navigate replace to={CloudPage.Welcome} />} />
|
||||||
|
<Route path={CloudPage.Welcome} element={<Welcome />} />
|
||||||
|
<Route path={CloudPage.AboutUser} element={<About />} />
|
||||||
|
<Route path={CloudPage.Congrats} element={<Congrats />} />
|
||||||
|
<Route path="*" element={<NotFound />} />
|
||||||
|
</Routes>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default Cloud;
|
|
@ -6,14 +6,14 @@ import { useNavigate } from 'react-router-dom';
|
||||||
import AirPlay from '@/assets/images/air-play.svg';
|
import AirPlay from '@/assets/images/air-play.svg';
|
||||||
import Calendar from '@/assets/images/calendar.svg';
|
import Calendar from '@/assets/images/calendar.svg';
|
||||||
import GetStarted from '@/assets/images/get-started.svg';
|
import GetStarted from '@/assets/images/get-started.svg';
|
||||||
|
import ActionBar from '@/cloud/components/ActionBar';
|
||||||
|
import * as pageLayout from '@/cloud/scss/layout.module.scss';
|
||||||
import Button from '@/components/Button';
|
import Button from '@/components/Button';
|
||||||
import Divider from '@/components/Divider';
|
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 * as pageLayout from '@/pages/Cloud/layout.module.scss';
|
|
||||||
import { buildUrl } from '@/utils/url';
|
import { buildUrl } from '@/utils/url';
|
||||||
|
|
||||||
import ActionBar from '../../components/ActionBar';
|
|
||||||
import { CloudPage } from '../../types';
|
import { CloudPage } from '../../types';
|
||||||
import { getCloudPagePathname } from '../../utils';
|
import { getCloudPagePathname } from '../../utils';
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
|
@ -4,13 +4,13 @@ import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import Congrats from '@/assets/images/congrats.svg';
|
import Congrats from '@/assets/images/congrats.svg';
|
||||||
|
import ActionBar from '@/cloud/components/ActionBar';
|
||||||
|
import { CardSelector } from '@/cloud/components/CardSelector';
|
||||||
|
import * as pageLayout from '@/cloud/scss/layout.module.scss';
|
||||||
import Button from '@/components/Button';
|
import Button from '@/components/Button';
|
||||||
import FormField from '@/components/FormField';
|
import FormField from '@/components/FormField';
|
||||||
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
import OverlayScrollbar from '@/components/OverlayScrollbar';
|
||||||
import * as pageLayout from '@/pages/Cloud/layout.module.scss';
|
|
||||||
|
|
||||||
import ActionBar from '../../components/ActionBar';
|
|
||||||
import { CardSelector } from '../../components/CardSelector';
|
|
||||||
import type { Questionnaire } from '../../types';
|
import type { Questionnaire } from '../../types';
|
||||||
import { CloudPage } from '../../types';
|
import { CloudPage } from '../../types';
|
||||||
import { getCloudPagePathname } from '../../utils';
|
import { getCloudPagePathname } from '../../utils';
|
|
@ -2,7 +2,7 @@ import Building from '@/assets/images/building.svg';
|
||||||
import Cloud from '@/assets/images/cloud.svg';
|
import Cloud from '@/assets/images/cloud.svg';
|
||||||
import Database from '@/assets/images/database.svg';
|
import Database from '@/assets/images/database.svg';
|
||||||
import Pizza from '@/assets/images/pizza.svg';
|
import Pizza from '@/assets/images/pizza.svg';
|
||||||
import type { Option as SelectorOption } from '@/pages/Cloud/components/CardSelector';
|
import type { Option as SelectorOption } from '@/cloud/components/CardSelector';
|
||||||
|
|
||||||
import { DeploymentType, Project } from '../../types';
|
import { DeploymentType, Project } from '../../types';
|
||||||
|
|
3
packages/console/src/consts/cloud.ts
Normal file
3
packages/console/src/consts/cloud.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { yes } from '@silverhand/essentials';
|
||||||
|
|
||||||
|
export const isCloud = yes(process.env.IS_CLOUD);
|
|
@ -1,11 +0,0 @@
|
||||||
import { Outlet } from 'react-router-dom';
|
|
||||||
|
|
||||||
import * as styles from './index.module.scss';
|
|
||||||
|
|
||||||
const Cloud = () => (
|
|
||||||
<div className={styles.cloud}>
|
|
||||||
<Outlet />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default Cloud;
|
|
Loading…
Reference in a new issue