diff --git a/packages/react/components/Account/Avatar.mjs b/packages/react/components/Account/Avatar.mjs index c590a167d49..eca3edc0ec1 100644 --- a/packages/react/components/Account/Avatar.mjs +++ b/packages/react/components/Account/Avatar.mjs @@ -12,8 +12,10 @@ import { useBackend } from '@freesewing/react/hooks/useBackend' // Components import { Link as WebLink } from '@freesewing/react/components/Link' -import { SaveIcon } from '@freesewing/react/components/Icon' +import { SaveIcon, RightIcon } from '@freesewing/react/components/Icon' import { PassiveImageInput } from '@freesewing/react/components/Input' +import { IconButton } from '@freesewing/react/components/Button' +import { WelcomeIcons } from './shared.mjs' /* * Component for the account/bio page @@ -67,10 +69,13 @@ export const Avatar = ({ welcome = false, Link = false }) => { /> {welcome ? ( <> - - {t('save')} - - + + + Save + + + Continue + {welcomeSteps[account.control].length > 0 ? ( <> { 7 / {welcomeSteps[account.control].length} - { {welcome ? ( <> - + + Continue + {welcomeSteps[account.control].length > 0 ? ( <> 6 / {welcomeSteps[account.control].length} - { /> {welcome ? ( <> - + + Continue + {welcomeSteps[account?.control].length > 0 ? ( <> 4 / {welcomeSteps[account?.control].length} - { ({ val, label: ( @@ -69,18 +71,20 @@ export const Control = ({ welcome = false }) => { /> {welcome ? ( <> - + + Continue + {welcomeSteps[control].length > 1 ? ( <> 1 / {welcomeSteps[control].length} - + > ) : null} > diff --git a/packages/react/components/Account/Links.mjs b/packages/react/components/Account/Links.mjs index 7faca7858fa..4cee1068344 100644 --- a/packages/react/components/Account/Links.mjs +++ b/packages/react/components/Account/Links.mjs @@ -83,7 +83,7 @@ const titles = { img: 'Avatar', email: 'E-mail Address', newsletter: 'Newsletter Subscription', - compare: 'Measurements Sets Comparison', + compare: 'Measurements Comparison', consent: 'Consent & Privacy', control: 'User Experience', github: 'GitHub', diff --git a/packages/react/components/Account/Newsletter.mjs b/packages/react/components/Account/Newsletter.mjs index 3d446ca0011..7efc6e012f6 100644 --- a/packages/react/components/Account/Newsletter.mjs +++ b/packages/react/components/Account/Newsletter.mjs @@ -12,24 +12,11 @@ import { useBackend } from '@freesewing/react/hooks/useBackend' // Components import { Link as WebLink } from '@freesewing/react/components/Link' -import { NoIcon, OkIcon, SaveIcon } from '@freesewing/react/components/Icon' +import { NoIcon, OkIcon, SaveIcon, RightIcon } from '@freesewing/react/components/Icon' import { ListInput } from '@freesewing/react/components/Input' import { Popout } from '@freesewing/react/components/Popout' - -const strings = { - yes: { - title: 'Yes, in case it may help me', - desc: - 'Allowing us to compare your measurments to a baseline or others measurements sets ' + - 'allows us to detect potential problems in your measurements or patterns.', - }, - no: { - title: 'No, never compare', - desc: - 'We get it, comparison is the thief of joy. Just be aware that this limits our ability ' + - 'to warn you about potential problems in your measurements sets or patterns.', - }, -} +import { IconButton } from '@freesewing/react/components/Button' +import { WelcomeIcons } from './shared.mjs' /* * Component for the account/preferences/newsletter page @@ -99,18 +86,20 @@ export const Newsletter = ({ welcome = false, Link = false }) => { /> {welcome ? ( <> - + + Continue + {welcomeSteps[account?.control].length > 0 ? ( <> 2 / {welcomeSteps[account?.control].length} - { ) : null} > ) : null} - - You can unsubscribe at any time with the link below - - This unsubscribe link will also be included at the bottom of every newsletter we send you, - so you do not need to bookmark it, but you can if you want to. - - - - Unsubscribe link - - - - This link is to unsubscribe you specifically, do not share it with other subscribers. - - + {welcome ? null : ( + + You can unsubscribe at any time with the link below + + This unsubscribe link will also be included at the bottom of every newsletter we send + you, so you do not need to bookmark it, but you can if you want to. + + + + Unsubscribe link + + + + This link is to unsubscribe you specifically, do not share it with other subscribers. + + + )} ) } diff --git a/packages/react/components/Account/Units.mjs b/packages/react/components/Account/Units.mjs index d181763f18a..75c3a94e1b2 100644 --- a/packages/react/components/Account/Units.mjs +++ b/packages/react/components/Account/Units.mjs @@ -11,9 +11,11 @@ import { useBackend } from '@freesewing/react/hooks/useBackend' // Components import { Link as WebLink } from '@freesewing/react/components/Link' -import { SaveIcon } from '@freesewing/react/components/Icon' +import { SaveIcon, RightIcon } from '@freesewing/react/components/Icon' import { ListInput } from '@freesewing/react/components/Input' import { NumberCircle } from '@freesewing/react/components/Number' +import { IconButton } from '@freesewing/react/components/Button' +import { WelcomeIcons } from './shared.mjs' /* * Component for the account/preferences/units page @@ -74,18 +76,20 @@ export const Units = ({ welcome = false }) => { /> {welcome ? ( <> - + + Continue + {welcomeSteps[account?.control].length > 0 ? ( <> 3 / {welcomeSteps[account?.control].length} - { {welcome ? ( <> - + + Continue + {welcomeSteps[account.control].length > 0 ? ( <> 5 / {welcomeSteps[account.control].length} - ( + + + +) +export const WelcomeTodoIcon = ({ href }) => ( + + + +) + +const WelcomeTopicIcon = (props) => { + const Icon = + props.href === '' || props.href === 'control' + ? ControlIcon + : icons[props.href] + ? icons[props.href] + : SettingsIcon + + return +} + +const WelcomeDoingIcon = ({ href }) => ( + +) + +export const WelcomeIcons = ({ done = [], todo = [], current = '' }) => ( + + {done.map((href) => ( + + ))} + + {todo.map((href) => ( + + ))} + +) + +const icons = { + newsletter: NewsletterIcon, + units: UnitsIcon, + compare: CompareIcon, + username: UserIcon, + bio: DocsIcon, + img: ShowcaseIcon, +} diff --git a/packages/react/components/Button/index.mjs b/packages/react/components/Button/index.mjs index ea2f31490c9..e2c5afeb52a 100644 --- a/packages/react/components/Button/index.mjs +++ b/packages/react/components/Button/index.mjs @@ -19,7 +19,7 @@ export const IconButton = ({ btnProps = {}, }) => { const allProps = { - className: `flex flex-row gap-2 lg:gap-12 items-center justify-between w-full lg:w-auto daisy-btn daisy-btn-${color} capitalize my-2 ${className}`, + className: `${staticLinkClasses} daisy-btn-${color} hover:text-${color}-content ${className}`, title: title, ...btnProps, } @@ -28,3 +28,5 @@ export const IconButton = ({ return onClick ? {children} : {children} } + +const staticLinkClasses = `flex flex-row gap-2 lg:gap-12 items-center justify-between w-full lg:w-auto daisy-btn hover:no-underline capitalize my-2` diff --git a/packages/react/components/Input/index.mjs b/packages/react/components/Input/index.mjs index 62b74848ab7..957b981736b 100644 --- a/packages/react/components/Input/index.mjs +++ b/packages/react/components/Input/index.mjs @@ -467,11 +467,11 @@ export const MarkdownInput = ({ > - + update(evt.target.value)} diff --git a/packages/react/hooks/useControl/index.mjs b/packages/react/hooks/useControl/index.mjs index f109e296638..5afb9255e02 100644 --- a/packages/react/hooks/useControl/index.mjs +++ b/packages/react/hooks/useControl/index.mjs @@ -12,8 +12,8 @@ import { useBackend } from '@freesewing/react/hooks/useBackend' */ export const useControl = () => { // Hooks - const { account, setAccount, token } = useAccount() const backend = useBackend() + const { account, setAccount, token } = useAccount() const { setLoadingStatus } = useContext(LoadingStatusContext) // State @@ -32,10 +32,10 @@ export const useControl = () => { } else setLoadingStatus([true, 'Failed to update preferences. Please report this', true, true]) } else { - /* - * Control is used even when people are not logged in - * So this ensures control is always available, even if people are not authenticated - */ + /* + * Control is used even when people are not logged in + * So this ensures control is always available, even if people are not authenticated + */ setAccount({ ...account, control: newControl }) setControl(newControl) } diff --git a/sites/org/src/pages/welcome.md b/sites/org/src/pages/welcome.md deleted file mode 100644 index 8c22be7be8b..00000000000 --- a/sites/org/src/pages/welcome.md +++ /dev/null @@ -1 +0,0 @@ -Welcome page goes here diff --git a/sites/org/src/pages/welcome/bio.js b/sites/org/src/pages/welcome/bio.js new file mode 100644 index 00000000000..8a8a771e210 --- /dev/null +++ b/sites/org/src/pages/welcome/bio.js @@ -0,0 +1,22 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Bio } from '@freesewing/react/components/Account' + +export default function WelcomeBioPage() { + return ( + + + + Bio + Feel free to shamelessly plug your YouTube channel or link to other places. + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/compare.js b/sites/org/src/pages/welcome/compare.js new file mode 100644 index 00000000000..c07bb30ad4a --- /dev/null +++ b/sites/org/src/pages/welcome/compare.js @@ -0,0 +1,30 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Compare } from '@freesewing/react/components/Account' + +export default function WelcomeComparePage() { + return ( + + + + Measurements Comparison + + Comparing measurements can help us detect problems, but it bums you out, we can forego + it. + + + Regardless of what you pick, you are a beautiful person and nothing compares to you + anyway + + + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/img.js b/sites/org/src/pages/welcome/img.js new file mode 100644 index 00000000000..d2acfd285ca --- /dev/null +++ b/sites/org/src/pages/welcome/img.js @@ -0,0 +1,22 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Avatar } from '@freesewing/react/components/Account' + +export default function WelcomeAvatarPage() { + return ( + + + + Avatar + A picture says more than a 1000 words. + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/index.js b/sites/org/src/pages/welcome/index.js new file mode 100644 index 00000000000..309308ebf89 --- /dev/null +++ b/sites/org/src/pages/welcome/index.js @@ -0,0 +1,22 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Control } from '@freesewing/react/components/Account' + +export default function WelcomeStartPage() { + return ( + + + + Welcome + We will ask you a few questions to set up your account. This won't take long. + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/newsletter.js b/sites/org/src/pages/welcome/newsletter.js new file mode 100644 index 00000000000..5f2f31d0cfd --- /dev/null +++ b/sites/org/src/pages/welcome/newsletter.js @@ -0,0 +1,22 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Newsletter } from '@freesewing/react/components/Account' + +export default function WelcomeNewsletterPage() { + return ( + + + + Newsletter + You wil get email from us every three months. No more. No less. + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/units.js b/sites/org/src/pages/welcome/units.js new file mode 100644 index 00000000000..9d77e2a2192 --- /dev/null +++ b/sites/org/src/pages/welcome/units.js @@ -0,0 +1,26 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Units } from '@freesewing/react/components/Account' + +export default function WelcomeNewsletterPage() { + return ( + + + + Units + + FreeSewing supports both metric units, and the imperial system. + + The latter one slightly reluctant, but support it we do. + + + + + + + + + + ) +} diff --git a/sites/org/src/pages/welcome/username.js b/sites/org/src/pages/welcome/username.js new file mode 100644 index 00000000000..2381691ca35 --- /dev/null +++ b/sites/org/src/pages/welcome/username.js @@ -0,0 +1,22 @@ +import Layout from '@theme/Layout' +import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus' +import { RoleBlock } from '@freesewing/react/components/Role' +import { Username } from '@freesewing/react/components/Account' + +export default function WelcomeComparePage() { + return ( + + + + Username + Everyone needs one. What will yours be? + + + + + + + + + ) +}
- This unsubscribe link will also be included at the bottom of every newsletter we send you, - so you do not need to bookmark it, but you can if you want to. -
- - Unsubscribe link - -
- This link is to unsubscribe you specifically, do not share it with other subscribers. -
+ This unsubscribe link will also be included at the bottom of every newsletter we send + you, so you do not need to bookmark it, but you can if you want to. +
+ + Unsubscribe link + +
+ This link is to unsubscribe you specifically, do not share it with other subscribers. +
Feel free to shamelessly plug your YouTube channel or link to other places.
+ Comparing measurements can help us detect problems, but it bums you out, we can forego + it. + + + Regardless of what you pick, you are a beautiful person and nothing compares to you + anyway + +
A picture says more than a 1000 words.
We will ask you a few questions to set up your account. This won't take long.
You wil get email from us every three months. No more. No less.
+ FreeSewing supports both metric units, and the imperial system. + + The latter one slightly reluctant, but support it we do. +
Everyone needs one. What will yours be?