From ffae3f89df6e26243c493f849719bf317fab735b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 20 Sep 2023 13:57:33 -0500 Subject: [PATCH] Move Login page to UI --- src/components/big-card.tsx | 32 ++++++ src/containers/soapbox.tsx | 1 - src/features/auth-layout/index.tsx | 1 - .../auth-login/components/login-form.tsx | 100 ++++++++---------- .../auth-login/components/login-page.tsx | 10 +- src/features/ui/index.tsx | 3 + 6 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 src/components/big-card.tsx diff --git a/src/components/big-card.tsx b/src/components/big-card.tsx new file mode 100644 index 000000000..2fcb7078a --- /dev/null +++ b/src/components/big-card.tsx @@ -0,0 +1,32 @@ +import React from 'react'; + +import { Card, CardBody, Stack, Text } from 'soapbox/components/ui'; + +interface IBigCard { + title: React.ReactNode + subtitle?: React.ReactNode + children: React.ReactNode +} + +const BigCard: React.FC = ({ title, subtitle, children }) => { + return ( + + +
+ + {title} + {subtitle && {subtitle}} + +
+ + +
+ {children} +
+
+
+
+ ); +}; + +export { BigCard }; \ No newline at end of file diff --git a/src/containers/soapbox.tsx b/src/containers/soapbox.tsx index deebda4ee..8f0015b87 100644 --- a/src/containers/soapbox.tsx +++ b/src/containers/soapbox.tsx @@ -104,7 +104,6 @@ const SoapboxMount = () => { )} - diff --git a/src/features/auth-layout/index.tsx b/src/features/auth-layout/index.tsx index df1d0dd4b..42cc1ba50 100644 --- a/src/features/auth-layout/index.tsx +++ b/src/features/auth-layout/index.tsx @@ -64,7 +64,6 @@ const AuthLayout = () => { - diff --git a/src/features/auth-login/components/login-form.tsx b/src/features/auth-login/components/login-form.tsx index d7871fc75..19f9e76bb 100644 --- a/src/features/auth-login/components/login-form.tsx +++ b/src/features/auth-login/components/login-form.tsx @@ -2,11 +2,9 @@ import React from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { Button, Form, FormActions, FormGroup, Input, Stack } from 'soapbox/components/ui'; +import { Button, Form, FormActions, FormGroup, Input } from 'soapbox/components/ui'; import { useFeatures } from 'soapbox/hooks'; -import ConsumersList from './consumers-list'; - const messages = defineMessages({ username: { id: 'login.fields.username_label', @@ -35,62 +33,52 @@ const LoginForm: React.FC = ({ isLoading, handleSubmit }) => { const passwordLabel = intl.formatMessage(messages.password); return ( -
-
-

-
+
+ + + - - - - + - + + } + > + + - - - - } - > - - - - - - - - - -
-
+ + + + ); }; diff --git a/src/features/auth-login/components/login-page.tsx b/src/features/auth-login/components/login-page.tsx index 609af73a4..8817b6d39 100644 --- a/src/features/auth-login/components/login-page.tsx +++ b/src/features/auth-login/components/login-page.tsx @@ -1,13 +1,16 @@ import React, { useState } from 'react'; +import { FormattedMessage } from 'react-intl'; import { Redirect } from 'react-router-dom'; import { logIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth'; import { fetchInstance } from 'soapbox/actions/instance'; import { closeModal } from 'soapbox/actions/modals'; +import { BigCard } from 'soapbox/components/big-card'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import { getRedirectUrl } from 'soapbox/utils/redirect'; import { isStandalone } from 'soapbox/utils/state'; +import ConsumersList from './consumers-list'; import LoginForm from './login-form'; import OtpAuthForm from './otp-auth-form'; @@ -68,7 +71,12 @@ const LoginPage = () => { if (mfaAuthNeeded) return ; - return ; + return ( + }> + + + + ); }; export default LoginPage; diff --git a/src/features/ui/index.tsx b/src/features/ui/index.tsx index 77520d0a5..e8672be8d 100644 --- a/src/features/ui/index.tsx +++ b/src/features/ui/index.tsx @@ -134,6 +134,7 @@ import { FollowedTags, AboutPage, RegistrationPage, + LoginPage, } from './util/async-components'; import GlobalHotkeys from './util/global-hotkeys'; import { WrappedRoute } from './util/react-router-helpers'; @@ -357,6 +358,8 @@ const SwitchingColumnsArea: React.FC = ({ children }) => )} + + );