diff --git a/sites/org/pages/index.mjs b/sites/org/pages/index.mjs index 82159d7a949..fa2ca1457e0 100644 --- a/sites/org/pages/index.mjs +++ b/sites/org/pages/index.mjs @@ -19,7 +19,6 @@ import { HelpIcon, ChatIcon, } from 'shared/components/icons.mjs' -import { FreeSewingAnimation } from 'shared/components/animations/freesewing.mjs' import { HowDoesItWorkAnimation } from 'shared/components/animations/how-does-it-work.mjs' import { SignUp, ns as susiNs } from 'shared/components/susi/sign-up.mjs' import { PleaseSubscribe, ns as subNs } from 'shared/components/patrons/please-subscribe.mjs' @@ -49,7 +48,7 @@ const CardLink = ({

@@ -71,9 +70,6 @@ const HomePage = ({ page }) => { const { account } = useAccount() const [user, setUser] = useState(false) - // Duration of the FreeSewing animation - const duration = 6.66 - useEffect(() => { // Do this here to avoid hydration issues if (account.username) setUser(account.username) @@ -85,31 +81,10 @@ const HomePage = ({ page }) => { FreeSewing.org -
- -
-
-
-
- -
-
-

{t('homepage:whyBother')}

-
    - {[1, 2, 3, 4].map((i) => ( -
  • - {t(`homepage:why${i}`)} -
  • - ))} -
- -
{t('homepage:alphaTitle')}
-

{t('homepage:alphaWarning')}

-
-
-
+
+
@@ -129,16 +104,25 @@ const HomePage = ({ page }) => {
-
-

{t('howDoesItWork')}

- +
+
+
+ +
+
+

{t('homepage:whyBother')}

+
    + {[1, 2, 3, 4].map((i) => ( +
  • + {t(`homepage:why${i}`)} +
  • + ))} +
+
+
-
- -
-
{ />
+
+ +
+
{
-
) diff --git a/sites/org/pages/signup/index.mjs b/sites/org/pages/signup/index.mjs index 5d69081f32b..470519a6e76 100644 --- a/sites/org/pages/signup/index.mjs +++ b/sites/org/pages/signup/index.mjs @@ -5,7 +5,6 @@ import { nsMerge } from 'shared/utils.mjs' import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' import { BareLayout } from 'site/components/layouts/bare.mjs' import { SignUp, ns as susiNs } from 'shared/components/susi/sign-up.mjs' -import { FreeSewingAnimation } from 'shared/components/animations/freesewing.mjs' // Translation namespaces used on this page const ns = nsMerge(susiNs, pageNs) @@ -17,7 +16,6 @@ const SignUpPage = ({ page }) => {
-
) diff --git a/sites/shared/components/susi/sign-up.mjs b/sites/shared/components/susi/sign-up.mjs index f06f9130bd2..e4d827b37b1 100644 --- a/sites/shared/components/susi/sign-up.mjs +++ b/sites/shared/components/susi/sign-up.mjs @@ -2,6 +2,7 @@ import { useState, useContext } from 'react' import { useBackend } from 'shared/hooks/use-backend.mjs' import { useTranslation } from 'next-i18next' +import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs' // Context import { ModalContext } from 'shared/context/modal-context.mjs' // Dependencies @@ -17,6 +18,7 @@ import { KeyIcon, SettingsIcon, EmailIcon, + DownIcon, } from 'shared/components/icons.mjs' import { ModalWrapper } from 'shared/components/wrappers/modal.mjs' import { EmailInput } from 'shared/components/inputs.mjs' @@ -30,11 +32,12 @@ export const SignUp = () => { const backend = useBackend() const { t, i18n } = useTranslation(ns) + const { setLoadingStatus, LoadingStatus } = useLoadingStatus() const [email, setEmail] = useState('') const [emailValid, setEmailValid] = useState(false) const [result, setResult] = useState(false) - const [loading, setLoading] = useState(false) + const [showAll, setShowAll] = useState(false) const updateEmail = (value) => { setEmail(value) @@ -44,8 +47,10 @@ export const SignUp = () => { const signupHandler = async (evt) => { evt.preventDefault() - setLoading(true) - if (!emailValid) return + if (!emailValid) { + setLoadingStatus([true, t('susi:pleaseProvideValidEmail'), true, false]) + return + } let res try { res = await backend.signUp({ @@ -80,14 +85,12 @@ export const SignUp = () => { ) } - setLoading(false) } - const loadingClasses = loading ? 'opacity-50' : '' - return (
-

+ +

{result ? ( result === 'success' ? ( {t('susi:emailSent')}! @@ -132,58 +135,80 @@ export const SignUp = () => { ) ) : ( <> -

{t('toReceiveSignupLink')}:

+

{t('toReceiveSignupLink')}:

emailValid} placeholder={t('susi:emailAddress')} update={updateEmail} /> -
- {['Google', 'Github'].map((provider) => ( - + ))} +
+ - {provider === 'Google' ? : } - {t('susi:signUpWithProvider', { provider })} + + + + {t('susi:signInHere')} + + + + + + {t('susi:migrateV2Account')} + +
+ +
+ + ) : ( +
+ - ))} -
- - - - - {t('susi:signInHere')} - - - - - - {t('susi:migrateV2Account')} - +

+ )} )}