diff --git a/packages/react/components/Role/index.mjs b/packages/react/components/Role/index.mjs index cf4b2fdd0d6..75d69d9ba69 100644 --- a/packages/react/components/Role/index.mjs +++ b/packages/react/components/Role/index.mjs @@ -8,22 +8,23 @@ import { useBackend } from '@freesewing/react/hooks/useBackend' import { Link as DefaultLink } from '@freesewing/react/components/Link' import { LockIcon, PlusIcon } from '@freesewing/react/components/Icon' import { Spinner } from '@freesewing/react/components/Spinner' +import { H1, H2, H3 } from '@freesewing/react/components/Heading' //import { ConsentForm, ns as gdprNs } from 'shared/components/gdpr/form.mjs' const ConsentForm = () => null const Wrap = ({ children }) => ( -
{children}
+
{children}
) const ContactSupport = ({ Link = false }) => { if (!Link) Link = DefaultLink return ( -
- - {t('contactSupport')} +
+ + Contact Support
) @@ -35,16 +36,19 @@ const AuthRequired = ({ Link, banner }) => { return ( {banner} -

Authentication Required

+

Authentication Required

This functionality requires a FreeSewing account

-
- +
+ Sign Up Sign In @@ -60,12 +64,12 @@ const AccountInactive = ({ Link, banner }) => { return ( {banner} -

{t('accountInactive')}

-

{t('accountInactiveMsg')}

-

{t('signupAgain')}

-
- - {t('signUp')} +

Account Inactive

+

You must activate your account via the signup link we sent you.

+

If you cannot find the link, you can receive a new one by signing up again.

+
+ + Sign Up
@@ -75,36 +79,42 @@ const AccountInactive = ({ Link, banner }) => { const AccountDisabled = ({ banner }) => ( {banner} -

{t('accountDisabled')}

-

{t('accountDisabledMsg')}

- +

Acccount Disabled

+

+ You cannot re-enable a disabled account. You need to contact support to resolve this + situation. +

+
) const AccountProhibited = ({ banner }) => ( {banner} -

{t('accountProhibited')}

-

{t('accountProhibitedMsg')}

- +

Your account has been disabled

+

Your account has been administratively disabled.

+
) -const AccountStatusUnknown = ({ t, banner }) => ( +const AccountStatusUnknown = ({ banner }) => ( {banner} -

{t('statusUnknown')}

-

{t('statusUnknownMsg')}

- +

Account status warning

+

Your account status prohibits us from processing your data. Please contact support.

+
) const RoleLacking = ({ t, requiredRole, role, banner }) => ( {banner} -

{t('roleLacking')}

-

- +

You lack the required role to access this content

+

+ This content requires the {requiredRole} role. Your role is {role} which does + not grant you access to this content. +

+
) @@ -132,7 +142,7 @@ const ConsentLacking = ({ banner, refresh }) => { return ( -
+
{banner}
@@ -140,8 +150,6 @@ const ConsentLacking = ({ banner, refresh }) => { ) } -const t = (input) => input - export const RoleBlock = ({ children, user = false, Link = false }) => { if (!Link) Link = DefaultLink let requiredRole = 'admin' @@ -181,9 +189,8 @@ export const RoleBlock = ({ children, user = false, Link = false }) => { } else { if (data?.error?.error) setError(data.error.error) else { - console.log('WOULD SIGN OUT', data) + signOut() } - //else signOut() } setReady(true) } @@ -200,26 +207,20 @@ export const RoleBlock = ({ children, user = false, Link = false }) => { setError(false) } - if (!ready) - return ( - <> -

not ready

- - - ) + if (!ready) return const banner = impersonating ? ( -
- +
+ Hi {impersonating.admin}, you are currently impersonating {impersonating.user} -
) : null - const childProps = { t, banner } + const childProps = { banner } if (!token || !account.username) return if (error) { diff --git a/packages/react/components/SignIn/index.mjs b/packages/react/components/SignIn/index.mjs index 26e4d2c4dfc..e78891d454c 100644 --- a/packages/react/components/SignIn/index.mjs +++ b/packages/react/components/SignIn/index.mjs @@ -19,6 +19,7 @@ import { UserIcon, } from '@freesewing/react/components/Icon' import { MfaInput, StringInput, PasswordInput } from '@freesewing/react/components/Input' +import { H1, H2, H3, H4 } from '@freesewing/react/components/Heading' /* * This SignIn component holds the entire sign-in form @@ -126,43 +127,49 @@ export const SignIn = ({ onSuccess = false }) => { } } - const btnClasses = `daisy-btn capitalize w-full mt-4 ${ - signInFailed ? 'daisy-btn-warning' : 'daisy-btn-primary' - } transition-colors ease-in-out duration-300 ${horFlexClasses}` + const btnClasses = `tw-daisy-btn tw-capitalize tw-w-full tw-mt-4 ${ + signInFailed ? 'tw-daisy-btn-warning' : 'tw-daisy-btn-primary' + } tw-transition-colors tw-ease-in-out tw-duration-300 ${horFlexClassesNoSm}` const noBueno = ( <> - {signInFailed} + {signInFailed} ) if (magicLinkSent) return ( - <> -

Email Sent

-

+ +

Email Sent

+

Go check your inbox for an email from FreeSewing.org

-

+

Click the sign-in link in that email to sign in to your FreeSewing account.

-
- - + Contact support
- + ) if (mfa) return ( - <> -

MFA Code

-

+ +

MFA Code

+

Please provide a one-time MFA code, or a backup scratch code

{ noBueno ) : ( <> - + - Sign In - + Sign In + )} -
- - + Contact support
- + ) return ( -
-

{seenBefore ? `Welcome back ${seenUser}` : 'Welcome'}

-

Sign in to FreeSewing

+ +

{seenBefore ? `Welcome back ${seenUser}` : 'Welcome'}

+

Sign in to FreeSewing

{!seenBefore && ( { )} {magicLink ? ( -
+
{['Google', 'Github'].map((provider) => (
{seenBefore ? ( ) : ( - + Sign up here )} -
+
) } + +const WrapForm = ({ children }) =>
{children}