Merge branch 'develop' into i18n
This commit is contained in:
commit
78ed6b48ce
172 changed files with 5533 additions and 1513 deletions
|
@ -5,5 +5,5 @@ export const social = {
|
|||
Facebook: 'https://www.facebook.com/groups/627769821272714/',
|
||||
GitHub: 'https://github.com/freesewing',
|
||||
Reddit: 'https://www.reddit.com/r/freesewing/',
|
||||
Twitter: 'https://twitter.com/freesewing_org',
|
||||
Mastodon: 'https://freesewing.social/@freesewing',
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"strapi:translate": "node scripts/strapi-en-to-other.mjs",
|
||||
"fixdocs": "remark markdown --quiet --frail --output",
|
||||
"wbuildall": "lerna run wbuildall",
|
||||
"prepare": "husky install"
|
||||
"prepare": "husky install && yarn buildall"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -103,7 +103,7 @@ async function addDesign() {
|
|||
${chalk.bold.yellow('👷 Get to work')}
|
||||
${chalk.gray('≡≡≡≡≡≡≡≡≡≡≡≡≡≡')}
|
||||
|
||||
🛠️ You can now start the development environment with ${chalk.blue('yarn lab')}
|
||||
🚀 You can now start the development environment with ${chalk.blue('yarn lab')}
|
||||
📖 Documentation is available at ${chalk.green('https://freesewing.dev/')}
|
||||
🤓 Happy hacking
|
||||
|
||||
|
|
|
@ -63,14 +63,13 @@ SubscriberModel.prototype.guardedCreate = async function ({ body }) {
|
|||
*/
|
||||
const actionUrl = i18nUrl(
|
||||
body.language,
|
||||
`/newsletter/${this.record.active ? 'un' : ''}subscribe/${this.record.id}/${ehash}`
|
||||
`/newsletter/${this.record.active ? 'un' : ''}subscribe?id=${this.record.id}&check=${ehash}`
|
||||
)
|
||||
|
||||
/*
|
||||
* Send out confirmation email unless it's a test and we don't want to send test emails
|
||||
*/
|
||||
if (!isTest || this.config.use.tests.email) {
|
||||
console.log({ actionUrl })
|
||||
const template = newSubscriber ? 'nlsub' : this.record.active ? 'nlsubact' : 'nlsubinact'
|
||||
await this.mailer.send({
|
||||
template,
|
||||
|
|
|
@ -695,9 +695,15 @@ UserModel.prototype.guardedCreate = async function ({ body }) {
|
|||
*/
|
||||
let actionUrl = false
|
||||
if (this.record.status === 0)
|
||||
actionUrl = i18nUrl(body.language, `/confirm/${type}/${this.Confirmation.record.id}/${check}`)
|
||||
actionUrl = i18nUrl(
|
||||
body.language,
|
||||
`/confirm/${type}?id=${this.Confirmation.record.id}&check=${check}`
|
||||
)
|
||||
else if (this.record.status === 1)
|
||||
actionUrl = i18nUrl(body.language, `/confirm/signin/${this.Confirmation.record.id}/${check}`)
|
||||
actionUrl = i18nUrl(
|
||||
body.language,
|
||||
`/confirm/signin?id=${this.Confirmation.record.id}&check=${check}`
|
||||
)
|
||||
|
||||
/*
|
||||
* Send email unless it's a test and we don't want to send test emails
|
||||
|
@ -822,7 +828,7 @@ UserModel.prototype.guardedCreate = async function ({ body }) {
|
|||
replacements: {
|
||||
actionUrl: i18nUrl(
|
||||
this.language,
|
||||
`/confirm/signup/${this.Confirmation.record.id}/${check}`
|
||||
`/confirm/signup?id=${this.Confirmation.record.id}&check=${check}`
|
||||
),
|
||||
whyUrl: i18nUrl(this.language, `/docs/faq/email/why-signup`),
|
||||
supportUrl: i18nUrl(this.language, `/patrons/join`),
|
||||
|
@ -1071,7 +1077,7 @@ UserModel.prototype.sendSigninlink = async function (req) {
|
|||
replacements: {
|
||||
actionUrl: i18nUrl(
|
||||
this.record.language,
|
||||
`/confirm/signin/${this.Confirmation.record.id}/${check}`
|
||||
`/confirm/signin?id=${this.Confirmation.record.id}&check=${check}`
|
||||
),
|
||||
whyUrl: i18nUrl(this.record.language, `/docs/faq/email/why-signin-link`),
|
||||
supportUrl: i18nUrl(this.record.language, `/patrons/join`),
|
||||
|
@ -1350,7 +1356,7 @@ UserModel.prototype.guardedUpdate = async function ({ body, user }) {
|
|||
replacements: {
|
||||
actionUrl: i18nUrl(
|
||||
this.record.language,
|
||||
`/confirm/emailchange/${this.Confirmation.record.id}/${check}`
|
||||
`/confirm/emailchange?id=${this.Confirmation.record.id}&check=${check}`
|
||||
),
|
||||
whyUrl: i18nUrl(this.record.language, `/docs/faq/email/why-emailchange`),
|
||||
supportUrl: i18nUrl(this.record.language, `/patrons/join`),
|
||||
|
|
8
sites/dev/vercel.json
Normal file
8
sites/dev/vercel.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"git": {
|
||||
"deploymentEnabled": {
|
||||
"i18n": false,
|
||||
"producionBackend": false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -80,5 +80,5 @@ export const getStaticPaths = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
return { paths, fallback: true }
|
||||
return { paths, fallback: false }
|
||||
}
|
||||
|
|
|
@ -2,8 +2,13 @@
|
|||
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 { useId } from 'shared/hooks/use-id.mjs'
|
||||
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'
|
||||
|
@ -26,6 +31,11 @@ const DynamicApikeys = dynamic(
|
|||
{ 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
|
||||
|
@ -34,11 +44,36 @@ const DynamicApikeys = dynamic(
|
|||
*/
|
||||
const AccountApikeysPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [id, setId] = useId()
|
||||
const [apikey, setApikey] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getApikey = async () => {
|
||||
setLoadingStatus([true, 'contactingBackend'])
|
||||
setApikey({ name: '', id })
|
||||
const result = await backend.getApikey(id)
|
||||
if (result.success) {
|
||||
setApikey(result.data.apikey)
|
||||
setLoadingStatus([true, 'status:dataLoaded', true, true])
|
||||
} else setLoadingStatus([false])
|
||||
}
|
||||
if (id) getApikey()
|
||||
}, [id, backend, setLoadingStatus])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('apikeys')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicApikeys />
|
||||
{id && apikey ? (
|
||||
<>
|
||||
<h2>{id}</h2>
|
||||
<DynamicApikey {...{ apikey, setId }} />
|
||||
</>
|
||||
) : (
|
||||
<DynamicApikeys {...{ setId }} />
|
||||
)}
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
@ -36,21 +36,27 @@ const DynamicBookmark = dynamic(
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const BookmarkPage = ({ page, id }) => {
|
||||
const BookmarkPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [id, setId] = useState()
|
||||
const [bookmark, setBookmark] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getBookmark = async () => {
|
||||
const getBookmark = async (id) => {
|
||||
const result = await backend.getBookmark(id)
|
||||
if (result.success) setBookmark(result.data.bookmark)
|
||||
else setLoadingStatus([false])
|
||||
}
|
||||
getBookmark()
|
||||
}, [id])
|
||||
const newId = getSearchParam('id')
|
||||
console.log({ newId })
|
||||
if (newId !== id) {
|
||||
setId(newId)
|
||||
getBookmark(newId)
|
||||
}
|
||||
}, [id, backend, setLoadingStatus])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('bookmarks')}: ${bookmark?.title}`}>
|
||||
|
@ -63,22 +69,14 @@ const BookmarkPage = ({ page, id }) => {
|
|||
|
||||
export default BookmarkPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmarks', params.id],
|
||||
path: ['account', 'bookmark'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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,9 +1,10 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect } from 'react'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
|
@ -32,8 +33,14 @@ const DynamicPattern = dynamic(
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const PatternPage = ({ page, id }) => {
|
||||
const PatternPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const [id, setId] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const newId = getSearchParam('id')
|
||||
if (newId !== id) setId(newId)
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('patterns')}: #${id}`}>
|
||||
|
@ -46,22 +53,14 @@ const PatternPage = ({ page, id }) => {
|
|||
|
||||
export default PatternPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', params.id],
|
||||
path: ['account', 'pattern'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 })
|
|
@ -4,7 +4,7 @@
|
|||
import { Aaron } from 'designs/aaron/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('aaron', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditAaronPage = ({ page, docs, id }) => {
|
||||
const EditAaronPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditAaronPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditAaronPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="aaron"
|
||||
Design={Aaron}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditAaronPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditAaronPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'aaron', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'aaron'],
|
||||
title: 'Aaron',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Albert } from 'designs/albert/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('albert', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditAlbertPage = ({ page, docs, id }) => {
|
||||
const EditAlbertPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditAlbertPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditAlbertPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="albert"
|
||||
Design={Albert}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditAlbertPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditAlbertPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'albert', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'albert'],
|
||||
title: 'Albert',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Bee } from 'designs/bee/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bee', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBeePage = ({ page, docs, id }) => {
|
||||
const EditBeePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBeePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBeePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="bee"
|
||||
Design={Bee}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBeePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBeePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bee', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'bee'],
|
||||
title: 'Bee',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Bella } from 'designs/bella/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bella', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBellaPage = ({ page, docs, id }) => {
|
||||
const EditBellaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBellaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBellaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="bella"
|
||||
Design={Bella}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBellaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBellaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bella', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'bella'],
|
||||
title: 'Bella',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Benjamin } from 'designs/benjamin/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('benjamin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBenjaminPage = ({ page, docs, id }) => {
|
||||
const EditBenjaminPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBenjaminPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBenjaminPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="benjamin"
|
||||
Design={Benjamin}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBenjaminPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBenjaminPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'benjamin', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'benjamin'],
|
||||
title: 'Benjamin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Bent } from 'designs/bent/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bent', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBentPage = ({ page, docs, id }) => {
|
||||
const EditBentPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBentPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBentPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="bent"
|
||||
Design={Bent}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBentPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBentPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bent', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'bent'],
|
||||
title: 'Bent',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Bob } from 'designs/bob/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bob', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBobPage = ({ page, docs, id }) => {
|
||||
const EditBobPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBobPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBobPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="bob"
|
||||
Design={Bob}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBobPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBobPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bob', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'bob'],
|
||||
title: 'Bob',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Breanna } from 'designs/breanna/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('breanna', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBreannaPage = ({ page, docs, id }) => {
|
||||
const EditBreannaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBreannaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBreannaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="breanna"
|
||||
Design={Breanna}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBreannaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBreannaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'breanna', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'breanna'],
|
||||
title: 'Breanna',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Brian } from 'designs/brian/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('brian', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBrianPage = ({ page, docs, id }) => {
|
||||
const EditBrianPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBrianPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBrianPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="brian"
|
||||
Design={Brian}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBrianPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBrianPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'brian', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'brian'],
|
||||
title: 'Brian',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Bruce } from 'designs/bruce/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bruce', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBrucePage = ({ page, docs, id }) => {
|
||||
const EditBrucePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditBrucePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditBrucePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="bruce"
|
||||
Design={Bruce}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditBrucePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditBrucePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bruce', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'bruce'],
|
||||
title: 'Bruce',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Carlita } from 'designs/carlita/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('carlita', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCarlitaPage = ({ page, docs, id }) => {
|
||||
const EditCarlitaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditCarlitaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditCarlitaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="carlita"
|
||||
Design={Carlita}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditCarlitaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditCarlitaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'carlita', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'carlita'],
|
||||
title: 'Carlita',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Carlton } from 'designs/carlton/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('carlton', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCarltonPage = ({ page, docs, id }) => {
|
||||
const EditCarltonPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditCarltonPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditCarltonPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="carlton"
|
||||
Design={Carlton}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditCarltonPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditCarltonPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'carlton', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'carlton'],
|
||||
title: 'Carlton',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Cathrin } from 'designs/cathrin/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('cathrin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCathrinPage = ({ page, docs, id }) => {
|
||||
const EditCathrinPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditCathrinPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditCathrinPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="cathrin"
|
||||
Design={Cathrin}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditCathrinPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditCathrinPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'cathrin', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'cathrin'],
|
||||
title: 'Cathrin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Charlie } from 'designs/charlie/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('charlie', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCharliePage = ({ page, docs, id }) => {
|
||||
const EditCharliePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditCharliePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditCharliePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="charlie"
|
||||
Design={Charlie}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditCharliePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditCharliePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'charlie', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'charlie'],
|
||||
title: 'Charlie',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Cornelius } from 'designs/cornelius/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('cornelius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCorneliusPage = ({ page, docs, id }) => {
|
||||
const EditCorneliusPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditCorneliusPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditCorneliusPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="cornelius"
|
||||
Design={Cornelius}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditCorneliusPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditCorneliusPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'cornelius', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'cornelius'],
|
||||
title: 'Cornelius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Diana } from 'designs/diana/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('diana', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditDianaPage = ({ page, docs, id }) => {
|
||||
const EditDianaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditDianaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditDianaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="diana"
|
||||
Design={Diana}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditDianaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditDianaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'diana', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'diana'],
|
||||
title: 'Diana',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Florence } from 'designs/florence/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('florence', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditFlorencePage = ({ page, docs, id }) => {
|
||||
const EditFlorencePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditFlorencePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditFlorencePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="florence"
|
||||
Design={Florence}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditFlorencePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditFlorencePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'florence', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'florence'],
|
||||
title: 'Florence',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Florent } from 'designs/florent/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('florent', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditFlorentPage = ({ page, docs, id }) => {
|
||||
const EditFlorentPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditFlorentPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditFlorentPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="florent"
|
||||
Design={Florent}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditFlorentPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditFlorentPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'florent', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'florent'],
|
||||
title: 'Florent',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Gozer } from 'designs/gozer/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('gozer', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditGozerPage = ({ page, docs, id }) => {
|
||||
const EditGozerPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditGozerPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditGozerPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="gozer"
|
||||
Design={Gozer}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditGozerPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditGozerPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'gozer', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'gozer'],
|
||||
title: 'Gozer',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Hi } from 'designs/hi/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hi', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHiPage = ({ page, docs, id }) => {
|
||||
const EditHiPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditHiPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditHiPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="hi"
|
||||
Design={Hi}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditHiPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditHiPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hi', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'hi'],
|
||||
title: 'Hi',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Holmes } from 'designs/holmes/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('holmes', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHolmesPage = ({ page, docs, id }) => {
|
||||
const EditHolmesPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditHolmesPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditHolmesPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="holmes"
|
||||
Design={Holmes}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditHolmesPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditHolmesPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'holmes', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'holmes'],
|
||||
title: 'Holmes',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Hortensia } from 'designs/hortensia/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hortensia', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHortensiaPage = ({ page, docs, id }) => {
|
||||
const EditHortensiaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditHortensiaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditHortensiaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="hortensia"
|
||||
Design={Hortensia}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditHortensiaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditHortensiaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hortensia', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'hortensia'],
|
||||
title: 'Hortensia',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Huey } from 'designs/huey/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('huey', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHueyPage = ({ page, docs, id }) => {
|
||||
const EditHueyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditHueyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditHueyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="huey"
|
||||
Design={Huey}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditHueyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditHueyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'huey', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'huey'],
|
||||
title: 'Huey',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Hugo } from 'designs/hugo/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hugo', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHugoPage = ({ page, docs, id }) => {
|
||||
const EditHugoPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditHugoPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditHugoPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="hugo"
|
||||
Design={Hugo}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditHugoPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditHugoPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hugo', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'hugo'],
|
||||
title: 'Hugo',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Jaeger } from 'designs/jaeger/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('jaeger', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditJaegerPage = ({ page, docs, id }) => {
|
||||
const EditJaegerPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditJaegerPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditJaegerPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="jaeger"
|
||||
Design={Jaeger}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditJaegerPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditJaegerPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'jaeger', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'jaeger'],
|
||||
title: 'Jaeger',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Lucy } from 'designs/lucy/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('lucy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditLucyPage = ({ page, docs, id }) => {
|
||||
const EditLucyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditLucyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditLucyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="lucy"
|
||||
Design={Lucy}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditLucyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditLucyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'lucy', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'lucy'],
|
||||
title: 'Lucy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Lunetius } from 'designs/lunetius/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('lunetius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditLunetiusPage = ({ page, docs, id }) => {
|
||||
const EditLunetiusPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditLunetiusPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditLunetiusPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="lunetius"
|
||||
Design={Lunetius}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditLunetiusPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditLunetiusPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'lunetius', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'lunetius'],
|
||||
title: 'Lunetius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Noble } from 'designs/noble/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('noble', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditNoblePage = ({ page, docs, id }) => {
|
||||
const EditNoblePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditNoblePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditNoblePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="noble"
|
||||
Design={Noble}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditNoblePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditNoblePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'noble', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'noble'],
|
||||
title: 'Noble',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Octoplushy } from 'designs/octoplushy/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('octoplushy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditOctoplushyPage = ({ page, docs, id }) => {
|
||||
const EditOctoplushyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditOctoplushyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditOctoplushyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="octoplushy"
|
||||
Design={Octoplushy}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditOctoplushyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditOctoplushyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'octoplushy', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'octoplushy'],
|
||||
title: 'Octoplushy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Otis } from 'designs/otis/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('otis', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditOtisPage = ({ page, docs, id }) => {
|
||||
const EditOtisPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditOtisPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditOtisPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="otis"
|
||||
Design={Otis}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditOtisPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditOtisPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'otis', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'otis'],
|
||||
title: 'Otis',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Paco } from 'designs/paco/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('paco', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditPacoPage = ({ page, docs, id }) => {
|
||||
const EditPacoPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditPacoPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditPacoPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="paco"
|
||||
Design={Paco}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditPacoPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditPacoPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'paco', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'paco'],
|
||||
title: 'Paco',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Penelope } from 'designs/penelope/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('penelope', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditPenelopePage = ({ page, docs, id }) => {
|
||||
const EditPenelopePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditPenelopePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditPenelopePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="penelope"
|
||||
Design={Penelope}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditPenelopePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditPenelopePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'penelope', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'penelope'],
|
||||
title: 'Penelope',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Sandy } from 'designs/sandy/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('sandy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSandyPage = ({ page, docs, id }) => {
|
||||
const EditSandyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditSandyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditSandyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="sandy"
|
||||
Design={Sandy}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditSandyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditSandyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'sandy', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'sandy'],
|
||||
title: 'Sandy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Shelly } from 'designs/shelly/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('shelly', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditShellyPage = ({ page, docs, id }) => {
|
||||
const EditShellyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditShellyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditShellyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="shelly"
|
||||
Design={Shelly}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditShellyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditShellyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'shelly', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'shelly'],
|
||||
title: 'Shelly',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Shin } from 'designs/shin/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('shin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditShinPage = ({ page, docs, id }) => {
|
||||
const EditShinPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditShinPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditShinPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="shin"
|
||||
Design={Shin}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditShinPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditShinPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'shin', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'shin'],
|
||||
title: 'Shin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Simon } from 'designs/simon/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('simon', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSimonPage = ({ page, docs, id }) => {
|
||||
const EditSimonPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditSimonPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditSimonPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="simon"
|
||||
Design={Simon}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditSimonPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditSimonPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'simon', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'simon'],
|
||||
title: 'Simon',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Simone } from 'designs/simone/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('simone', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSimonePage = ({ page, docs, id }) => {
|
||||
const EditSimonePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditSimonePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditSimonePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="simone"
|
||||
Design={Simone}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditSimonePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditSimonePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'simone', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'simone'],
|
||||
title: 'Simone',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Skully } from 'designs/skully/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('skully', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSkullyPage = ({ page, docs, id }) => {
|
||||
const EditSkullyPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditSkullyPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditSkullyPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="skully"
|
||||
Design={Skully}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditSkullyPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditSkullyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'skully', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'skully'],
|
||||
title: 'Skully',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Sven } from 'designs/sven/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('sven', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSvenPage = ({ page, docs, id }) => {
|
||||
const EditSvenPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditSvenPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditSvenPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="sven"
|
||||
Design={Sven}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditSvenPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditSvenPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'sven', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'sven'],
|
||||
title: 'Sven',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Tamiko } from 'designs/tamiko/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('tamiko', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTamikoPage = ({ page, docs, id }) => {
|
||||
const EditTamikoPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditTamikoPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditTamikoPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="tamiko"
|
||||
Design={Tamiko}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditTamikoPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditTamikoPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'tamiko', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'tamiko'],
|
||||
title: 'Tamiko',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Teagan } from 'designs/teagan/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('teagan', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTeaganPage = ({ page, docs, id }) => {
|
||||
const EditTeaganPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditTeaganPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditTeaganPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="teagan"
|
||||
Design={Teagan}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditTeaganPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditTeaganPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'teagan', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'teagan'],
|
||||
title: 'Teagan',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Tiberius } from 'designs/tiberius/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('tiberius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTiberiusPage = ({ page, docs, id }) => {
|
||||
const EditTiberiusPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditTiberiusPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditTiberiusPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="tiberius"
|
||||
Design={Tiberius}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditTiberiusPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditTiberiusPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'tiberius', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'tiberius'],
|
||||
title: 'Tiberius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Titan } from 'designs/titan/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('titan', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTitanPage = ({ page, docs, id }) => {
|
||||
const EditTitanPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditTitanPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditTitanPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="titan"
|
||||
Design={Titan}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditTitanPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditTitanPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'titan', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'titan'],
|
||||
title: 'Titan',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Trayvon } from 'designs/trayvon/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('trayvon', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTrayvonPage = ({ page, docs, id }) => {
|
||||
const EditTrayvonPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditTrayvonPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditTrayvonPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="trayvon"
|
||||
Design={Trayvon}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditTrayvonPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditTrayvonPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'trayvon', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'trayvon'],
|
||||
title: 'Trayvon',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Uma } from 'designs/uma/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('uma', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditUmaPage = ({ page, docs, id }) => {
|
||||
const EditUmaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditUmaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditUmaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="uma"
|
||||
Design={Uma}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditUmaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditUmaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'uma', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'uma'],
|
||||
title: 'Uma',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Wahid } from 'designs/wahid/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('wahid', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWahidPage = ({ page, docs, id }) => {
|
||||
const EditWahidPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditWahidPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditWahidPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="wahid"
|
||||
Design={Wahid}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditWahidPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditWahidPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'wahid', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'wahid'],
|
||||
title: 'Wahid',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Walburga } from 'designs/walburga/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('walburga', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWalburgaPage = ({ page, docs, id }) => {
|
||||
const EditWalburgaPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditWalburgaPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditWalburgaPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="walburga"
|
||||
Design={Walburga}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditWalburgaPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditWalburgaPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'walburga', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'walburga'],
|
||||
title: 'Walburga',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Waralee } from 'designs/waralee/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('waralee', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWaraleePage = ({ page, docs, id }) => {
|
||||
const EditWaraleePage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditWaraleePage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditWaraleePage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="waralee"
|
||||
Design={Waralee}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditWaraleePage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditWaraleePage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'waralee', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'waralee'],
|
||||
title: 'Waralee',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { Yuri } from 'designs/yuri/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('yuri', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditYuriPage = ({ page, docs, id }) => {
|
||||
const EditYuriPage = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const EditYuriPage = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const EditYuriPage = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="yuri"
|
||||
Design={Yuri}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const EditYuriPage = ({ page, docs, id }) => {
|
|||
|
||||
export default EditYuriPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'yuri', params.id, 'edit'],
|
||||
path: ['account', 'patterns', 'yuri'],
|
||||
title: 'Yuri',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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,9 +1,10 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect } from 'react'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
|
@ -32,8 +33,14 @@ const DynamicSet = dynamic(
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const SetPage = ({ page, id }) => {
|
||||
const SetPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const [id, setId] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const newId = getSearchParam('id')
|
||||
if (newId !== id) setId(newId)
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('sets')}: #${id}`}>
|
||||
|
@ -46,22 +53,14 @@ const SetPage = ({ page, id }) => {
|
|||
|
||||
export default SetPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'sets', params.id],
|
||||
path: ['account', 'set'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 })
|
|
@ -54,6 +54,6 @@ export async function getStaticProps({ locale, params }) {
|
|||
export async function getStaticPaths() {
|
||||
return {
|
||||
paths: [...collection].map((design) => `/designs/${design}`),
|
||||
fallback: 'blocking',
|
||||
fallback: false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
import { localePath } from 'shared/utils.mjs'
|
||||
import { siteConfig as config } from 'site/site.config.mjs'
|
||||
|
||||
/**
|
||||
* get pre-generated paths for each language for post slug pages
|
||||
* @param {Object} posts an object holding all the posts
|
||||
* @return {String[]} paths for the most recent posts in all locales
|
||||
*/
|
||||
export const getPostSlugPaths = (posts) => {
|
||||
const paths = []
|
||||
|
||||
for (const lang in posts) {
|
||||
paths.push(
|
||||
...Object.keys(posts[lang])
|
||||
.slice(0, config.posts.preGenerate)
|
||||
.map((slug) => localePath(lang, slug))
|
||||
)
|
||||
}
|
||||
|
||||
return paths
|
||||
}
|
||||
|
||||
/**
|
||||
* get pre-generated paths for each language for post index pages
|
||||
* @param {Object} posts an object keyed by locale of posts sorted by date published
|
||||
* @param {String} type post type: blog, showcase, or newsletter
|
||||
* @return {String[]} paths for the first two pages of posts in all locales
|
||||
*/
|
||||
export const getPostIndexPaths = (posts, type) => {
|
||||
const paths = []
|
||||
for (const language in posts) {
|
||||
paths.push(localePath(language, `${type}/page/1`))
|
||||
paths.push(localePath(language, `${type}/page/2`))
|
||||
}
|
||||
|
||||
return paths
|
||||
}
|
||||
|
||||
/**
|
||||
* get static props for a post index page
|
||||
* @param {Object} pagenr the current page number in the pagination
|
||||
* @param {Object} posts on object keyed by slug holding the posts title
|
||||
* @return {Object} meta on object keyed by slug holding the posts metadata
|
||||
* @return {Object[]} props.posts the posts to link to on the page
|
||||
* @return {Number} props.current the current page number
|
||||
* @return {Number} props.total the total number of pages
|
||||
*/
|
||||
export const getPostIndexProps = (pagenr, posts, meta) => {
|
||||
const pageNum = parseInt(pagenr)
|
||||
const numLocPages = Math.ceil(Object.keys(posts).length / config.posts.perPage)
|
||||
if (pageNum > numLocPages) return false
|
||||
|
||||
const pagePosts = Object.entries(posts)
|
||||
.slice(config.posts.perPage * (pageNum - 1), config.posts.perPage * pageNum)
|
||||
.map(([slug, post]) => ({
|
||||
s: slug,
|
||||
...post,
|
||||
...meta[slug],
|
||||
}))
|
||||
|
||||
return { posts: pagePosts, current: pageNum, total: numLocPages }
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
import { $$Design$$ } from 'designs/$$design$$/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
@ -20,11 +20,11 @@ import { Loading } from 'shared/components/spinner.mjs'
|
|||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('$$design$$', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings, docs }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design, docs }} />
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const Edit$$Design$$Page = ({ page, docs, id }) => {
|
||||
const Edit$$Design$$Page = ({ page }) => {
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
const backend = useBackend()
|
||||
const { t } = useTranslation(ns)
|
||||
|
@ -46,8 +46,9 @@ const Edit$$Design$$Page = ({ page, docs, id }) => {
|
|||
setLoadingStatus([true, 'backendError', true, false])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [id])
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +59,6 @@ const Edit$$Design$$Page = ({ page, docs, id }) => {
|
|||
settings={pattern.settings}
|
||||
design="$$design$$"
|
||||
Design={$$Design$$}
|
||||
docs={docs}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
|
@ -72,27 +72,15 @@ const Edit$$Design$$Page = ({ page, docs, id }) => {
|
|||
|
||||
export default Edit$$Design$$Page
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
id: params.id,
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', '$$design$$', params.id, 'edit'],
|
||||
path: ['account', 'patterns', '$$design$$'],
|
||||
title: '$$Design$$',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,5 +80,5 @@ export const getStaticPaths = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
return { paths, fallback: 'blocking' }
|
||||
return { paths, fallback: false }
|
||||
}
|
||||
|
|
|
@ -2,8 +2,13 @@
|
|||
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 { useId } from 'shared/hooks/use-id.mjs'
|
||||
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'
|
||||
|
@ -26,6 +31,11 @@ const DynamicApikeys = dynamic(
|
|||
{ 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
|
||||
|
@ -34,11 +44,36 @@ const DynamicApikeys = dynamic(
|
|||
*/
|
||||
const AccountApikeysPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [id, setId] = useId()
|
||||
const [apikey, setApikey] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getApikey = async () => {
|
||||
setLoadingStatus([true, 'contactingBackend'])
|
||||
setApikey({ name: '', id })
|
||||
const result = await backend.getApikey(id)
|
||||
if (result.success) {
|
||||
setApikey(result.data.apikey)
|
||||
setLoadingStatus([true, 'status:dataLoaded', true, true])
|
||||
} else setLoadingStatus([false])
|
||||
}
|
||||
if (id) getApikey()
|
||||
}, [id, backend, setLoadingStatus])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('apikeys')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicApikeys />
|
||||
{id && apikey ? (
|
||||
<>
|
||||
<h2>{id}</h2>
|
||||
<DynamicApikey {...{ apikey, setId }} />
|
||||
</>
|
||||
) : (
|
||||
<DynamicApikeys {...{ setId }} />
|
||||
)}
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
//import { ssrI18n } from 'shared/ssr-i18n.mjs'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
|
@ -12,12 +11,10 @@ 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'
|
||||
import { ns as bookmarksNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(apikeysNs, authNs, pageNs)
|
||||
const key = 'apikey'
|
||||
let i18n
|
||||
const ns = nsMerge(bookmarksNs, authNs, pageNs, 'status')
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
|
@ -28,8 +25,8 @@ const DynamicAuthWrapper = dynamic(
|
|||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicApikey = dynamic(
|
||||
() => import('shared/components/account/apikeys.mjs').then((mod) => mod.Apikey),
|
||||
const DynamicBookmark = dynamic(
|
||||
() => import('shared/components/account/bookmarks.mjs').then((mod) => mod.Bookmark),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
|
@ -39,51 +36,47 @@ const DynamicApikey = dynamic(
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const ApikeyPage = ({ page, id }) => {
|
||||
const BookmarkPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [apikey, setApikey] = useState()
|
||||
const [id, setId] = useState()
|
||||
const [bookmark, setBookmark] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getApikey = async () => {
|
||||
const result = await backend.getApikey(id)
|
||||
if (result.success) setApikey(result.data.apikey)
|
||||
const getBookmark = async (id) => {
|
||||
const result = await backend.getBookmark(id)
|
||||
if (result.success) setBookmark(result.data.bookmark)
|
||||
else setLoadingStatus([false])
|
||||
}
|
||||
getApikey()
|
||||
}, [id])
|
||||
const newId = getSearchParam('id')
|
||||
console.log({ newId })
|
||||
if (newId !== id) {
|
||||
setId(newId)
|
||||
getBookmark(newId)
|
||||
}
|
||||
}, [id, backend, setLoadingStatus])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('apikeys')}: ${apikey?.name}`}>
|
||||
<PageWrapper {...page} title={`${t('bookmarks')}: ${bookmark?.title}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicApikey apikey={apikey} t={t} />
|
||||
<DynamicBookmark bookmark={bookmark} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default ApikeyPage
|
||||
|
||||
export async function getStaticProps({ locale, params }) {
|
||||
if (!i18n) i18n = await serverSideTranslations(locale, ns)
|
||||
export default BookmarkPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...i18n,
|
||||
id: params.id,
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'apikeys', params.id],
|
||||
path: ['account', 'bookmark'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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: ['/account/apikeys/1'], fallback: true })
|
59
sites/org/pages/account/bookmarks.mjs
Normal file
59
sites/org/pages/account/bookmarks.mjs
Normal file
|
@ -0,0 +1,59 @@
|
|||
// 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'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
66
sites/org/pages/account/pattern.mjs
Normal file
66
sites/org/pages/account/pattern.mjs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect } from 'react'
|
||||
// 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 }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const [id, setId] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const newId = getSearchParam('id')
|
||||
if (newId !== id) setId(newId)
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('patterns')}: #${id}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPattern id={id} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default PatternPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'pattern'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/aaron/edit.mjs
Normal file
86
sites/org/pages/account/patterns/aaron/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Aaron } from 'designs/aaron/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('aaron', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditAaronPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Aaron" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="aaron"
|
||||
Design={Aaron}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditAaronPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'aaron'],
|
||||
title: 'Aaron',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/albert/edit.mjs
Normal file
86
sites/org/pages/account/patterns/albert/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Albert } from 'designs/albert/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('albert', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditAlbertPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Albert" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="albert"
|
||||
Design={Albert}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditAlbertPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'albert'],
|
||||
title: 'Albert',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/bee/edit.mjs
Normal file
86
sites/org/pages/account/patterns/bee/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Bee } from 'designs/bee/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bee', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBeePage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Bee" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="bee"
|
||||
Design={Bee}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBeePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bee'],
|
||||
title: 'Bee',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/bella/edit.mjs
Normal file
86
sites/org/pages/account/patterns/bella/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Bella } from 'designs/bella/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bella', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBellaPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Bella" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="bella"
|
||||
Design={Bella}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBellaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bella'],
|
||||
title: 'Bella',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/benjamin/edit.mjs
Normal file
86
sites/org/pages/account/patterns/benjamin/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Benjamin } from 'designs/benjamin/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('benjamin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBenjaminPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Benjamin" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="benjamin"
|
||||
Design={Benjamin}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBenjaminPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'benjamin'],
|
||||
title: 'Benjamin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/bent/edit.mjs
Normal file
86
sites/org/pages/account/patterns/bent/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Bent } from 'designs/bent/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bent', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBentPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Bent" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="bent"
|
||||
Design={Bent}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBentPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bent'],
|
||||
title: 'Bent',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/bob/edit.mjs
Normal file
86
sites/org/pages/account/patterns/bob/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Bob } from 'designs/bob/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bob', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBobPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Bob" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="bob"
|
||||
Design={Bob}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBobPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bob'],
|
||||
title: 'Bob',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/breanna/edit.mjs
Normal file
86
sites/org/pages/account/patterns/breanna/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Breanna } from 'designs/breanna/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('breanna', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBreannaPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Breanna" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="breanna"
|
||||
Design={Breanna}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBreannaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'breanna'],
|
||||
title: 'Breanna',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/brian/edit.mjs
Normal file
86
sites/org/pages/account/patterns/brian/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Brian } from 'designs/brian/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('brian', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBrianPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Brian" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="brian"
|
||||
Design={Brian}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBrianPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'brian'],
|
||||
title: 'Brian',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/bruce/edit.mjs
Normal file
86
sites/org/pages/account/patterns/bruce/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Bruce } from 'designs/bruce/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('bruce', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditBrucePage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Bruce" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="bruce"
|
||||
Design={Bruce}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditBrucePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'bruce'],
|
||||
title: 'Bruce',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/carlita/edit.mjs
Normal file
86
sites/org/pages/account/patterns/carlita/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Carlita } from 'designs/carlita/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('carlita', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCarlitaPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Carlita" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="carlita"
|
||||
Design={Carlita}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditCarlitaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'carlita'],
|
||||
title: 'Carlita',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/carlton/edit.mjs
Normal file
86
sites/org/pages/account/patterns/carlton/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Carlton } from 'designs/carlton/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('carlton', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCarltonPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Carlton" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="carlton"
|
||||
Design={Carlton}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditCarltonPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'carlton'],
|
||||
title: 'Carlton',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/cathrin/edit.mjs
Normal file
86
sites/org/pages/account/patterns/cathrin/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Cathrin } from 'designs/cathrin/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('cathrin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCathrinPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Cathrin" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="cathrin"
|
||||
Design={Cathrin}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditCathrinPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'cathrin'],
|
||||
title: 'Cathrin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/charlie/edit.mjs
Normal file
86
sites/org/pages/account/patterns/charlie/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Charlie } from 'designs/charlie/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('charlie', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCharliePage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Charlie" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="charlie"
|
||||
Design={Charlie}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditCharliePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'charlie'],
|
||||
title: 'Charlie',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/cornelius/edit.mjs
Normal file
86
sites/org/pages/account/patterns/cornelius/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Cornelius } from 'designs/cornelius/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('cornelius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditCorneliusPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Cornelius" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="cornelius"
|
||||
Design={Cornelius}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditCorneliusPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'cornelius'],
|
||||
title: 'Cornelius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/diana/edit.mjs
Normal file
86
sites/org/pages/account/patterns/diana/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Diana } from 'designs/diana/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('diana', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditDianaPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Diana" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="diana"
|
||||
Design={Diana}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditDianaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'diana'],
|
||||
title: 'Diana',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/florence/edit.mjs
Normal file
86
sites/org/pages/account/patterns/florence/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Florence } from 'designs/florence/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('florence', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditFlorencePage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Florence" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="florence"
|
||||
Design={Florence}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditFlorencePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'florence'],
|
||||
title: 'Florence',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/florent/edit.mjs
Normal file
86
sites/org/pages/account/patterns/florent/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Florent } from 'designs/florent/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('florent', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditFlorentPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Florent" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="florent"
|
||||
Design={Florent}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditFlorentPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'florent'],
|
||||
title: 'Florent',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/gozer/edit.mjs
Normal file
86
sites/org/pages/account/patterns/gozer/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Gozer } from 'designs/gozer/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('gozer', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditGozerPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Gozer" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="gozer"
|
||||
Design={Gozer}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditGozerPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'gozer'],
|
||||
title: 'Gozer',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/hi/edit.mjs
Normal file
86
sites/org/pages/account/patterns/hi/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Hi } from 'designs/hi/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hi', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHiPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Hi" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="hi"
|
||||
Design={Hi}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditHiPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hi'],
|
||||
title: 'Hi',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/holmes/edit.mjs
Normal file
86
sites/org/pages/account/patterns/holmes/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Holmes } from 'designs/holmes/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('holmes', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHolmesPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Holmes" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="holmes"
|
||||
Design={Holmes}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditHolmesPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'holmes'],
|
||||
title: 'Holmes',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/hortensia/edit.mjs
Normal file
86
sites/org/pages/account/patterns/hortensia/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Hortensia } from 'designs/hortensia/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hortensia', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHortensiaPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Hortensia" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="hortensia"
|
||||
Design={Hortensia}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditHortensiaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hortensia'],
|
||||
title: 'Hortensia',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/huey/edit.mjs
Normal file
86
sites/org/pages/account/patterns/huey/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Huey } from 'designs/huey/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('huey', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHueyPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Huey" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="huey"
|
||||
Design={Huey}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditHueyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'huey'],
|
||||
title: 'Huey',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/hugo/edit.mjs
Normal file
86
sites/org/pages/account/patterns/hugo/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Hugo } from 'designs/hugo/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('hugo', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditHugoPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Hugo" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="hugo"
|
||||
Design={Hugo}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditHugoPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'hugo'],
|
||||
title: 'Hugo',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/jaeger/edit.mjs
Normal file
86
sites/org/pages/account/patterns/jaeger/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Jaeger } from 'designs/jaeger/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('jaeger', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditJaegerPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Jaeger" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="jaeger"
|
||||
Design={Jaeger}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditJaegerPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'jaeger'],
|
||||
title: 'Jaeger',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/lucy/edit.mjs
Normal file
86
sites/org/pages/account/patterns/lucy/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Lucy } from 'designs/lucy/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('lucy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditLucyPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Lucy" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="lucy"
|
||||
Design={Lucy}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditLucyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'lucy'],
|
||||
title: 'Lucy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/lunetius/edit.mjs
Normal file
86
sites/org/pages/account/patterns/lunetius/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Lunetius } from 'designs/lunetius/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('lunetius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditLunetiusPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Lunetius" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="lunetius"
|
||||
Design={Lunetius}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditLunetiusPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'lunetius'],
|
||||
title: 'Lunetius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/noble/edit.mjs
Normal file
86
sites/org/pages/account/patterns/noble/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Noble } from 'designs/noble/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('noble', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditNoblePage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Noble" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="noble"
|
||||
Design={Noble}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditNoblePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'noble'],
|
||||
title: 'Noble',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/octoplushy/edit.mjs
Normal file
86
sites/org/pages/account/patterns/octoplushy/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Octoplushy } from 'designs/octoplushy/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('octoplushy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditOctoplushyPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Octoplushy" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="octoplushy"
|
||||
Design={Octoplushy}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditOctoplushyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'octoplushy'],
|
||||
title: 'Octoplushy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/org/pages/account/patterns/otis/edit.mjs
Normal file
86
sites/org/pages/account/patterns/otis/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Otis } from 'designs/otis/src/index.mjs'
|
||||
// Dependencies
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
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 { Loading } from 'shared/components/spinner.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge('otis', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditOtisPage = ({ page }) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
const id = getSearchParam('id')
|
||||
if (id) getPattern()
|
||||
}, [backend, setLoadingStatus, t])
|
||||
|
||||
return (
|
||||
// prettier-ignore
|
||||
<PageWrapper {...page} title="Otis" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="otis"
|
||||
Design={Otis}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditOtisPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'otis'],
|
||||
title: 'Otis',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue