diff --git a/app.config.ts b/app.config.ts index 3c3956ee..6d244961 100644 --- a/app.config.ts +++ b/app.config.ts @@ -5,10 +5,12 @@ import sassDts from 'vite-plugin-sass-dts' const isVercel = Boolean(process?.env.VERCEL) const isBun = Boolean(process.env.BUN) export default defineConfig({ + ssr: true, server: { preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node', port: 3000, }, + devOverlay: true, build: { chunkSizeWarningLimit: 1024, target: 'esnext', @@ -33,7 +35,7 @@ export default defineConfig({ preprocessorOptions: { scss: { additionalData: '@import "src/styles/imports";\n', - includePaths: ['public', 'src/styles'] + includePaths: ['./public', './src/styles'], }, }, }, diff --git a/src/components/Discours/Footer.tsx b/src/components/Discours/Footer.tsx index 8f5c5bdf..3ba356d0 100644 --- a/src/components/Discours/Footer.tsx +++ b/src/components/Discours/Footer.tsx @@ -1,127 +1,76 @@ import { clsx } from 'clsx' -import { For, createMemo } from 'solid-js' - +import { For, createSignal, onMount } from 'solid-js' import { useLocalize } from '../../context/localize' import { Icon } from '../_shared/Icon' import { Newsletter } from '../_shared/Newsletter' - import styles from './Footer.module.scss' -export const Footer = () => { + +const social = [ + { name: 'facebook', href: 'https://facebook.com/discoursio' }, + { name: 'vk', href: 'https://vk.com/discoursio' }, + { name: 'twitter', href: 'https://twitter.com/discours_io' }, + { name: 'telegram', href: 'https://t.me/discoursio' }, +] +type FooterItem = { + title: string + slug: string + rel?: string +} +export const FooterView = () => { const { t, lang } = useLocalize() + const [footerLinks, setFooterLinks] = createSignal>([]) - const changeLangTitle = createMemo(() => (lang() === 'ru' ? 'English' : 'Русский')) - const changeLangLink = createMemo(() => `?lng=${lang() === 'ru' ? 'en' : 'ru'}`) - const links = createMemo(() => [ - { - header: t('About the project'), - items: [ - { - title: t('Discours Manifest'), - slug: '/about/manifest', - }, - { - title: t('How it works'), - slug: '/about/guide', - }, - { - title: t('Dogma'), - slug: '/about/dogma', - }, - { - title: t('Principles'), - slug: '/about/principles', - }, - { - title: t('How to write an article'), - slug: '/how-to-write-a-good-article', - }, - ], - }, + onMount(() => { + setFooterLinks([ + { + header: t('About the project'), + items: [ + { title: t('Discours Manifest'), slug: '/about/manifest' }, + { title: t('How it works'), slug: '/about/guide' }, + { title: t('Dogma'), slug: '/about/dogma' }, + { title: t('Principles'), slug: '/about/principles' }, + { title: t('How to write an article'), slug: '/how-to-write-a-good-article' }, + ], + }, + { + header: t('Participating'), + items: [ + { title: t('Suggest an idea'), slug: '/connect' }, + { title: t('Become an author'), slug: '/create' }, + { title: t('Support Discours'), slug: '/about/help' }, + { title: t('Work with us'), slug: 'https://docs.google.com/forms/d/e/1FAIpQLSeNNvIzKlXElJtkPkYiXl-jQjlvsL9u4-kpnoRjz1O8Wo40xQ/viewform' }, + ], + }, + { + header: t('Sections'), + items: [ + { title: t('Authors'), slug: '/authors' }, + { title: t('Communities'), slug: '/community' }, + { title: t('Partners'), slug: '/about/partners' }, + { title: t('Special projects'), slug: '/about/projects' }, + { title: lang() === 'ru' ? 'English' : 'Русский', slug: `?lng=${lang() === 'ru' ? 'en' : 'ru'}`, rel: 'external' }, + ], + }, + ]) + }) - { - header: t('Participating'), - items: [ - { - title: t('Suggest an idea'), - slug: '/connect', - }, - { - title: t('Become an author'), - slug: '/create', - }, - { - title: t('Support Discours'), - slug: '/about/help', - }, - { - title: t('Work with us'), - slug: 'https://docs.google.com/forms/d/e/1FAIpQLSeNNvIzKlXElJtkPkYiXl-jQjlvsL9u4-kpnoRjz1O8Wo40xQ/viewform', - }, - ], - }, - - { - header: t('Sections'), - items: [ - { - title: t('Authors'), - slug: '/authors', - }, - { - title: t('Communities'), - slug: '/community', - }, - { - title: t('Partners'), - slug: '/about/partners', - }, - { - title: t('Special projects'), - slug: '/about/projects', - }, - { - title: changeLangTitle(), - slug: changeLangLink(), - rel: 'external', - }, - ], - }, - ]) - - const social = [ - { - name: 'facebook', - href: 'https://facebook.com/discoursio', - }, - { - name: 'vk', - href: 'https://vk.com/discoursio', - }, - { - name: 'twitter', - href: 'https://twitter.com/discours_io', - }, - { - name: 'telegram', - href: 'https://t.me/discoursio', - }, - ] return ( +