wip(sde): Trimming file list
This commit is contained in:
parent
ec802de588
commit
ad5a14ad49
83 changed files with 2206 additions and 2069 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -105,7 +105,6 @@ sites/*/out
|
|||
sites/*/public/mdx
|
||||
sites/*/prebuild
|
||||
!sites/shared/prebuild
|
||||
sites/shared/prebuild/data
|
||||
sites/dev/public/og
|
||||
|
||||
# misc
|
||||
|
|
|
@ -57,6 +57,10 @@ yarn-error.log*
|
|||
|
||||
`,
|
||||
fetch: {
|
||||
// account:
|
||||
// sets
|
||||
// shared
|
||||
// control
|
||||
config: [
|
||||
{
|
||||
from: 'measurements.mjs',
|
||||
|
@ -73,7 +77,15 @@ yarn-error.log*
|
|||
],
|
||||
sites: [
|
||||
// Mock MDX components
|
||||
...['highlight', 'youtube', 'read-more', 'tabbed-example'].map((file) => ({
|
||||
...[
|
||||
'highlight',
|
||||
'youtube',
|
||||
'read-more',
|
||||
'tabbed-example',
|
||||
'http',
|
||||
'legend',
|
||||
'docs-helpers',
|
||||
].map((file) => ({
|
||||
from: `sde/mock/${file}.mjs`,
|
||||
to: `shared/components/mdx/${file}.mjs`,
|
||||
})),
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
DesignIcon,
|
||||
DocsIcon,
|
||||
MenuIcon,
|
||||
UserIcon,
|
||||
LockIcon,
|
||||
ThemeIcon,
|
||||
I18nIcon,
|
||||
MeasieIcon,
|
||||
|
@ -49,34 +49,34 @@ const NavIcons = ({ setModal }) => {
|
|||
>
|
||||
<RocketIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavButton href="/docs" label={t('header:docs')} color={spectrum[3]}>
|
||||
<NavButton href="/docs" label={t('sde:docs')} color={spectrum[3]}>
|
||||
<DocsIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavButton href="/code" label={t('sde:code')} color={spectrum[4]}>
|
||||
<GitHubIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavSpacer />
|
||||
<NavButton href="/account" label={t('header:account')} color={spectrum[5]}>
|
||||
<UserIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavButton href="/support" label={t('sde:support')} color={spectrum[6]}>
|
||||
<NavButton href="/support" label={t('sde:support')} color={spectrum[5]}>
|
||||
<HelpIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavSpacer />
|
||||
<NavButton
|
||||
onClick={() => setModal(<ModalThemePicker />)}
|
||||
label={t('header:theme')}
|
||||
color={spectrum[7]}
|
||||
color={spectrum[6]}
|
||||
>
|
||||
<ThemeIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavButton
|
||||
onClick={() => setModal(<ModalLocalePicker />)}
|
||||
label={t('header:language')}
|
||||
color={spectrum[8]}
|
||||
color={spectrum[7]}
|
||||
>
|
||||
<I18nIcon className={iconSize} />
|
||||
</NavButton>
|
||||
<NavSpacer />
|
||||
<NavButton href="/signin" label={t('account:signin')} color={spectrum[8]}>
|
||||
<LockIcon className={iconSize} />
|
||||
</NavButton>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
2
sites/sde/mock/docs-helpers.mjs
Normal file
2
sites/sde/mock/docs-helpers.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const DocsTitle = () => null
|
||||
export const DocsLink = () => null
|
2
sites/sde/mock/http.mjs
Normal file
2
sites/sde/mock/http.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const HttpMethod = () => null
|
||||
export const HttpStatusCode = () => null
|
1
sites/sde/mock/legend.mjs
Normal file
1
sites/sde/mock/legend.mjs
Normal file
|
@ -0,0 +1 @@
|
|||
export const Legend = () => null
|
|
@ -1,7 +1,7 @@
|
|||
import path from 'path'
|
||||
import i18nConfig from './next-i18next.config.js'
|
||||
// Remark plugins
|
||||
//import remarkFrontmatter from 'remark-frontmatter'
|
||||
import remarkFrontmatter from 'remark-frontmatter'
|
||||
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import smartypants from 'remark-smartypants'
|
||||
|
@ -33,12 +33,7 @@ const config = {
|
|||
options: {
|
||||
providerImportSource: '@mdx-js/react',
|
||||
format: 'mdx',
|
||||
remarkPlugins: [
|
||||
//remarkFrontmatter,
|
||||
remarkMdxFrontmatter,
|
||||
remarkGfm,
|
||||
smartypants,
|
||||
],
|
||||
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm, smartypants],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -56,6 +51,7 @@ const config = {
|
|||
// Aliases
|
||||
config.resolve.alias.shared = path.resolve('./shared/')
|
||||
config.resolve.alias.config = path.resolve('./shared/config/')
|
||||
config.resolve.alias.pkgs = path.resolve('./pkgs/')
|
||||
config.resolve.alias.site = path.resolve(`./`)
|
||||
|
||||
return config
|
||||
|
|
52
sites/sde/pages/account.mjs
Normal file
52
sites/sde/pages/account.mjs
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { Popout, ns as popoutNs } from 'shared/components/popout/index.mjs'
|
||||
import { PageLink, WebLink } from 'shared/components/link.mjs'
|
||||
import { FreeSewingIcon } from 'shared/components/icons.mjs'
|
||||
import { collection } from 'site/hooks/use-design.mjs'
|
||||
|
||||
const ns = nsMerge('sde', 'account', pageNs, popoutNs)
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={false}>
|
||||
<div className="max-w-prose text-center">
|
||||
<h1>{t('header:account')}</h1>
|
||||
<h5>To manage your FreeSewing account, please go to FreeSewing.org</h5>
|
||||
<p>
|
||||
You can use the data in your account, but this development environment does not come with
|
||||
account management features.
|
||||
</p>
|
||||
<a href="https://freesewing.org/" className="btn btn-secondary btn-lg mt-4 px-12">
|
||||
FreeSewing.org
|
||||
</a>
|
||||
</div>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: [],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, capitalize } from 'shared/utils.mjs'
|
||||
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
||||
import { siteConfig } from 'site/site.config.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as platformNs } from 'shared/components/account/platform.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(platformNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicPlatform = dynamic(
|
||||
() => import('shared/components/account/platform.mjs').then((mod) => mod.PlatformSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page, platform }) => (
|
||||
<PageWrapper {...page} title={capitalize(platform)}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPlatform platform={platform} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
platform: params.platform,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', params.platform],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
*
|
||||
* On this page, it is returning a truncated list of routes (think URLs) for all
|
||||
* the mdx blog (markdown) content.
|
||||
* That list comes from prebuild/blog-paths.mjs, which is built in the prebuild step
|
||||
* and contains paths, titles, imageUrls, and intro for all blog posts.
|
||||
*
|
||||
* the fallback: 'blocking' property means that
|
||||
* any pages that haven't been pre-generated
|
||||
* will generate and cache the first time someone visits them
|
||||
*
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => {
|
||||
const paths = []
|
||||
for (const platform of Object.keys(freeSewingConfig.account.fields.identities).filter(
|
||||
(key) => key !== 'github'
|
||||
)) {
|
||||
for (const locale of siteConfig.languages) {
|
||||
paths.push({ params: { platform }, locale })
|
||||
}
|
||||
}
|
||||
|
||||
return { paths, fallback: true }
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as apikeysNs } from 'shared/components/account/apikeys.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(apikeysNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicApikey = dynamic(
|
||||
() => import('shared/components/account/apikeys.mjs').then((mod) => mod.Apikey),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const ApikeyPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [apikey, setApikey] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getApikey = async () => {
|
||||
const result = await backend.getApikey(id)
|
||||
if (result.success) setApikey(result.data.apikey)
|
||||
else setLoadingStatus([false])
|
||||
}
|
||||
getApikey()
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('apikeys')}: ${apikey?.name}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicApikey apikey={apikey} t={t} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default ApikeyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'apikeys', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: true })
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as apikeysNs } from 'shared/components/account/apikeys.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(apikeysNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicApikeys = dynamic(
|
||||
() => import('shared/components/account/apikeys.mjs').then((mod) => mod.Apikeys),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountApikeysPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('apikeys')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicApikeys />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountApikeysPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'apikeys'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as bioNs } from 'shared/components/account/bio.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(bioNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicBio = dynamic(
|
||||
() => import('shared/components/account/bio.mjs').then((mod) => mod.BioSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountBioPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('bio')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicBio title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountBioPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bio'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as bookmarksNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(bookmarksNs, authNs, pageNs, 'status')
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicBookmark = dynamic(
|
||||
() => import('shared/components/account/bookmarks.mjs').then((mod) => mod.Bookmark),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const BookmarkPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [bookmark, setBookmark] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getBookmark = async () => {
|
||||
const result = await backend.getBookmark(id)
|
||||
if (result.success) setBookmark(result.data.bookmark)
|
||||
else setLoadingStatus([false])
|
||||
}
|
||||
getBookmark()
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('bookmarks')}: ${bookmark?.title}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicBookmark bookmark={bookmark} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default BookmarkPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmarks', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: true })
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as bookmarksNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(bookmarksNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicBookmarks = dynamic(
|
||||
() => import('shared/components/account/bookmarks.mjs').then((mod) => mod.Bookmarks),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountBookmarksPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('bookmarks')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicBookmarks />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountBookmarksPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmarks'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as compareNs } from 'shared/components/account/compare.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(compareNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicCompare = dynamic(
|
||||
() => import('shared/components/account/compare.mjs').then((mod) => mod.CompareSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountComparePage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('compare')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicCompare title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountComparePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'compare'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as consentNs } from 'shared/components/account/consent.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const namespaces = [...new Set([...consentNs, ...authNs, ...pageNs])]
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicConsent = dynamic(
|
||||
() => import('shared/components/account/consent.mjs').then((mod) => mod.ConsentSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountConsentPage = ({ page }) => (
|
||||
<PageWrapper {...page}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicConsent title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
||||
export default AccountConsentPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, namespaces)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'consent'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as controlNs } from 'shared/components/account/control.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(controlNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicControl = dynamic(
|
||||
() => import('shared/components/account/control.mjs').then((mod) => mod.ControlSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('control')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicControl title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'control'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as emailNs } from 'shared/components/account/email.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(emailNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicEmail = dynamic(
|
||||
() => import('shared/components/account/email.mjs').then((mod) => mod.EmailSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountEmailPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('email')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicEmail title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountEmailPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'email'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as reloadNs } from 'shared/components/account/reload.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(reloadNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicExport = dynamic(
|
||||
() => import('shared/components/account/export.mjs').then((mod) => mod.ExportAccount),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountExportPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('export')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicExport title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountExportPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'export'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as githubNs } from 'shared/components/account/github.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(githubNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicGithub = dynamic(
|
||||
() => import('shared/components/account/github.mjs').then((mod) => mod.GithubSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page }) => (
|
||||
<PageWrapper {...page} title="GitHub">
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicGithub title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'github'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as imgNs } from 'shared/components/account/img.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(imgNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicImg = dynamic(
|
||||
() => import('shared/components/account/img.mjs').then((mod) => mod.ImgSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} t={t('img')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicImg title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'img'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('account', 'status', pageNs, authNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicAccountOverview = dynamic(
|
||||
() => import('shared/components/account/overview.mjs').then((mod) => mod.AccountOverview),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const AccountIndexPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('yourAccount')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicAccountOverview />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountIndexPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { siteConfig } from 'site/site.config.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as languageNs } from 'shared/components/account/language.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(languageNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicLanguage = dynamic(
|
||||
() => import('shared/components/account/language.mjs').then((mod) => mod.LanguageSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountLanguagePage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('account:language')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicLanguage title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountLanguagePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
// We are loading all languages here so we can show each language in its own language
|
||||
...(await serverSideTranslations(
|
||||
locale,
|
||||
ns,
|
||||
null,
|
||||
siteConfig.languages.filter((lang) => lang !== locale)
|
||||
)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'language'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as mfaNs } from 'shared/components/account/mfa.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(mfaNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicMfa = dynamic(
|
||||
() => import('shared/components/account/mfa.mjs').then((mod) => mod.MfaSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountMfaPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('mfa')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicMfa title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountMfaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'mfa'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as newsletterNs } from 'shared/components/account/newsletter.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(newsletterNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicNewsletter = dynamic(
|
||||
() => import('shared/components/account/newsletter.mjs').then((mod) => mod.NewsletterSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountNewsletterPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('newsletter')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicNewsletter title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountNewsletterPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'newsletter'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as passwordNs } from 'shared/components/account/password.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(passwordNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicPassword = dynamic(
|
||||
() => import('shared/components/account/password.mjs').then((mod) => mod.PasswordSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPasswordPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('password')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPassword title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountPasswordPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'password'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useDesign } from 'site/hooks/use-design.mjs'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { Workbench, ns as wbNs } from 'shared/components/workbench/new.mjs'
|
||||
import { WorkbenchLayout } from 'site/components/layouts/workbench.mjs'
|
||||
import { DynamicOrgDocs as DynamicDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||
import { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ design, id, settings }) => {
|
||||
const Design = useDesign(design)
|
||||
|
||||
return (
|
||||
<Workbench
|
||||
preload={{ settings }}
|
||||
saveAs={{ pattern: id }}
|
||||
{...{ design, Design, DynamicDocs }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const EditDesignPage = ({ page, design, id }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
const [pattern, setPattern] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const getPattern = async () => {
|
||||
setLoadingStatus([true, t('backendLoadingStarted')])
|
||||
let result
|
||||
try {
|
||||
result = await backend.getPattern(id)
|
||||
if (result.success) {
|
||||
setPattern(result.data.pattern)
|
||||
setLoadingStatus([true, 'backendLoadingCompleted', true, true])
|
||||
} else setLoadingStatus([true, 'backendError', true, false])
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={design} layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent design={pattern.design} id={pattern.id} settings={pattern.settings} />
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
<p>Give it a moment</p>
|
||||
</div>
|
||||
)}
|
||||
<pre>{JSON.stringify(pattern, null, 2)}</pre>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditDesignPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', params.id, 'edit'],
|
||||
title: '',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
*/
|
||||
export async function getStaticPaths() {
|
||||
return {
|
||||
paths: [],
|
||||
fallback: 'blocking',
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as patternsNs } from 'shared/components/account/patterns.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(patternsNs, authNs, pageNs, 'status')
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicPattern = dynamic(
|
||||
() => import('shared/components/account/patterns.mjs').then((mod) => mod.Pattern),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const PatternPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('patterns')}: #${id}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPattern id={id} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default PatternPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: true })
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicPatterns = dynamic(
|
||||
() => import('shared/components/account/patterns.mjs').then((mod) => mod.Patterns),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountSetsPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('patterns')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPatterns />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountSetsPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
* This `/account/privacy` page is merely an alias for the `/account/consent` page
|
||||
*/
|
||||
import Page, { getStaticProps as gsp } from './consent.mjs'
|
||||
|
||||
export const getStaticProps = gsp
|
||||
export default Page
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as reloadNs } from 'shared/components/account/reload.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(reloadNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicReload = dynamic(
|
||||
() => import('shared/components/account/reload.mjs').then((mod) => mod.ReloadAccount),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountReloadPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('reload')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicReload title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountReloadPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'reload'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as reloadNs } from 'shared/components/account/reload.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(reloadNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicRemove = dynamic(
|
||||
() => import('shared/components/account/remove.mjs').then((mod) => mod.RemoveAccount),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountRemovePage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('remove')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicRemove />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountRemovePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'remove'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as reloadNs } from 'shared/components/account/reload.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(reloadNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicRestrict = dynamic(
|
||||
() => import('shared/components/account/restrict.mjs').then((mod) => mod.RestrictAccount),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountRestrictPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('restrict')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicRestrict />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountRestrictPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'restrict'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicSet = dynamic(
|
||||
() => import('shared/components/account/sets.mjs').then((mod) => mod.Mset),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const SetPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('sets')}: #${id}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicSet id={id} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default SetPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'sets', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: true })
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicSets = dynamic(
|
||||
() => import('shared/components/account/sets.mjs').then((mod) => mod.Sets),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountSetsPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('sets')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicSets />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountSetsPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmarks'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as unitsNs } from 'shared/components/account/imperial.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const namespaces = nsMerge(unitsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicImperial = dynamic(
|
||||
() => import('shared/components/account/imperial.mjs').then((mod) => mod.ImperialSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountUnitsPage = ({ page }) => {
|
||||
const { t } = useTranslation(namespaces)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('account:units')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicImperial title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountUnitsPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, namespaces)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'units'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as usernameNs } from 'shared/components/account/username.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(usernameNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicUsername = dynamic(
|
||||
() => import('shared/components/account/username.mjs').then((mod) => mod.UsernameSettings),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('username')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicUsername title />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'username'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ import nl, { frontmatter as nlFrontmatter } from './nl.mdx'
|
|||
import fr, { frontmatter as frFrontmatter } from './fr.mdx'
|
||||
import uk, { frontmatter as ukFrontmatter } from './uk.mdx'
|
||||
|
||||
const ns = [pageNs, 'sde']
|
||||
const ns = [pageNs, 'sde', 'account']
|
||||
|
||||
const mdx = { en, de, es, nl, fr, uk }
|
||||
const frontmatter = {
|
||||
|
|
|
@ -13,7 +13,7 @@ import nl, { frontmatter as nlFrontmatter } from './nl.mdx'
|
|||
import fr, { frontmatter as frFrontmatter } from './fr.mdx'
|
||||
import uk, { frontmatter as ukFrontmatter } from './uk.mdx'
|
||||
|
||||
const ns = [pageNs, 'sde']
|
||||
const ns = [pageNs, 'sde', 'account']
|
||||
|
||||
const mdx = { en, de, es, nl, fr, uk }
|
||||
const frontmatter = {
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
// Hooks
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
import { useDesign } from 'site/hooks/use-design.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { Workbench, ns as wbNs } from 'shared/components/workbench/new.mjs'
|
||||
import { WorkbenchLayout } from 'site/components/layouts/workbench.mjs'
|
||||
import { Null } from 'shared/components/null.mjs'
|
||||
import { DynamicOrgDocs as DynamicDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const namespaces = [...new Set(['aaron', ...wbNs, ...pageNs])]
|
||||
|
||||
const EditPatternPage = ({ page, id }) => {
|
||||
// State
|
||||
const [pattern, setPattern] = useState(false)
|
||||
|
||||
// Hooks
|
||||
const backend = useBackend()
|
||||
const Design = useDesign(pattern?.design)
|
||||
|
||||
// Effect
|
||||
useEffect(() => {
|
||||
const getPattern = async () => {
|
||||
const result = await backend.getPattern(id)
|
||||
if (result.success) setPattern(result.data.pattern)
|
||||
}
|
||||
// Guard against loops as the backend object is recreated on each render
|
||||
if (pattern === false) getPattern()
|
||||
else if (pattern.id && pattern.id !== id) getPattern()
|
||||
}, [id, pattern, backend])
|
||||
|
||||
const baseSettings = pattern
|
||||
? {
|
||||
...pattern.settings,
|
||||
measurements: pattern.set ? pattern.set.measies : pattern.cset.measies,
|
||||
}
|
||||
: null
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} layout={WorkbenchLayout} header={Null}>
|
||||
<Workbench
|
||||
design={pattern?.design}
|
||||
from={{ type: 'pattern', data: pattern }}
|
||||
{...{ Design, DynamicDocs, baseSettings }}
|
||||
/>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPatternPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, namespaces)),
|
||||
id: Number(params.id),
|
||||
page: {
|
||||
locale,
|
||||
path: ['new', 'pattern', 'aaron', 'set', params.id],
|
||||
title: '',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return {
|
||||
paths: [],
|
||||
fallback: true,
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as patternsNs } from 'shared/components/account/patterns.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(patternsNs, authNs, pageNs, 'status')
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicPattern = dynamic(
|
||||
() => import('shared/components/account/patterns.mjs').then((mod) => mod.ShowPattern),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const PatternPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('patterns')}: #${id}`}>
|
||||
<DynamicPattern id={id} />
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default PatternPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: true })
|
|
@ -1,53 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const namespaces = [...new Set([...setsNs, ...authNs, ...pageNs])]
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicPatterns = dynamic(
|
||||
() => import('shared/components/account/patterns.mjs').then((mod) => mod.Patterns),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const PatternsIndexPage = ({ page }) => (
|
||||
<PageWrapper {...page}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPatterns standAlone={1} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
||||
export default PatternsIndexPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, namespaces)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['patterns'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ tutorial.d: Follow along with our design tutorial
|
|||
design: Design
|
||||
support: Support
|
||||
code: Code
|
||||
docs: Documentation
|
||||
chooseATemplate: Choose a template
|
||||
pageLeftBlank: Blank page
|
||||
pageLeftBlankMsg: This page was intentionally left blank.
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, pageNs)
|
||||
|
||||
const DynamicSet = dynamic(
|
||||
() => import('shared/components/account/sets.mjs').then((mod) => mod.Mset),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const SetPage = ({ page, id }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('sets')}: #${id}`}>
|
||||
<DynamicSet id={id} publicOnly />
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default SetPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['sets', params.id],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||
* this page should be used to generate the result.
|
||||
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||
*/
|
||||
export const getStaticPaths = async () => ({ paths: [], fallback: false })
|
0
sites/sde/pkgs/.gitkeep
Normal file
0
sites/sde/pkgs/.gitkeep
Normal file
|
@ -12,8 +12,8 @@ prebuildRunner({
|
|||
// Always prebuild
|
||||
i18n: true,
|
||||
navigation: true,
|
||||
designs: true,
|
||||
// Never prebuild
|
||||
designs: false,
|
||||
favicon: false,
|
||||
ogImages: false,
|
||||
docs: false,
|
||||
|
|
54
sites/sde/public/img/lineup-backdrop.svg
Normal file
54
sites/sde/public/img/lineup-backdrop.svg
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 -20 300 220" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
<path d="M 0 200 L 300 200" id="floor" stroke="#ccc" stroke-width="1" />
|
||||
<g id="metric">
|
||||
<g fill="#000" fill-opacity="0.1">
|
||||
<rect x="0" y="0" width="300" height="20" />
|
||||
<rect x="0" y="40" width="300" height="20" />
|
||||
<rect x="0" y="80" width="300" height="20" />
|
||||
<rect x="0" y="120" width="300" height="20" />
|
||||
<rect x="0" y="160" width="300" height="20" />
|
||||
</g>
|
||||
<g fill="#fff" fill-opacity="0.1">
|
||||
<rect x="0" y="20" width="300" height="20" />
|
||||
<rect x="0" y="60" width="300" height="20" />
|
||||
<rect x="0" y="100" width="300" height="20" />
|
||||
<rect x="0" y="140" width="300" height="20" />
|
||||
<rect x="0" y="180" width="300" height="20" />
|
||||
</g>
|
||||
<text fill="#000" font-size="4">
|
||||
<tspan x="1" y="140">0.60m</tspan>
|
||||
<tspan x="1" y="120">0.80m</tspan>
|
||||
<tspan x="1" y="100">1.00m</tspan>
|
||||
<tspan x="1" y="80">1.20m</tspan>
|
||||
<tspan x="1" y="60">1.40m</tspan>
|
||||
<tspan x="1" y="40">1.60m</tspan>
|
||||
<tspan x="1" y="20">1.80m</tspan>
|
||||
<tspan x="1" y="0">2.00m</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g id="imperial">
|
||||
<path d="M 0 -13.36 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 -13.36 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<path d="M 0 17.12 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 17.12 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<path d="M 0 47.6 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 47.6 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<path d="M 0 78.08 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 78.08 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<path d="M 0 108.56 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 108.56 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<path d="M 0 139.31 h 300" stroke-width="0.5" stroke="#000" stroke-dasharray="10 10" stroke-opacity="0.4" />
|
||||
<path d="M 0 139.31 h 300" stroke-width="0.5" stroke="#fff" stroke-dasharray="10 10" stroke-dashoffset="10" stroke-opacity="0.4" />
|
||||
<text fill="#000" font-size="4" text-anchor="end">
|
||||
<tspan x="299" y="139.31">2f</tspan>
|
||||
<tspan x="299" y="108.56">3f</tspan>
|
||||
<tspan x="299" y="78.08">4f</tspan>
|
||||
<tspan x="299" y="47.6">5f</tspan>
|
||||
<tspan x="299" y="17.12">6f</tspan>
|
||||
<tspan x="299" y="-13.36">7f</tspan>
|
||||
</text>
|
||||
</g>
|
||||
|
||||
</svg>
|
After Width: | Height: | Size: 3 KiB |
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"design": "Design",
|
||||
"support": "Support",
|
||||
"code": "Code",
|
||||
"docs": "Documentation",
|
||||
"chooseATemplate": "Choose a template",
|
||||
"pageLeftBlank": "Blank page",
|
||||
"pageLeftBlankMsg": "This page was intentionally left blank.",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useEffect } from 'react'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
import { AccountLinks } from './links.mjs'
|
||||
|
||||
export const AccountOverview = ({ app }) => <AccountLinks app={app} />
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Hooks
|
||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||
// Components
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
export const ns = ['roles']
|
||||
|
||||
const colors = {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Dependencies
|
||||
import { measurements } from 'config/measurements.mjs'
|
||||
import { measurements as designMeasurements } from 'shared/prebuild/data/design-measurements.mjs'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
||||
|
||||
export const ns = ['status']
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
*/
|
||||
import { useRef, useState, useEffect, useCallback } from 'react'
|
||||
import { generateStackTransform, getTransformedBounds } from '@freesewing/core'
|
||||
import { getProps } from 'pkgs/react-components/src/index.mjs'
|
||||
import { getProps } from 'pkgs/react-components/src/pattern/utils.mjs'
|
||||
import { angle } from '../utils.mjs'
|
||||
import { drag } from 'd3-drag'
|
||||
import { select } from 'd3-selection'
|
||||
|
|
401
sites/shared/prebuild/data/design-measurements.mjs
Normal file
401
sites/shared/prebuild/data/design-measurements.mjs
Normal file
|
@ -0,0 +1,401 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// This file is auto-generated by the prebuild script | Any changes will be overwritten
|
||||
export const measurements = {
|
||||
aaron: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
],
|
||||
albert: ['chest', 'hpsToWaistBack', 'waist', 'waistToKnee', 'hips'],
|
||||
bee: [
|
||||
'highBust',
|
||||
'chest',
|
||||
'underbust',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'bustSpan',
|
||||
'neck',
|
||||
'hpsToBust',
|
||||
'hpsToWaistFront',
|
||||
'hpsToWaistBack',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'bustPointToUnderbust',
|
||||
],
|
||||
bella: [
|
||||
'highBust',
|
||||
'chest',
|
||||
'underbust',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'bustSpan',
|
||||
'neck',
|
||||
'hpsToBust',
|
||||
'hpsToWaistFront',
|
||||
'hpsToWaistBack',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
],
|
||||
benjamin: ['neck'],
|
||||
bent: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'shoulderToElbow',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
bob: [],
|
||||
breanna: [
|
||||
'biceps',
|
||||
'bustFront',
|
||||
'bustSpan',
|
||||
'highBust',
|
||||
'highBustFront',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'hpsToWaistFront',
|
||||
'waist',
|
||||
'waistToHips',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
brian: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
bruce: ['hips', 'upperLeg', 'waistToHips', 'waistToUpperLeg'],
|
||||
carlita: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'waist',
|
||||
'waistToFloor',
|
||||
'waistToSeat',
|
||||
'seat',
|
||||
'highBust',
|
||||
'bustSpan',
|
||||
'shoulderToElbow',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
carlton: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'waist',
|
||||
'waistToFloor',
|
||||
'waistToSeat',
|
||||
'seat',
|
||||
'shoulderToElbow',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
cathrin: ['underbust', 'waist', 'hips', 'waistToUnderbust', 'waistToHips'],
|
||||
charlie: [
|
||||
'crossSeam',
|
||||
'crossSeamFront',
|
||||
'knee',
|
||||
'seat',
|
||||
'seatBack',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'waistToFloor',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToSeat',
|
||||
'waistToUpperLeg',
|
||||
],
|
||||
cornelius: [
|
||||
'waist',
|
||||
'hips',
|
||||
'inseam',
|
||||
'seat',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToFloor',
|
||||
'knee',
|
||||
],
|
||||
diana: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'waist',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
examples: ['head'],
|
||||
florence: ['head'],
|
||||
florent: ['head'],
|
||||
hi: [],
|
||||
holmes: ['head'],
|
||||
hortensia: [],
|
||||
huey: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
'head',
|
||||
],
|
||||
hugo: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
'head',
|
||||
],
|
||||
jaeger: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'waist',
|
||||
'shoulderToElbow',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
legend: [],
|
||||
lucy: [],
|
||||
lunetius: [
|
||||
'waistToKnee',
|
||||
'waistToUpperLeg',
|
||||
'waistToFloor',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderToElbow',
|
||||
'waistToHips',
|
||||
],
|
||||
magde: [],
|
||||
noble: [
|
||||
'highBust',
|
||||
'chest',
|
||||
'underbust',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'bustSpan',
|
||||
'neck',
|
||||
'hpsToBust',
|
||||
'hpsToWaistFront',
|
||||
'hpsToWaistBack',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
],
|
||||
octoplushy: [],
|
||||
paco: [
|
||||
'crossSeam',
|
||||
'crossSeamFront',
|
||||
'knee',
|
||||
'seat',
|
||||
'seatBack',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'waistToFloor',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToSeat',
|
||||
'waistToUpperLeg',
|
||||
'heel',
|
||||
],
|
||||
penelope: ['waist', 'seat', 'waistToHips', 'waistToSeat', 'waistToKnee'],
|
||||
plugintest: ['seat', 'seatBack', 'waist', 'waistBack', 'crossSeam', 'crossSeamFront'],
|
||||
rendertest: [],
|
||||
sandy: ['waist', 'waistToFloor', 'waistToHips', 'hips'],
|
||||
shin: ['hips', 'upperLeg', 'waistToUpperLeg', 'waistToHips'],
|
||||
simon: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'waist',
|
||||
'hips',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
simone: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'waist',
|
||||
'hips',
|
||||
'highBust',
|
||||
'bustSpan',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
sven: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'waist',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
],
|
||||
tamiko: ['shoulderToShoulder', 'chest', 'hpsToWaistBack', 'shoulderSlope', 'waistToHips'],
|
||||
teagan: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'waist',
|
||||
],
|
||||
tiberius: [
|
||||
'head',
|
||||
'shoulderToElbow',
|
||||
'shoulderToShoulder',
|
||||
'biceps',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waist',
|
||||
'chest',
|
||||
'seat',
|
||||
'hips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg',
|
||||
],
|
||||
titan: [
|
||||
'crossSeam',
|
||||
'crossSeamFront',
|
||||
'knee',
|
||||
'seat',
|
||||
'seatBack',
|
||||
'waist',
|
||||
'waistBack',
|
||||
'waistToFloor',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToSeat',
|
||||
'waistToUpperLeg',
|
||||
],
|
||||
trayvon: ['hpsToWaistBack', 'waistToHips', 'neck'],
|
||||
uma: ['waist', 'seat', 'waistToSeat', 'waistToUpperLeg'],
|
||||
wahid: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'waist',
|
||||
],
|
||||
walburga: [
|
||||
'head',
|
||||
'shoulderToShoulder',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg',
|
||||
'neck',
|
||||
],
|
||||
waralee: ['seat', 'inseam', 'crotchDepth', 'waistToHips'],
|
||||
yuri: [
|
||||
'biceps',
|
||||
'chest',
|
||||
'hpsToBust',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderSlope',
|
||||
'waistToArmpit',
|
||||
'waistToHips',
|
||||
'hips',
|
||||
'shoulderToWrist',
|
||||
'wrist',
|
||||
'head',
|
||||
],
|
||||
}
|
1601
sites/shared/prebuild/data/design-options.mjs
Normal file
1601
sites/shared/prebuild/data/design-options.mjs
Normal file
File diff suppressed because it is too large
Load diff
54
sites/shared/prebuild/data/designs.mjs
Normal file
54
sites/shared/prebuild/data/designs.mjs
Normal file
|
@ -0,0 +1,54 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// This file is auto-generated by the prebuild script | Any changes will be overwritten
|
||||
export const designs = [
|
||||
'aaron',
|
||||
'albert',
|
||||
'bee',
|
||||
'bella',
|
||||
'benjamin',
|
||||
'bent',
|
||||
'bob',
|
||||
'breanna',
|
||||
'brian',
|
||||
'bruce',
|
||||
'carlita',
|
||||
'carlton',
|
||||
'cathrin',
|
||||
'charlie',
|
||||
'cornelius',
|
||||
'diana',
|
||||
'examples',
|
||||
'florence',
|
||||
'florent',
|
||||
'hi',
|
||||
'holmes',
|
||||
'hortensia',
|
||||
'huey',
|
||||
'hugo',
|
||||
'jaeger',
|
||||
'legend',
|
||||
'lucy',
|
||||
'lunetius',
|
||||
'magde',
|
||||
'noble',
|
||||
'octoplushy',
|
||||
'paco',
|
||||
'penelope',
|
||||
'plugintest',
|
||||
'rendertest',
|
||||
'sandy',
|
||||
'shin',
|
||||
'simon',
|
||||
'simone',
|
||||
'sven',
|
||||
'tamiko',
|
||||
'teagan',
|
||||
'tiberius',
|
||||
'titan',
|
||||
'trayvon',
|
||||
'uma',
|
||||
'wahid',
|
||||
'walburga',
|
||||
'waralee',
|
||||
'yuri',
|
||||
]
|
|
@ -38,8 +38,9 @@ export const prebuildDesigns = async (store) => {
|
|||
}
|
||||
|
||||
// Write out prebuild files
|
||||
const header =
|
||||
'// This file is auto-generated by the prebuild script | Any changes will be overwritten\n'
|
||||
const header = `// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// This file is auto-generated by the prebuild script | Any changes will be overwritten
|
||||
`
|
||||
const nl = '\n'
|
||||
const dir = ['..', 'shared', 'prebuild', 'data']
|
||||
promises.push(fs.mkdir(path.resolve(...dir), { recursive: true }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue