// Dependencies
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { nsMerge } from 'shared/utils.mjs'
import { freeSewingConfig as config } from 'shared/config/freesewing.config.mjs'
// Hooks
import { useTranslation } from 'next-i18next'
import { useState } from 'react'
// Components
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
import { WebLink, Link } from 'shared/components/link.mjs'
import { Popout } from 'shared/components/popout/index.mjs'
import { Joost } from 'shared/components/joost.mjs'
import { BareLayout } from 'site/components/layouts/bare.mjs'
import { Breadcrumbs } from 'shared/components/navigation/sitenav.mjs'
import {
DiscordIcon,
FacebookIcon,
GitHubIcon,
HeartIcon,
InstagramIcon,
RedditIcon,
TwitterIcon,
YouTubeIcon,
FreeSewingIcon,
} from 'shared/components/icons.mjs'
import { StringInput, MarkdownInput, DesignDropdown } from 'shared/components/inputs.mjs'
// Translation namespaces used on this page
const namespaces = nsMerge(pageNs, 'support', 'sections')
const SupportCard = ({ bg, textColor, title, icon, subtitle }) => (
{title}
{icon}
)
const socialIcon = {
discord: ,
facebook: ,
github: ,
instagram: ,
reddit: ,
twitter: ,
youtube: ,
}
/*
* 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 SupportPage = ({ page }) => {
const { t } = useTranslation(namespaces)
const [issue, setIssue] = useState(false)
const [mode, setMode] = useState(false)
const [edit, setEdit] = useState(false)
const [title, setTitle] = useState('')
const [design, setDesign] = useState('')
const [body, setBody] = useState('')
const pageTitle = mode ? t('createSupportRequest') : t('sections:support')
if (mode && !edit)
return (
{pageTitle}
{t('chooseYourUx')}
)
if (mode && edit)
return (
{pageTitle}
val.length > 10}
/>
Not related to a design}
label={t('design')}
update={setDesign}
current={design}
valid={(val) => val.length > 1}
/>
val.length > 10}
/>
)
return (
{pageTitle}
{/* Community */}
}
/>
{t('support:communitySupport1')}
{t('support:communitySupport2')}
{/* Contributors */}
}
/>
{t('support:contributorSupport2')}
{/* Maintainer */}
}
/>
{t('support:maintainerSupport2')}
{t('support:whatIsJoost')}
{t('support:whatIsJoost1')}
)
}
export default SupportPage
export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale, namespaces)),
page: {
locale,
path: ['patrons', 'thanks'],
},
},
}
}