From dd4f41f2465ee6eaf63c8b11992dd245e4bb4ccb Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 May 2022 11:52:56 -0500 Subject: [PATCH 1/5] ExternalLogin: move to AuthLayout instead of UI --- app/soapbox/containers/soapbox.tsx | 2 +- app/soapbox/features/auth_layout/index.tsx | 2 ++ app/soapbox/features/ui/index.tsx | 2 -- app/soapbox/pages/default_page.tsx | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index ffc19ad214..8ec61a6457 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -185,7 +185,7 @@ const SoapboxMount = () => { - + {(features.accountCreation && instance.registrations) && ( )} diff --git a/app/soapbox/features/auth_layout/index.tsx b/app/soapbox/features/auth_layout/index.tsx index 7a0d39c717..cb5edd8c47 100644 --- a/app/soapbox/features/auth_layout/index.tsx +++ b/app/soapbox/features/auth_layout/index.tsx @@ -11,6 +11,7 @@ import LoginPage from '../auth_login/components/login_page'; import PasswordReset from '../auth_login/components/password_reset'; import PasswordResetConfirm from '../auth_login/components/password_reset_confirm'; import RegistrationForm from '../auth_login/components/registration_form'; +import ExternalLoginForm from '../external_login/components/external-login-form'; import Verification from '../verification'; import EmailPassthru from '../verification/email_passthru'; @@ -44,6 +45,7 @@ const AuthLayout = () => { + diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 91eda245fc..6cf6515d68 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -76,7 +76,6 @@ import { // GroupRemovedAccounts, // GroupCreate, // GroupEdit, - ExternalLogin, Settings, MediaDisplay, EditProfile, @@ -173,7 +172,6 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { // Ex: use /login instead of /auth, but redirect /auth to /login return ( - diff --git a/app/soapbox/pages/default_page.tsx b/app/soapbox/pages/default_page.tsx index 1bf2c27319..21c9026f5b 100644 --- a/app/soapbox/pages/default_page.tsx +++ b/app/soapbox/pages/default_page.tsx @@ -8,13 +8,11 @@ import { SignUpPanel, } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; -import { isStandalone } from 'soapbox/utils/state'; import { Layout } from '../components/ui'; const DefaultPage: React.FC = ({ children }) => { const me = useAppSelector(state => state.me); - const standalone = useAppSelector(isStandalone); const features = useFeatures(); return ( @@ -24,7 +22,7 @@ const DefaultPage: React.FC = ({ children }) => { - {!me && !standalone && ( + {!me && ( {Component => } From 40f3b769fc8d1749a361815340bda7ece7fb9c26 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 May 2022 11:56:40 -0500 Subject: [PATCH 2/5] RegisterInvite: convert to TSX --- app/soapbox/features/register_invite/index.js | Bin 1360 -> 0 bytes .../features/register_invite/index.tsx | 43 ++++++++++++++++++ 2 files changed, 43 insertions(+) delete mode 100644 app/soapbox/features/register_invite/index.js create mode 100644 app/soapbox/features/register_invite/index.tsx diff --git a/app/soapbox/features/register_invite/index.js b/app/soapbox/features/register_invite/index.js deleted file mode 100644 index 486647bd2c4cfdcfd1be6d03aba4939b85e258d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1360 zcmbVMO^e$w5WV|XO!wjhvNn6&#LL1$VGk`O&83uL6nheDYfG*)PE&&adq0C#VS-}V}nC>df;?dnTahyCF-vv2zS~wZXp5dLP(zA5&#(Fx~h8xu#$0-N__O7 z=!o>H7T-h3m4wPLTtP?<5dK)MIJ;d3`~-OJoXzndnv&qTZ+S7}UItkytc7i-7R{?V zF(KfYQ04A38y&s8cg32R!HJa_xFPwWCB4>K7*W~BVVsfPzp>Aev|IeuNH*9hoHTVE zeZ*Evb(~>aM`&0Jn#HoG@g`mdYgXWyd7cSSA#LQeS$4sZ^>!}00AQ2L6Ld{~78NF; zpA#Bh64!e8)Z_k%Ow$4d>l$TnPVsP~c$)f24IED3X1={w1@06;=7Y-AtBib|8L%IA ze+QDgZ@LLj2zx{YJ}(E-@TMhi*LAVl4|lUVCs8(Nlgr3rXxj-W9=EWGi-$>E-}Inl z+a{*{p9Ni+i70@X1EJg85_zGiKya6k%_#M6=R(Fm5k3$KM3(7BQ4~&!%{r`y1~)OU v&?vmUP^rKC1D?C}w{7%i@zdGqpQw_HU*?Eh)WS%|gm@Gz*Q}gxN*nwIn;xqq diff --git a/app/soapbox/features/register_invite/index.tsx b/app/soapbox/features/register_invite/index.tsx new file mode 100644 index 0000000000..c4187c439e --- /dev/null +++ b/app/soapbox/features/register_invite/index.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import { FormattedMessage } from 'react-intl'; + +import RegistrationForm from 'soapbox/features/auth_login/components/registration_form'; +import { useAppSelector } from 'soapbox/hooks'; + +interface IRegisterInvite { + /** URL params. */ + params: { + /** Invite token from the URL. */ + token: string, + }, +} + +/** Page to register with an invitation. */ +const RegisterInvite: React.FC = ({ params }) => { + const siteTitle = useAppSelector(state => state.instance.title); + + return ( +
+
+

+ +

+

+ +

+
+
+ +
+
+ ); +}; + +export default RegisterInvite; From 6ff34d77fd36502ad4a2f1af0053a9499a977706 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 May 2022 12:02:13 -0500 Subject: [PATCH 3/5] RegisterInvite: move to AuthLayout --- app/soapbox/containers/soapbox.tsx | 1 + app/soapbox/features/auth_layout/index.tsx | 2 ++ app/soapbox/features/register_invite/index.tsx | 14 ++++++-------- app/soapbox/features/ui/index.tsx | 3 --- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index 8ec61a6457..11cf735d75 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -192,6 +192,7 @@ const SoapboxMount = () => { +
diff --git a/app/soapbox/features/auth_layout/index.tsx b/app/soapbox/features/auth_layout/index.tsx index cb5edd8c47..8c7ac36fc4 100644 --- a/app/soapbox/features/auth_layout/index.tsx +++ b/app/soapbox/features/auth_layout/index.tsx @@ -12,6 +12,7 @@ import PasswordReset from '../auth_login/components/password_reset'; import PasswordResetConfirm from '../auth_login/components/password_reset_confirm'; import RegistrationForm from '../auth_login/components/registration_form'; import ExternalLoginForm from '../external_login/components/external-login-form'; +import RegisterInvite from '../register_invite'; import Verification from '../verification'; import EmailPassthru from '../verification/email_passthru'; @@ -50,6 +51,7 @@ const AuthLayout = () => { + diff --git a/app/soapbox/features/register_invite/index.tsx b/app/soapbox/features/register_invite/index.tsx index c4187c439e..8709182206 100644 --- a/app/soapbox/features/register_invite/index.tsx +++ b/app/soapbox/features/register_invite/index.tsx @@ -1,19 +1,17 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; +import { useParams } from 'react-router-dom'; import RegistrationForm from 'soapbox/features/auth_login/components/registration_form'; import { useAppSelector } from 'soapbox/hooks'; -interface IRegisterInvite { - /** URL params. */ - params: { - /** Invite token from the URL. */ - token: string, - }, +interface RegisterInviteParams { + token: string, } /** Page to register with an invitation. */ -const RegisterInvite: React.FC = ({ params }) => { +const RegisterInvite: React.FC = () => { + const { token } = useParams(); const siteTitle = useAppSelector(state => state.instance.title); return ( @@ -34,7 +32,7 @@ const RegisterInvite: React.FC = ({ params }) => {

- +
); diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 6cf6515d68..14e9e59747 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -107,7 +107,6 @@ import { NotificationsContainer, ModalContainer, ProfileHoverCard, - RegisterInvite, Share, NewStatus, IntentionalError, @@ -288,8 +287,6 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { {features.scheduledStatuses && } - - From e0cc33178171f3a1a3f1fb675464d8def80e5c56 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 May 2022 12:04:28 -0500 Subject: [PATCH 4/5] Card: back button i18n --- app/soapbox/components/ui/card/card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/components/ui/card/card.tsx b/app/soapbox/components/ui/card/card.tsx index 350048a02a..9dd22bebe1 100644 --- a/app/soapbox/components/ui/card/card.tsx +++ b/app/soapbox/components/ui/card/card.tsx @@ -62,7 +62,7 @@ const CardHeader: React.FC = ({ children, backHref, onBackClick }): return ( - Back + {intl.formatMessage(messages.back)} ); }; From 0863a34bfc277f1a8576e71fca2166df3a52133d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 May 2022 12:11:08 -0500 Subject: [PATCH 5/5] RegisterInvite: use ui components https://gitlab.com/soapbox-pub/soapbox-fe/-/issues/910#note_938469624 --- .../features/register_invite/index.tsx | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/app/soapbox/features/register_invite/index.tsx b/app/soapbox/features/register_invite/index.tsx index 8709182206..e312c1126d 100644 --- a/app/soapbox/features/register_invite/index.tsx +++ b/app/soapbox/features/register_invite/index.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { useParams } from 'react-router-dom'; +import { Stack, CardTitle, Text } from 'soapbox/components/ui'; import RegistrationForm from 'soapbox/features/auth_login/components/registration_form'; import { useAppSelector } from 'soapbox/hooks'; @@ -14,27 +15,29 @@ const RegisterInvite: React.FC = () => { const { token } = useParams(); const siteTitle = useAppSelector(state => state.instance.title); + const title = ( + + ); + return ( -
-
-

- -

-

+ + + + + -

-
-
- -
-
+ + + + + ); };