2021-03-22 16:32:59 +03:00
|
|
|
import LayoutMain from 'components/layout/layout-main'
|
|
|
|
import { GetServerSideProps, NextPage } from 'next'
|
2021-03-25 17:32:51 +03:00
|
|
|
import { withTree } from 'libs/server/middlewares/tree'
|
|
|
|
import { withUA } from 'libs/server/middlewares/ua'
|
2021-03-22 16:32:59 +03:00
|
|
|
import { TreeModel } from 'libs/shared/tree'
|
|
|
|
import { withSession } from 'libs/server/middlewares/session'
|
|
|
|
import { withStore } from 'libs/server/middlewares/store'
|
2021-03-25 17:32:51 +03:00
|
|
|
import { withSettings } from 'libs/server/middlewares/settings'
|
|
|
|
import { withAuth } from 'libs/server/middlewares/auth'
|
2021-03-26 18:16:23 +03:00
|
|
|
import { SettingsForm } from 'components/settings/settings-form'
|
2021-04-25 15:06:38 +03:00
|
|
|
import useI18n from 'libs/web/hooks/use-i18n'
|
2021-04-28 08:00:59 +03:00
|
|
|
import { withCsrf } from 'libs/server/middlewares/csrf'
|
2021-03-22 16:32:59 +03:00
|
|
|
|
2021-03-25 17:32:51 +03:00
|
|
|
const SettingsPage: NextPage<{ tree: TreeModel }> = ({ tree }) => {
|
2021-04-25 15:06:38 +03:00
|
|
|
const { t } = useI18n()
|
|
|
|
|
2021-03-22 16:32:59 +03:00
|
|
|
return (
|
|
|
|
<LayoutMain tree={tree}>
|
2021-03-25 17:32:51 +03:00
|
|
|
<main className="pt-40 px-6 m-auto prose">
|
|
|
|
<h1>
|
2021-04-25 15:06:38 +03:00
|
|
|
<span className="font-normal">{t('Settings')}</span>
|
2021-03-25 17:32:51 +03:00
|
|
|
</h1>
|
|
|
|
|
|
|
|
<SettingsForm />
|
|
|
|
</main>
|
2021-03-22 16:32:59 +03:00
|
|
|
</LayoutMain>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-03-25 17:32:51 +03:00
|
|
|
export default SettingsPage
|
2021-03-22 16:32:59 +03:00
|
|
|
|
|
|
|
export const getServerSideProps: GetServerSideProps = withUA(
|
2021-04-28 08:00:59 +03:00
|
|
|
withSession(withStore(withAuth(withTree(withSettings(withCsrf(() => ({})))))))
|
2021-03-22 16:32:59 +03:00
|
|
|
)
|