From 75fb1a1c0849fc06fa00974e5ad155b14be1db9b Mon Sep 17 00:00:00 2001 From: simeng-li Date: Fri, 21 Oct 2022 11:26:48 +0800 Subject: [PATCH] refactor(ui): move preview related style to AppContent move preview related style to AppContent --- packages/ui/src/App.module.scss | 9 --------- .../ui/src/containers/AppContent/index.module.scss | 12 ++++++++++++ packages/ui/src/hooks/use-preview.ts | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 packages/ui/src/App.module.scss diff --git a/packages/ui/src/App.module.scss b/packages/ui/src/App.module.scss deleted file mode 100644 index d6bb7c22a..000000000 --- a/packages/ui/src/App.module.scss +++ /dev/null @@ -1,9 +0,0 @@ -.preview { - pointer-events: none; - user-select: none; - - main { - pointer-events: none; - user-select: none; - } -} diff --git a/packages/ui/src/containers/AppContent/index.module.scss b/packages/ui/src/containers/AppContent/index.module.scss index b7be87a8d..7e09adf75 100644 --- a/packages/ui/src/containers/AppContent/index.module.scss +++ b/packages/ui/src/containers/AppContent/index.module.scss @@ -18,6 +18,18 @@ --color-dark-brand-pressed: #5d36ff; } +// Disable User Interaction Under Preview +.preview { + pointer-events: none; + user-select: none; + + main { + pointer-events: none; + user-select: none; + } +} + + body { background-color: var(--color-base); -webkit-font-smoothing: antialiased; diff --git a/packages/ui/src/hooks/use-preview.ts b/packages/ui/src/hooks/use-preview.ts index 6cb656f67..cd5c9fc53 100644 --- a/packages/ui/src/hooks/use-preview.ts +++ b/packages/ui/src/hooks/use-preview.ts @@ -2,8 +2,8 @@ import { ConnectorPlatform } from '@logto/schemas'; import { conditionalString } from '@silverhand/essentials'; import { useEffect, useState } from 'react'; -import * as styles from '@/App.module.scss'; -import type { Context } from '@/hooks/use-page-context'; +import * as styles from '@/containers/AppContent/index.module.scss'; +import { Context } from '@/hooks/use-page-context'; import initI18n from '@/i18n/init'; import { changeLanguage } from '@/i18n/utils'; import type { SignInExperienceSettings, PreviewConfig } from '@/types';