diff --git a/packages/console/src/containers/ConsoleContent/index.tsx b/packages/console/src/containers/ConsoleContent/index.tsx index e3b3abb02..b3f985479 100644 --- a/packages/console/src/containers/ConsoleContent/index.tsx +++ b/packages/console/src/containers/ConsoleContent/index.tsx @@ -155,13 +155,15 @@ function ConsoleContent() { {isDevFeaturesEnabled && ( - - } /> - } /> - } /> - } /> - } /> - + <> + + } /> + } /> + } /> + } /> + + } /> + )} } /> diff --git a/packages/console/src/pages/Organizations/Guide/CreateOrganization/index.tsx b/packages/console/src/pages/Organizations/Guide/CreateOrganization/index.tsx new file mode 100644 index 000000000..7e736addd --- /dev/null +++ b/packages/console/src/pages/Organizations/Guide/CreateOrganization/index.tsx @@ -0,0 +1,112 @@ +import { Theme } from '@logto/schemas'; +import classNames from 'classnames'; +import { useForm } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; + +import OrganizationFeatureDark from '@/assets/icons/organization-feature-dark.svg'; +import OrganizationFeature from '@/assets/icons/organization-feature.svg'; +import ActionBar from '@/components/ActionBar'; +import Button from '@/ds-components/Button'; +import Card from '@/ds-components/Card'; +import FormField from '@/ds-components/FormField'; +import OverlayScrollbar from '@/ds-components/OverlayScrollbar'; +import TextInput from '@/ds-components/TextInput'; +import TextLink from '@/ds-components/TextLink'; +import useApi from '@/hooks/use-api'; +import useTenantPathname from '@/hooks/use-tenant-pathname'; +import useTheme from '@/hooks/use-theme'; +import { trySubmitSafe } from '@/utils/form'; + +import { steps } from '../const'; +import styles from '../index.module.scss'; + +type OrganizationForm = { + name: string; +}; + +function CreateOrganization() { + const { t } = useTranslation(undefined, { keyPrefix: 'admin_console.organizations.guide' }); + const theme = useTheme(); + const Icon = theme === Theme.Light ? OrganizationFeature : OrganizationFeatureDark; + const { navigate } = useTenantPathname(); + const api = useApi(); + + const { + register, + handleSubmit, + reset, + formState: { errors, isSubmitting }, + } = useForm({ + defaultValues: { name: '' }, + }); + + const onSubmit = handleSubmit( + trySubmitSafe(async (json) => { + await api.post(`api/organizations`, { json }); + navigate(`/organizations`); + }) + ); + + const onNavigateBack = () => { + reset(); + navigate(`../${steps.createRoles}`); + }; + + return ( + <> + +
+ + +
+
{t('step_3')}
+
{t('step_3_description')}
+
+
+ + + +
+
+ +
+
{t('more_next_steps')}
+
{t('add_members')}
+ {/* eslint-disable-next-line no-warning-comments */} + {/* TODO: @charles Documentation links will be updated later */} +
    +
  • + + {t('add_members_action')} + +
  • +
+
{t('add_enterprise_connector')}
+
    +
  • + + {t('add_enterprise_connector_action')} + +
  • +
+
+
+
+
+ +