diff --git a/packages/console/src/onboarding/components/ActionBar/index.module.scss b/packages/console/src/components/ActionBar/index.module.scss similarity index 100% rename from packages/console/src/onboarding/components/ActionBar/index.module.scss rename to packages/console/src/components/ActionBar/index.module.scss diff --git a/packages/console/src/onboarding/components/ActionBar/index.tsx b/packages/console/src/components/ActionBar/index.tsx similarity index 83% rename from packages/console/src/onboarding/components/ActionBar/index.tsx rename to packages/console/src/components/ActionBar/index.tsx index 8b8485609..a31705dab 100644 --- a/packages/console/src/onboarding/components/ActionBar/index.tsx +++ b/packages/console/src/components/ActionBar/index.tsx @@ -6,12 +6,11 @@ import * as styles from './index.module.scss'; type Props = { step: number; + totalSteps: number; children: ReactNode; }; -const totalSteps = 2; - -function ActionBar({ step, children }: Props) { +function ActionBar({ step, totalSteps, children }: Props) { return (
diff --git a/packages/console/src/components/Guide/ModalHeader/index.module.scss b/packages/console/src/components/Guide/ModalHeader/index.module.scss index 3535d2a84..0309365dc 100644 --- a/packages/console/src/components/Guide/ModalHeader/index.module.scss +++ b/packages/console/src/components/Guide/ModalHeader/index.module.scss @@ -1,45 +1,11 @@ @use '@/scss/underscore' as _; -.header { - display: flex; - align-items: center; - background-color: var(--color-base); - width: 100%; - height: 64px; - padding: 0 _.unit(6); - flex-shrink: 0; - - .separator { - @include _.vertical-bar; - height: 20px; - margin: 0 _.unit(5) 0 _.unit(4); - } - - .closeIcon { - color: var(--color-text-secondary); - } - - .githubToolTipAnchor { - margin-right: _.unit(4); - } - - .githubIcon { - div { - display: flex; - } - - svg { - color: var(--color-text); - } - } - - .requestSdkButton { - margin-right: _.unit(15); - } +.requestSdkButton { + margin-right: _.unit(15); } @media screen and (max-width: 918px) { - .header .requestSdkButton { + .requestSdkButton { margin-right: 0; } } diff --git a/packages/console/src/components/Guide/ModalHeader/index.tsx b/packages/console/src/components/Guide/ModalHeader/index.tsx index 2cffdb4ea..5ce1af244 100644 --- a/packages/console/src/components/Guide/ModalHeader/index.tsx +++ b/packages/console/src/components/Guide/ModalHeader/index.tsx @@ -2,13 +2,10 @@ import { type AdminConsoleKey } from '@logto/phrases'; import { useCallback, useState } from 'react'; import Box from '@/assets/icons/box.svg'; -import Close from '@/assets/icons/close.svg'; import { githubIssuesLink } from '@/consts'; import { isCloud } from '@/consts/env'; import Button from '@/ds-components/Button'; -import CardTitle from '@/ds-components/CardTitle'; -import IconButton from '@/ds-components/IconButton'; -import Spacer from '@/ds-components/Spacer'; +import DsModalHeader from '@/ds-components/ModalHeader'; import RequestForm from './RequestForm'; import * as styles from './index.module.scss'; @@ -40,25 +37,26 @@ function ModalHeader({ }, []); return ( -
- - - -
- - -
+ ); } diff --git a/packages/console/src/onboarding/components/ProgressBar/index.module.scss b/packages/console/src/components/ProgressBar/index.module.scss similarity index 100% rename from packages/console/src/onboarding/components/ProgressBar/index.module.scss rename to packages/console/src/components/ProgressBar/index.module.scss diff --git a/packages/console/src/onboarding/components/ProgressBar/index.tsx b/packages/console/src/components/ProgressBar/index.tsx similarity index 100% rename from packages/console/src/onboarding/components/ProgressBar/index.tsx rename to packages/console/src/components/ProgressBar/index.tsx diff --git a/packages/console/src/ds-components/ModalHeader/index.module.scss b/packages/console/src/ds-components/ModalHeader/index.module.scss new file mode 100644 index 000000000..53a414dd8 --- /dev/null +++ b/packages/console/src/ds-components/ModalHeader/index.module.scss @@ -0,0 +1,21 @@ +@use '@/scss/underscore' as _; + +.header { + display: flex; + align-items: center; + background-color: var(--color-base); + width: 100%; + height: 64px; + padding: 0 _.unit(6); + flex-shrink: 0; + + .separator { + @include _.vertical-bar; + height: 20px; + margin: 0 _.unit(5) 0 _.unit(4); + } + + .closeIcon { + color: var(--color-text-secondary); + } +} diff --git a/packages/console/src/ds-components/ModalHeader/index.tsx b/packages/console/src/ds-components/ModalHeader/index.tsx new file mode 100644 index 000000000..c8c66aaa4 --- /dev/null +++ b/packages/console/src/ds-components/ModalHeader/index.tsx @@ -0,0 +1,33 @@ +import { type AdminConsoleKey } from '@logto/phrases'; +import { type ReactNode } from 'react'; + +import Close from '@/assets/icons/close.svg'; + +import CardTitle from '../CardTitle'; +import IconButton from '../IconButton'; +import Spacer from '../Spacer'; + +import * as styles from './index.module.scss'; + +type Props = { + title: AdminConsoleKey; + subtitle: AdminConsoleKey; + actionButton?: ReactNode; + onClose: () => void; +}; + +function ModalHeader({ title, subtitle, actionButton, onClose }: Props) { + return ( +
+ + + +
+ + + {actionButton} +
+ ); +} + +export default ModalHeader; diff --git a/packages/console/src/onboarding/pages/SignInExperience/index.tsx b/packages/console/src/onboarding/pages/SignInExperience/index.tsx index 706af86d0..0cd29d566 100644 --- a/packages/console/src/onboarding/pages/SignInExperience/index.tsx +++ b/packages/console/src/onboarding/pages/SignInExperience/index.tsx @@ -8,6 +8,7 @@ import { useTranslation } from 'react-i18next'; import useSWR from 'swr'; import Tools from '@/assets/icons/tools.svg'; +import ActionBar from '@/components/ActionBar'; import PageMeta from '@/components/PageMeta'; import { TenantsContext } from '@/contexts/TenantsProvider'; import Button from '@/ds-components/Button'; @@ -20,7 +21,6 @@ import useApi from '@/hooks/use-api'; import type { RequestError } from '@/hooks/use-api'; import useTenantPathname from '@/hooks/use-tenant-pathname'; import useUserAssetsService from '@/hooks/use-user-assets-service'; -import ActionBar from '@/onboarding/components/ActionBar'; import { CardSelector, MultiCardSelector } from '@/onboarding/components/CardSelector'; import useUserOnboardingData from '@/onboarding/hooks/use-user-onboarding-data'; import * as pageLayout from '@/onboarding/scss/layout.module.scss'; @@ -237,7 +237,7 @@ function SignInExperience() {
- +
- +