From 8dedd9dae17504908b9a00a80f5d2c8ecde322ad Mon Sep 17 00:00:00 2001 From: Wang Sijie Date: Wed, 29 Jun 2022 11:16:30 +0800 Subject: [PATCH] fix(console): sie guide skip (#1271) --- .../components/GuideModal.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/console/src/pages/SignInExperience/components/GuideModal.tsx b/packages/console/src/pages/SignInExperience/components/GuideModal.tsx index 9ba204348..14626b689 100644 --- a/packages/console/src/pages/SignInExperience/components/GuideModal.tsx +++ b/packages/console/src/pages/SignInExperience/components/GuideModal.tsx @@ -1,5 +1,5 @@ import { SignInExperience } from '@logto/schemas'; -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import Modal from 'react-modal'; @@ -45,6 +45,7 @@ const GuideModal = ({ isOpen, onClose }: Props) => { const api = useApi(); const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const formData = watch(); + const [isLoading, setIsLoading] = useState(false); const previewConfigs = usePreviewConfigs(formData, isDirty, data); @@ -73,17 +74,30 @@ const GuideModal = ({ isOpen, onClose }: Props) => { onClose(); }); + const onSkip = async () => { + setIsLoading(true); + await updateSettings({ customizeSignInExperience: true }); + setIsLoading(false); + onClose(); + }; + return (
- +
-
{!preferences.experienceNoticeConfirmed && (