From 660352c4393aa246a699f99fd415e30a0e443bea Mon Sep 17 00:00:00 2001 From: wangsijie Date: Tue, 12 Apr 2022 15:30:43 +0800 Subject: [PATCH] feat(console): init sign in exp page --- packages/console/src/App.tsx | 5 ++ .../pages/SignInExperience/index.module.scss | 19 ++++++ .../src/pages/SignInExperience/index.tsx | 39 ++++++++++++ packages/phrases/src/locales/en.ts | 63 +++++++++++++++++++ packages/phrases/src/locales/zh-cn.ts | 63 +++++++++++++++++++ 5 files changed, 189 insertions(+) create mode 100644 packages/console/src/pages/SignInExperience/index.module.scss create mode 100644 packages/console/src/pages/SignInExperience/index.tsx diff --git a/packages/console/src/App.tsx b/packages/console/src/App.tsx index e0e8bb9a9..230ecef26 100644 --- a/packages/console/src/App.tsx +++ b/packages/console/src/App.tsx @@ -18,6 +18,7 @@ import Callback from './pages/Callback'; import ConnectorDetails from './pages/ConnectorDetails'; import Connectors from './pages/Connectors'; import NotFound from './pages/NotFound'; +import SignInExperience from './pages/SignInExperience'; import UserDetails from './pages/UserDetails'; import Users from './pages/Users'; @@ -64,6 +65,10 @@ const Main = () => { } /> } /> + + } /> + } /> + diff --git a/packages/console/src/pages/SignInExperience/index.module.scss b/packages/console/src/pages/SignInExperience/index.module.scss new file mode 100644 index 000000000..2e2bbd2c6 --- /dev/null +++ b/packages/console/src/pages/SignInExperience/index.module.scss @@ -0,0 +1,19 @@ +@use '@/scss/underscore' as _; + +.wrapper { + display: flex; + height: 100%; + + .setup { + flex: 1; + margin-right: _.unit(3); + + .tabs { + padding-top: _.unit(2); + } + } + + .preview { + width: 500px; + } +} diff --git a/packages/console/src/pages/SignInExperience/index.tsx b/packages/console/src/pages/SignInExperience/index.tsx new file mode 100644 index 000000000..8f9f9831e --- /dev/null +++ b/packages/console/src/pages/SignInExperience/index.tsx @@ -0,0 +1,39 @@ +import classNames from 'classnames'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import Button from '@/components/Button'; +import Card from '@/components/Card'; +import CardTitle from '@/components/CardTitle'; +import TabNav, { TabNavLink } from '@/components/TabNav'; +import * as detailsStyles from '@/scss/details.module.scss'; + +import * as styles from './index.module.scss'; + +const SignInExperience = () => { + const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); + + return ( +
+ + + + + {t('sign_in_exp.tabs.experience')} + + + {t('sign_in_exp.tabs.methods')} + + {t('sign_in_exp.tabs.others')} + +
TODO
+
+
+
+ TODO +
+ ); +}; + +export default SignInExperience; diff --git a/packages/phrases/src/locales/en.ts b/packages/phrases/src/locales/en.ts index 5e769b2f2..8a61acd05 100644 --- a/packages/phrases/src/locales/en.ts +++ b/packages/phrases/src/locales/en.ts @@ -7,6 +7,7 @@ const translation = { retry: 'Try again', done: 'Done', search: 'Search', + save_changes: 'Save changes', }, main_flow: { input: { @@ -312,6 +313,68 @@ const translation = { button: 'Send', }, }, + sign_in_exp: { + title: 'Sign-in Experience', + description: 'Customize the sign in experience.', + tabs: { + experience: 'Experience', + methods: 'Sign in methods', + others: 'Others', + }, + branding: { + title: 'BRANDING', + primary_color: 'Primary color', + dark_mode: 'Enable dark mode', + dark_mode_description: + 'Enabling this setting will auto generate the dark mode color. You app won’t have dark mode if it’s turned off.', + ui_style: 'Define your UI style', + app_logo: 'App Logo', + text: 'Text', + logo_image_url: 'Logo image URL', + slogan: 'Slogan', + slogan_placeholder: 'Unleash your creativity', + }, + terms_of_use: { + title: 'TERMS OF USE', + enable: 'Enable Terms of use', + description: + 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. ', + terms_of_use: 'Terms of use', + terms_of_use_placeholder: 'Terms of use url', + }, + sign_in_methods: { + title: 'SIGN IN METHODS', + primary: 'Primary sign in method', + enable_secondary: 'Enable secondary sign in', + enable_secondary_description: + "Once it's turned on, you app will support more sign in method(s) besides the primary one. ", + methods: { + sms: 'Phone number sign in', + email: 'Email sign in', + social: 'Social sign in', + username_password: 'Username-with-password sign in', + }, + }, + others: { + forgot_password: { + title: 'FORGOT PASSWORD', + enable: 'Enable forgot password', + enable_description: + 'Once it’s turned on, you app will support more sign in method(s) besides the primary one. ', + }, + languages: { + title: 'LANGUAGES', + mode: 'Language mode', + auto: 'Auto', + fixed: 'Fixed', + fallback: 'Fallback laguanges', + languages: { + english: 'English', + chinese: 'Chinese', + }, + }, + }, + }, }, }; diff --git a/packages/phrases/src/locales/zh-cn.ts b/packages/phrases/src/locales/zh-cn.ts index 88979fc78..6782db750 100644 --- a/packages/phrases/src/locales/zh-cn.ts +++ b/packages/phrases/src/locales/zh-cn.ts @@ -9,6 +9,7 @@ const translation = { retry: '重试', done: '完成', search: '搜索', + save_changes: '保存更改', }, main_flow: { input: { @@ -309,6 +310,68 @@ const translation = { button: 'Send', }, }, + sign_in_exp: { + title: 'Sign-in Experience', + description: 'Customize the sign in experience.', + tabs: { + experience: 'Experience', + methods: 'Sign in methods', + others: 'Others', + }, + branding: { + title: 'BRANDING', + primary_color: 'Primary color', + dark_mode: 'Enable dark mode', + dark_mode_description: + 'Enabling this setting will auto generate the dark mode color. You app won’t have dark mode if it’s turned off.', + ui_style: 'Define your UI style', + app_logo: 'App Logo', + text: 'Text', + logo_image_url: 'Logo image URL', + slogan: 'Slogan', + slogan_placeholder: 'Unleash your creativity', + }, + terms_of_use: { + title: 'TERMS OF USE', + enable: 'Enable Terms of use', + description: + 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. ', + terms_of_use: 'Terms of use', + terms_of_use_placeholder: 'Terms of use url', + }, + sign_in_methods: { + title: 'SIGN IN METHODS', + primary: 'Primary sign in method', + enable_secondary: 'Enable secondary sign in', + enable_secondary_description: + "Once it's turned on, you app will support more sign in method(s) besides the primary one. ", + methods: { + sms: 'Phone number sign in', + email: 'Email sign in', + social: 'Social sign in', + username_password: 'Username-with-password sign in', + }, + }, + others: { + forgot_password: { + title: 'FORGOT PASSWORD', + enable: 'Enable forgot password', + enable_description: + 'Once it’s turned on, you app will support more sign in method(s) besides the primary one. ', + }, + languages: { + title: 'LANGUAGES', + mode: 'Language mode', + auto: 'Auto', + fixed: 'Fixed', + fallback: 'Fallback laguanges', + languages: { + english: 'English', + chinese: 'Chinese', + }, + }, + }, + }, }, };