chore(lab): Updated prebuild pages
This commit is contained in:
parent
e01578223f
commit
1a3350ee3d
59 changed files with 4554 additions and 3 deletions
82
sites/lab/pages/account/bookmark.mjs
Normal file
82
sites/lab/pages/account/bookmark.mjs
Normal file
|
@ -0,0 +1,82 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge, getSearchParam } from 'shared/utils.mjs'
|
||||
// Context
|
||||
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as bookmarksNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(bookmarksNs, authNs, pageNs, 'status')
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicBookmark = dynamic(
|
||||
() => import('shared/components/account/bookmarks.mjs').then((mod) => mod.Bookmark),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const BookmarkPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
const backend = useBackend()
|
||||
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||
|
||||
const [id, setId] = useState()
|
||||
const [bookmark, setBookmark] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getBookmark = async (id) => {
|
||||
const result = await backend.getBookmark(id)
|
||||
if (result.success) setBookmark(result.data.bookmark)
|
||||
else setLoadingStatus([false])
|
||||
}
|
||||
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}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicBookmark bookmark={bookmark} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default BookmarkPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmark'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
59
sites/lab/pages/account/bookmarks.mjs
Normal file
59
sites/lab/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/lab/pages/account/pattern.mjs
Normal file
66
sites/lab/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/lab/pages/account/patterns/aaron/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/albert/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/bee/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/bella/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/benjamin/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/bent/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/bob/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/breanna/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/brian/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/bruce/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/carlita/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/carlton/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/cathrin/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/charlie/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/cornelius/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/diana/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/florence/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/florent/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/gozer/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/hi/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/holmes/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/hortensia/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/huey/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/hugo/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/jaeger/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/lucy/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/lunetius/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/noble/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/octoplushy/edit.mjs
Normal file
86
sites/lab/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/lab/pages/account/patterns/otis/edit.mjs
Normal file
86
sites/lab/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',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/paco/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/paco/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Paco } from 'designs/paco/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('paco', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditPacoPage = ({ 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="Paco" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="paco"
|
||||
Design={Paco}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPacoPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'paco'],
|
||||
title: 'Paco',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/penelope/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/penelope/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Penelope } from 'designs/penelope/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('penelope', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditPenelopePage = ({ 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="Penelope" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="penelope"
|
||||
Design={Penelope}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPenelopePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'penelope'],
|
||||
title: 'Penelope',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/sandy/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/sandy/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Sandy } from 'designs/sandy/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('sandy', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSandyPage = ({ 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="Sandy" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="sandy"
|
||||
Design={Sandy}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditSandyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'sandy'],
|
||||
title: 'Sandy',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/shelly/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/shelly/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Shelly } from 'designs/shelly/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('shelly', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditShellyPage = ({ 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="Shelly" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="shelly"
|
||||
Design={Shelly}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditShellyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'shelly'],
|
||||
title: 'Shelly',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/shin/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/shin/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Shin } from 'designs/shin/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('shin', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditShinPage = ({ 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="Shin" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="shin"
|
||||
Design={Shin}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditShinPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'shin'],
|
||||
title: 'Shin',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/simon/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/simon/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Simon } from 'designs/simon/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('simon', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSimonPage = ({ 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="Simon" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="simon"
|
||||
Design={Simon}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditSimonPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'simon'],
|
||||
title: 'Simon',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/simone/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/simone/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Simone } from 'designs/simone/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('simone', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSimonePage = ({ 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="Simone" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="simone"
|
||||
Design={Simone}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditSimonePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'simone'],
|
||||
title: 'Simone',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/skully/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/skully/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Skully } from 'designs/skully/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('skully', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSkullyPage = ({ 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="Skully" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="skully"
|
||||
Design={Skully}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditSkullyPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'skully'],
|
||||
title: 'Skully',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/sven/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/sven/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Sven } from 'designs/sven/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('sven', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditSvenPage = ({ 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="Sven" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="sven"
|
||||
Design={Sven}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditSvenPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'sven'],
|
||||
title: 'Sven',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/tamiko/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/tamiko/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Tamiko } from 'designs/tamiko/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('tamiko', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTamikoPage = ({ 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="Tamiko" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="tamiko"
|
||||
Design={Tamiko}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditTamikoPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'tamiko'],
|
||||
title: 'Tamiko',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/teagan/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/teagan/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Teagan } from 'designs/teagan/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('teagan', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTeaganPage = ({ 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="Teagan" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="teagan"
|
||||
Design={Teagan}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditTeaganPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'teagan'],
|
||||
title: 'Teagan',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/tiberius/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/tiberius/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Tiberius } from 'designs/tiberius/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('tiberius', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTiberiusPage = ({ 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="Tiberius" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="tiberius"
|
||||
Design={Tiberius}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditTiberiusPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'tiberius'],
|
||||
title: 'Tiberius',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/titan/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/titan/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Titan } from 'designs/titan/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('titan', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTitanPage = ({ 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="Titan" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="titan"
|
||||
Design={Titan}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditTitanPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'titan'],
|
||||
title: 'Titan',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/trayvon/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/trayvon/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Trayvon } from 'designs/trayvon/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('trayvon', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditTrayvonPage = ({ 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="Trayvon" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="trayvon"
|
||||
Design={Trayvon}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditTrayvonPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'trayvon'],
|
||||
title: 'Trayvon',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/uma/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/uma/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Uma } from 'designs/uma/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('uma', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditUmaPage = ({ 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="Uma" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="uma"
|
||||
Design={Uma}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditUmaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'uma'],
|
||||
title: 'Uma',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/wahid/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/wahid/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Wahid } from 'designs/wahid/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('wahid', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWahidPage = ({ 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="Wahid" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="wahid"
|
||||
Design={Wahid}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditWahidPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'wahid'],
|
||||
title: 'Wahid',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/walburga/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/walburga/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Walburga } from 'designs/walburga/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('walburga', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWalburgaPage = ({ 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="Walburga" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="walburga"
|
||||
Design={Walburga}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditWalburgaPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'walburga'],
|
||||
title: 'Walburga',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/waralee/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/waralee/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Waralee } from 'designs/waralee/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('waralee', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditWaraleePage = ({ 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="Waralee" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="waralee"
|
||||
Design={Waralee}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditWaraleePage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'waralee'],
|
||||
title: 'Waralee',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
86
sites/lab/pages/account/patterns/yuri/edit.mjs
Normal file
86
sites/lab/pages/account/patterns/yuri/edit.mjs
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* This page is auto-generated. Do not edit it by hand.
|
||||
*/
|
||||
import { Yuri } from 'designs/yuri/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('yuri', wbNs, pageNs)
|
||||
|
||||
const EditDesignComponent = ({ id, design, Design, settings }) => (
|
||||
<Workbench preload={{ settings }} saveAs={{ pattern: id }} {...{ design, Design }} />
|
||||
)
|
||||
|
||||
const EditYuriPage = ({ 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="Yuri" layout={pattern ? WorkbenchLayout : false} header={null}>
|
||||
{pattern ? (
|
||||
<EditDesignComponent
|
||||
id={pattern.id}
|
||||
settings={pattern.settings}
|
||||
design="yuri"
|
||||
Design={Yuri}
|
||||
/>
|
||||
) : (
|
||||
<div>
|
||||
<h1>{t('account:oneMomentPLease')}</h1>
|
||||
<Loading />
|
||||
</div>
|
||||
)}
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditYuriPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns', 'yuri'],
|
||||
title: 'Yuri',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
66
sites/lab/pages/account/set.mjs
Normal file
66
sites/lab/pages/account/set.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 setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicSet = dynamic(
|
||||
() => import('shared/components/account/sets.mjs').then((mod) => mod.Mset),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const SetPage = ({ page }) => {
|
||||
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}`}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicSet id={id} />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default SetPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'set'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
59
sites/lab/pages/account/sets.mjs
Normal file
59
sites/lab/pages/account/sets.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 setsNs } from 'shared/components/account/bookmarks.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
* So for these, we run a dynamic import and disable SSR rendering
|
||||
*/
|
||||
const DynamicAuthWrapper = dynamic(
|
||||
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
const DynamicSets = dynamic(
|
||||
() => import('shared/components/account/sets.mjs').then((mod) => mod.Sets),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
/*
|
||||
* Each page MUST be wrapped in the PageWrapper component.
|
||||
* You also MUST spread props.page into this wrapper component
|
||||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountSetsPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('sets')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicSets />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountSetsPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'bookmarks'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ const BookmarkPage = ({ page }) => {
|
|||
setId(newId)
|
||||
getBookmark(newId)
|
||||
}
|
||||
}, [id])
|
||||
}, [id, backend, setLoadingStatus])
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={`${t('bookmarks')}: ${bookmark?.title}`}>
|
||||
|
|
|
@ -30,9 +30,11 @@ const textShadow = {
|
|||
},
|
||||
}
|
||||
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
export const BlogPreview = ({ post }) => (
|
||||
<Link href={`/${post.s}`} className="aspect-video relative">
|
||||
<img
|
||||
alt={post.caption}
|
||||
src={cloudflareImageUrl({ id: post.s.replace('/', '-'), variant: 'w1000' })}
|
||||
loading="lazy"
|
||||
className="rounded md:rounded-lg top-0 left-0"
|
||||
|
|
|
@ -17,9 +17,10 @@ const namespaces = nsMerge(pageNs, 'patrons')
|
|||
* FIXME: This entire page needs to be adapted once we
|
||||
* migrate users from v2 to v3
|
||||
*/
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
const Patron = ({ patron }) => (
|
||||
<div className="w-full text-center">
|
||||
<img src={patron.img} className="rounded-lg" />
|
||||
<img src={patron.img} alt={patron.username} className="rounded-lg" />
|
||||
<span className="font-medium text-sm">{patron.username}</span>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -25,6 +25,7 @@ const count = Object.values(examples).reduce((acc, val) =>
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
const ShowcaseIndexPage = ({ page }) => {
|
||||
const { t } = useTranslation()
|
||||
const [filter, setFilter] = useFilter()
|
||||
|
@ -84,6 +85,7 @@ const ShowcaseIndexPage = ({ page }) => {
|
|||
{list.map((slug) => (
|
||||
<Link href={`/${slug}`} className="text-center" key={slug}>
|
||||
<img
|
||||
alt={slug}
|
||||
src={cloudflareImageUrl({ id: slug.replace('/', '-'), variant: 'sq500' })}
|
||||
loading="lazy"
|
||||
className="rounded-lg w-full"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue