chore(lab): Speed up the lab by removing things
This commit is contained in:
parent
904649bb7d
commit
527e65697f
30 changed files with 412 additions and 70 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -39,7 +39,6 @@ packages/new-design/lib/banner.mjs
|
||||||
|
|
||||||
# Lab auto-generated content
|
# Lab auto-generated content
|
||||||
sites/lab/lib
|
sites/lab/lib
|
||||||
sites/lab/pages/*
|
|
||||||
sites/lab/public/android-chrome-192x192.png
|
sites/lab/public/android-chrome-192x192.png
|
||||||
sites/lab/public/android-chrome-384x384.png
|
sites/lab/public/android-chrome-384x384.png
|
||||||
sites/lab/public/apple-touch-icon.png
|
sites/lab/public/apple-touch-icon.png
|
||||||
|
@ -50,10 +49,6 @@ sites/lab/public/favicon.ico
|
||||||
sites/lab/public/mstile-150x150.png
|
sites/lab/public/mstile-150x150.png
|
||||||
sites/lab/public/safari-pinned-tab.svg
|
sites/lab/public/safari-pinned-tab.svg
|
||||||
sites/lab/public/site.webmanifest
|
sites/lab/public/site.webmanifest
|
||||||
# but not the indexes
|
|
||||||
!sites/lab/pages/index.mjs
|
|
||||||
!sites/lab/pages/code/index.mjs
|
|
||||||
!sites/lab/pages/docs/index.mjs
|
|
||||||
|
|
||||||
# dev auto-generated content
|
# dev auto-generated content
|
||||||
sites/dev/public/android-chrome-192x192.png
|
sites/dev/public/android-chrome-192x192.png
|
||||||
|
|
|
@ -1,2 +1,13 @@
|
||||||
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
|
import { WebLink } from 'shared/components/link.mjs'
|
||||||
|
|
||||||
// This is how we skip the docs in the lab
|
// This is how we skip the docs in the lab
|
||||||
export const DynamicOrgDocs = false
|
export const DynamicOrgDocs = () => (
|
||||||
|
<Popout note>
|
||||||
|
<h5>The FreeSewing lab does not include documentation</h5>
|
||||||
|
<p>
|
||||||
|
Go to <WebLink href="https://freesewing.org/" txt="FreeSewing.org" /> if you want all features
|
||||||
|
enabled.
|
||||||
|
</p>
|
||||||
|
</Popout>
|
||||||
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import configBuilder from '../shared/config/next.mjs'
|
import configBuilder from '../shared/config/next.mjs'
|
||||||
import i18nConfig from './next-i18next.config.js'
|
import i18nConfig from './next-i18next.config.js'
|
||||||
import { banner } from '../../scripts/banner.mjs'
|
import { banner } from '../../scripts/banner.mjs'
|
||||||
import withBundleAnalyzer from '@next/bundle-analyzer'
|
//import withBundleAnalyzer from '@next/bundle-analyzer'
|
||||||
|
|
||||||
let config = configBuilder({ site: 'lab' })
|
let config = configBuilder({ site: 'lab' })
|
||||||
config.i18n = i18nConfig.i18n
|
config.i18n = i18nConfig.i18n
|
||||||
|
@ -16,6 +16,6 @@ config.eslint = {
|
||||||
|
|
||||||
// To run the bundle analyzer, run:
|
// To run the bundle analyzer, run:
|
||||||
// ANALYZE=true yarn build
|
// ANALYZE=true yarn build
|
||||||
if (process.env.ANALYZE) config = withBundleAnalyzer(config)(config)
|
//if (process.env.ANALYZE) config = withBundleAnalyzer(config)(config)
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
|
|
|
@ -1,44 +1,11 @@
|
||||||
import 'shared/styles/globals.css'
|
import 'shared/styles/globals.css'
|
||||||
import { appWithTranslation } from 'next-i18next'
|
import { appWithTranslation } from 'next-i18next'
|
||||||
import React from 'react'
|
|
||||||
import Bugsnag from '@bugsnag/js'
|
|
||||||
import BugsnagPluginReact from '@bugsnag/plugin-react'
|
|
||||||
import { siteConfig } from 'site/site.config.mjs'
|
|
||||||
import { Toaster as DefaultToaster } from 'react-hot-toast'
|
|
||||||
import { ContextWrapper } from 'shared/components/wrappers/context.mjs'
|
import { ContextWrapper } from 'shared/components/wrappers/context.mjs'
|
||||||
|
|
||||||
Bugsnag.start({
|
|
||||||
apiKey: siteConfig.bugsnag.key,
|
|
||||||
collectUserIp: false,
|
|
||||||
plugins: [new BugsnagPluginReact()],
|
|
||||||
})
|
|
||||||
|
|
||||||
const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React)
|
|
||||||
|
|
||||||
const FreeSewingLab = ({ Component, pageProps }) => (
|
const FreeSewingLab = ({ Component, pageProps }) => (
|
||||||
<ErrorBoundary>
|
|
||||||
<ContextWrapper>
|
<ContextWrapper>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
<DefaultToaster
|
|
||||||
position="bottom-right"
|
|
||||||
toastOptions={{
|
|
||||||
className: 'bg-base-100 text-base-content',
|
|
||||||
success: {
|
|
||||||
className: 'bg-success text-success-content',
|
|
||||||
},
|
|
||||||
error: {
|
|
||||||
className: 'bg-error text-error-content',
|
|
||||||
},
|
|
||||||
loading: {
|
|
||||||
className: 'bg-warning text-warning-content',
|
|
||||||
},
|
|
||||||
custom: {
|
|
||||||
className: 'bg-accent text-accent-content',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ContextWrapper>
|
</ContextWrapper>
|
||||||
</ErrorBoundary>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
export default appWithTranslation(FreeSewingLab)
|
export default appWithTranslation(FreeSewingLab)
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Components
|
// Components
|
||||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
import { WebLink } from 'shared/components/web-link.mjs'
|
import { WebLink } from 'shared/components/link.mjs'
|
||||||
import { siteConfig } from 'site/site.config.mjs'
|
import { siteConfig } from 'site/site.config.mjs'
|
||||||
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
||||||
import { ChoiceLink } from 'shared/components/choice-link.mjs'
|
import { ChoiceLink } from 'shared/components/choice-link.mjs'
|
||||||
|
|
50
sites/lab/pages/new/[design].mjs
Normal file
50
sites/lab/pages/new/[design].mjs
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
// Hooks
|
||||||
|
import { useDesign, collection } from 'shared/hooks/use-design.mjs'
|
||||||
|
// Dependencies
|
||||||
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
|
// Components
|
||||||
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
import { Workbench, ns as wbNs } from 'shared/components/workbench/new.mjs'
|
||||||
|
import { WorkbenchLayout } from 'site/components/layouts/workbench.mjs'
|
||||||
|
import { DynamicOrgDocs as DynamicDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
|
// Translation namespaces used on this page
|
||||||
|
const namespaces = nsMerge(wbNs, pageNs)
|
||||||
|
|
||||||
|
const NewDesignPage = ({ page, design }) => {
|
||||||
|
const Design = useDesign(design)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageWrapper {...page} title={design} layout={WorkbenchLayout} header={null}>
|
||||||
|
<Workbench {...{ design, Design, DynamicDocs }} />
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NewDesignPage
|
||||||
|
|
||||||
|
export async function getStaticProps({ locale, params }) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale, [params.design, ...namespaces])),
|
||||||
|
design: params.design,
|
||||||
|
page: {
|
||||||
|
locale,
|
||||||
|
path: ['new', params.design],
|
||||||
|
title: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||||
|
* this page should be used to generate the result.
|
||||||
|
*/
|
||||||
|
export async function getStaticPaths() {
|
||||||
|
return {
|
||||||
|
paths: [...collection.map((design) => `/new/${design}`)],
|
||||||
|
fallback: 'blocking',
|
||||||
|
}
|
||||||
|
}
|
143
sites/lab/pages/new/index.mjs
Normal file
143
sites/lab/pages/new/index.mjs
Normal file
|
@ -0,0 +1,143 @@
|
||||||
|
// Dependencies
|
||||||
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
|
// Hooks
|
||||||
|
import { useTranslation } from 'next-i18next'
|
||||||
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
// Components
|
||||||
|
import Link from 'next/link'
|
||||||
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
import {
|
||||||
|
KeyIcon,
|
||||||
|
NewMsetIcon,
|
||||||
|
DesignIcon,
|
||||||
|
NewPatternIcon,
|
||||||
|
PluginIcon,
|
||||||
|
ShowcaseIcon,
|
||||||
|
RssIcon,
|
||||||
|
CsetIcon,
|
||||||
|
OpackIcon,
|
||||||
|
} from 'shared/components/icons.mjs'
|
||||||
|
|
||||||
|
// Translation namespaces used on this page
|
||||||
|
// Note that we include the account namespace here for the 'new' keyword
|
||||||
|
const namespaces = [...pageNs, 'account']
|
||||||
|
|
||||||
|
const Box = ({ title, Icon, description, href }) => {
|
||||||
|
const linkProps = {
|
||||||
|
href,
|
||||||
|
className:
|
||||||
|
'p-8 -ml-4 -mr-4 md:m-0 rounded-none md:rounded-xl md:shadow hover:bg-secondary bg-base-200 hover:bg-opacity-10 w-full max-w-lg',
|
||||||
|
}
|
||||||
|
|
||||||
|
const inner = (
|
||||||
|
<>
|
||||||
|
<h4 className="flex flex-row items-start justify-between w-full m-0 p-0 text-inherit">
|
||||||
|
<span>{title}</span>
|
||||||
|
<Icon className="w-12 h-12 -mt-2" stroke={1.5} />
|
||||||
|
</h4>
|
||||||
|
<div className={`normal-case text-base font-medium text-left pt-2 text-inherit`}>
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
|
return href.slice(0, 4) === 'http' ? (
|
||||||
|
<a {...linkProps}>{inner}</a>
|
||||||
|
) : (
|
||||||
|
<Link {...linkProps}>{inner}</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 NewIndexPage = ({ page }) => {
|
||||||
|
const { t } = useTranslation(['account'])
|
||||||
|
const { account } = useAccount()
|
||||||
|
|
||||||
|
const control = account.control ? account.control : 99
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageWrapper {...page} title={t('new')}>
|
||||||
|
<h2>{t('newPopular')}</h2>
|
||||||
|
<div className="w-full max-w-7xl flex flex-row flex-wrap gap-4">
|
||||||
|
<Box
|
||||||
|
title={t('patternNew')}
|
||||||
|
Icon={NewPatternIcon}
|
||||||
|
description={t('patternNewInfo')}
|
||||||
|
href="/new/pattern"
|
||||||
|
/>
|
||||||
|
<Box title={t('newSet')} Icon={NewMsetIcon} description={t('setNewInfo')} href="/new/set" />
|
||||||
|
</div>
|
||||||
|
{control > 3 ? (
|
||||||
|
<>
|
||||||
|
<h2>{t('newShare')}</h2>
|
||||||
|
<div className="w-full max-w-7xl flex flex-row flex-wrap gap-4">
|
||||||
|
<Box
|
||||||
|
title={t('csetNew')}
|
||||||
|
Icon={CsetIcon}
|
||||||
|
description={t('csetNewInfo')}
|
||||||
|
href="/new/cset"
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
title={t('opackNew')}
|
||||||
|
Icon={OpackIcon}
|
||||||
|
description={t('opackNewInfo')}
|
||||||
|
href="/new/opack"
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
title={t('showcaseNew')}
|
||||||
|
Icon={ShowcaseIcon}
|
||||||
|
description={t('showcaseNewInfo')}
|
||||||
|
href="/new/showcase"
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
title={t('blogNew')}
|
||||||
|
Icon={RssIcon}
|
||||||
|
description={t('blogNewInfo')}
|
||||||
|
href="/new/blog"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<h2>{t('newDev')}</h2>
|
||||||
|
<div className="w-full max-w-7xl flex flex-row flex-wrap gap-4">
|
||||||
|
<Box
|
||||||
|
title={t('newApikey')}
|
||||||
|
Icon={KeyIcon}
|
||||||
|
description={t('keyNewInfo')}
|
||||||
|
href="/new/apikey"
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
title={t('designNew')}
|
||||||
|
Icon={DesignIcon}
|
||||||
|
description={t('designNewInfo')}
|
||||||
|
href="https://freesewing.dev/tutorials/pattern-design"
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
title={t('pluginNew')}
|
||||||
|
Icon={PluginIcon}
|
||||||
|
description={t('pluginNewInfo')}
|
||||||
|
href="https://freesewing.dev/guides/plugins"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NewIndexPage
|
||||||
|
|
||||||
|
export async function getStaticProps({ locale }) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale, namespaces)),
|
||||||
|
page: {
|
||||||
|
locale,
|
||||||
|
path: ['new'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
43
sites/lab/pages/new/pattern.mjs
Normal file
43
sites/lab/pages/new/pattern.mjs
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
// Dependencies
|
||||||
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
|
// Hooks
|
||||||
|
import { useTranslation } from 'next-i18next'
|
||||||
|
// Components
|
||||||
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||||
|
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||||
|
import { DesignPicker, ns as designNs } from 'shared/components/designs/design-picker.mjs'
|
||||||
|
|
||||||
|
// Translation namespaces used on this page
|
||||||
|
const ns = nsMerge(designNs, setsNs, authNs, pageNs)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 NewSetPage = ({ page }) => {
|
||||||
|
const { t } = useTranslation(ns)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageWrapper {...page} title={t('newPattern')}>
|
||||||
|
<DesignPicker />
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NewSetPage
|
||||||
|
|
||||||
|
export async function getStaticProps({ locale }) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale, ns)),
|
||||||
|
page: {
|
||||||
|
locale,
|
||||||
|
path: ['new', 'pattern'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
92
sites/lab/pages/signin/callback/[provider].mjs
Normal file
92
sites/lab/pages/signin/callback/[provider].mjs
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
// Dependencies
|
||||||
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
|
// Hooks
|
||||||
|
import { useEffect, useContext } from 'react'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
import { useTranslation } from 'next-i18next'
|
||||||
|
// Context
|
||||||
|
import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs'
|
||||||
|
// Components
|
||||||
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
import { BareLayout } from 'site/components/layouts/bare.mjs'
|
||||||
|
//import { SignIn, ns as susiNs } from 'shared/components/susi/sign-in.mjs'
|
||||||
|
import { Loading } from 'shared/components/spinner.mjs'
|
||||||
|
|
||||||
|
const ns = nsMerge(pageNs)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 OauthCallbackPage = ({ page, provider }) => {
|
||||||
|
const router = useRouter()
|
||||||
|
const { t } = useTranslation(ns)
|
||||||
|
const backend = useBackend()
|
||||||
|
const { setAccount, setToken, setSeenUser } = useAccount()
|
||||||
|
const { setLoadingStatus } = useContext(LoadingStatusContext)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const oauthFlow = async () => {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search)
|
||||||
|
const state = urlParams.get('state')
|
||||||
|
const code = urlParams.get('code')
|
||||||
|
const result = await backend.oauthSignIn({ state, code, provider })
|
||||||
|
if (result.data?.account && result.data?.token) {
|
||||||
|
setAccount(result.data.account)
|
||||||
|
setToken(result.data.token)
|
||||||
|
setSeenUser(result.data.account.username)
|
||||||
|
setLoadingStatus([
|
||||||
|
true,
|
||||||
|
t('susi:welcomeBackName', { name: result.data.account.username }),
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
])
|
||||||
|
router.push('/welcome')
|
||||||
|
} else setLoadingStatus([true, 'backendError', true, true])
|
||||||
|
}
|
||||||
|
oauthFlow()
|
||||||
|
}, [provider])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageWrapper {...page} layout={BareLayout}>
|
||||||
|
<div className="flex flex-col items-center h-screen justify-center text-base-content px-4">
|
||||||
|
<div className="max-w-lg w-full">
|
||||||
|
<Loading />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default OauthCallbackPage
|
||||||
|
|
||||||
|
export async function getStaticProps({ locale, params }) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale, ns)),
|
||||||
|
provider: params.provider,
|
||||||
|
page: {
|
||||||
|
locale,
|
||||||
|
path: ['signin', 'callback', params.provider],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* getStaticPaths() is used to specify for which routes (think URLs)
|
||||||
|
* this page should be used to generate the result.
|
||||||
|
*
|
||||||
|
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
||||||
|
*/
|
||||||
|
export async function getStaticPaths() {
|
||||||
|
return {
|
||||||
|
paths: [`/signin/callback/github`, `/signin/callback/google`],
|
||||||
|
fallback: false,
|
||||||
|
}
|
||||||
|
}
|
41
sites/lab/pages/signin/index.mjs
Normal file
41
sites/lab/pages/signin/index.mjs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
// Dependencies
|
||||||
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
|
// Components
|
||||||
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
import { BareLayout } from 'site/components/layouts/bare.mjs'
|
||||||
|
import { SignIn, ns as susiNs } from 'shared/components/susi/sign-in.mjs'
|
||||||
|
|
||||||
|
const ns = nsMerge(susiNs, pageNs)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 SignInPage = ({ page }) => {
|
||||||
|
return (
|
||||||
|
<PageWrapper {...page} layout={BareLayout}>
|
||||||
|
<div className="flex flex-col items-center h-screen justify-center text-base-content px-4">
|
||||||
|
<div className="max-w-lg w-full">
|
||||||
|
<SignIn />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SignInPage
|
||||||
|
|
||||||
|
export async function getStaticProps({ locale }) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale, ns)),
|
||||||
|
page: {
|
||||||
|
locale,
|
||||||
|
path: ['signin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,7 @@ import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { LeftIcon, PlusIcon, CopyIcon, RightIcon, TrashIcon } from 'shared/components/icons.mjs'
|
import { LeftIcon, PlusIcon, CopyIcon, RightIcon, TrashIcon } from 'shared/components/icons.mjs'
|
||||||
import { PageLink, Link } from 'shared/components/link.mjs'
|
import { PageLink, Link } from 'shared/components/link.mjs'
|
||||||
import { StringInput, ListInput, FormControl } from 'shared/components/inputs.mjs'
|
import { StringInput, ListInput, FormControl } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { MarkdownInput } from 'shared/components/inputs.mjs'
|
import { MarkdownInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
import { TipIcon } from 'shared/components/icons.mjs'
|
import { TipIcon } from 'shared/components/icons.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { PlusIcon, TrashIcon, LeftIcon } from 'shared/components/icons.mjs'
|
||||||
import { PageLink, WebLink, Link } from 'shared/components/link.mjs'
|
import { PageLink, WebLink, Link } from 'shared/components/link.mjs'
|
||||||
import { DisplayRow } from './shared.mjs'
|
import { DisplayRow } from './shared.mjs'
|
||||||
import { StringInput } from 'shared/components/inputs.mjs'
|
import { StringInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { ListInput } from 'shared/components/inputs.mjs'
|
import { ListInput } from 'shared/components/inputs.mjs'
|
||||||
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { BackToAccountButton, Icons, welcomeSteps } from './shared.mjs'
|
import { BackToAccountButton, Icons, welcomeSteps } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { ListInput } from 'shared/components/inputs.mjs'
|
import { ListInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
import { ControlScore } from 'shared/components/control/score.mjs'
|
import { ControlScore } from 'shared/components/control/score.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { validateEmail, validateTld } from 'shared/utils.mjs'
|
||||||
import { BackToAccountButton } from './shared.mjs'
|
import { BackToAccountButton } from './shared.mjs'
|
||||||
import { Popout } from 'shared/components/popout/index.mjs'
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { EmailInput } from 'shared/components/inputs.mjs'
|
import { EmailInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { BackToAccountButton } from './shared.mjs'
|
import { BackToAccountButton } from './shared.mjs'
|
||||||
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
||||||
import { StringInput } from 'shared/components/inputs.mjs'
|
import { StringInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
||||||
import { PassiveImageInput } from 'shared/components/inputs.mjs'
|
import { PassiveImageInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { Icons, welcomeSteps, BackToAccountButton, NumberBullet } from './shared.mjs'
|
import { Icons, welcomeSteps, BackToAccountButton, NumberBullet } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { ListInput } from 'shared/components/inputs.mjs'
|
import { ListInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
// Components
|
// Components
|
||||||
import { BackToAccountButton, NumberBullet } from './shared.mjs'
|
import { BackToAccountButton, NumberBullet } from './shared.mjs'
|
||||||
import { ListInput } from 'shared/components/inputs.mjs'
|
import { ListInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
// Config
|
// Config
|
||||||
import { siteConfig as conf } from 'site/site.config.mjs'
|
import { siteConfig as conf } from 'site/site.config.mjs'
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { BackToAccountButton, Icons, welcomeSteps } from './shared.mjs'
|
import { BackToAccountButton, Icons, welcomeSteps } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { ListInput } from 'shared/components/inputs.mjs'
|
import { ListInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { SaveSettingsButton } from 'shared/components/buttons/save-settings-butt
|
||||||
import { Popout } from 'shared/components/popout/index.mjs'
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { RightIcon } from 'shared/components/icons.mjs'
|
import { RightIcon } from 'shared/components/icons.mjs'
|
||||||
import { PasswordInput } from 'shared/components/inputs.mjs'
|
import { PasswordInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import { ModalWrapper } from 'shared/components/wrappers/modal.mjs'
|
||||||
import Markdown from 'react-markdown'
|
import Markdown from 'react-markdown'
|
||||||
import Timeago from 'react-timeago'
|
import Timeago from 'react-timeago'
|
||||||
import { TableWrapper } from 'shared/components/wrappers/table.mjs'
|
import { TableWrapper } from 'shared/components/wrappers/table.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'patterns', 'status']
|
export const ns = ['account', 'patterns', 'status']
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { BackToAccountButton } from './shared.mjs'
|
import { BackToAccountButton } from './shared.mjs'
|
||||||
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
||||||
import { StringInput } from 'shared/components/inputs.mjs'
|
import { StringInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ import { ModalWrapper } from 'shared/components/wrappers/modal.mjs'
|
||||||
import Markdown from 'react-markdown'
|
import Markdown from 'react-markdown'
|
||||||
import Timeago from 'react-timeago'
|
import Timeago from 'react-timeago'
|
||||||
import { DisplayRow } from './shared.mjs'
|
import { DisplayRow } from './shared.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
import {
|
import {
|
||||||
StringInput,
|
StringInput,
|
||||||
PassiveImageInput,
|
PassiveImageInput,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { StringInput } from 'shared/components/inputs.mjs'
|
import { StringInput } from 'shared/components/inputs.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import Link from 'next/link'
|
||||||
import { Robot } from 'shared/components/robot/index.mjs'
|
import { Robot } from 'shared/components/robot/index.mjs'
|
||||||
import { StringInput, PasswordInput } from 'shared/components/inputs.mjs'
|
import { StringInput, PasswordInput } from 'shared/components/inputs.mjs'
|
||||||
import { FreeSewingAnimation } from 'shared/components/animations/freesewing.mjs'
|
import { FreeSewingAnimation } from 'shared/components/animations/freesewing.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs as DynamicDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
// Translation namespaces used on this page
|
// Translation namespaces used on this page
|
||||||
export const ns = ['signup', 'errros', 'account']
|
export const ns = ['signup', 'errros', 'account']
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { nsMerge } from 'shared/utils.mjs'
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
import { MeasieInput, ns as inputNs } from 'shared/components/inputs.mjs'
|
import { MeasieInput, ns as inputNs } from 'shared/components/inputs.mjs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = nsMerge('workbench', inputNs)
|
export const ns = nsMerge('workbench', inputNs)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { StringInput, MarkdownInput } from 'shared/components/inputs.mjs'
|
||||||
import { UploadIcon, EditIcon, PlusIcon, BookmarkIcon } from 'shared/components/icons.mjs'
|
import { UploadIcon, EditIcon, PlusIcon, BookmarkIcon } from 'shared/components/icons.mjs'
|
||||||
import { Popout } from 'shared/components/popout/index.mjs'
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { PageLink } from 'shared/components/link.mjs'
|
import { PageLink } from 'shared/components/link.mjs'
|
||||||
import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
|
import { DynamicOrgDocs } from 'site/components/dynamic-org-docs.mjs'
|
||||||
|
|
||||||
export const ns = ['workbench', 'status']
|
export const ns = ['workbench', 'status']
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@ import path from 'path'
|
||||||
import fse from 'fs-extra'
|
import fse from 'fs-extra'
|
||||||
|
|
||||||
const copyFromOrg = [
|
const copyFromOrg = [
|
||||||
['account'],
|
//['account'],
|
||||||
['confirm'],
|
//['confirm'],
|
||||||
['designs'],
|
//['designs'],
|
||||||
['new', 'index.mjs'],
|
['new', 'index.mjs'],
|
||||||
['new', '[design].mjs'],
|
['new', '[design].mjs'],
|
||||||
['patterns'],
|
//['patterns'],
|
||||||
['sets'],
|
//['sets'],
|
||||||
['signin'],
|
['signin'],
|
||||||
['signup'],
|
//['signup'],
|
||||||
]
|
]
|
||||||
|
|
||||||
const copyOrgFiles = () => {
|
const copyOrgFiles = () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue