webapp/src/components/Discours/Footer.tsx

113 lines
3.9 KiB
TypeScript
Raw Normal View History

import { clsx } from 'clsx'
2024-06-25 22:52:46 +00:00
import { For, createSignal, onMount } from 'solid-js'
import { useLocalize } from '../../context/localize'
2022-11-14 17:41:05 +00:00
import { Icon } from '../_shared/Icon'
import { Newsletter } from '../_shared/Newsletter'
import styles from './Footer.module.scss'
2022-09-09 11:53:35 +00:00
2024-06-25 22:52:46 +00:00
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<Array<{ header: string, items: FooterItem[]}>>([])
2022-09-09 11:53:35 +00:00
2024-06-25 22:52:46 +00:00
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' },
],
},
])
})
2022-09-09 11:53:35 +00:00
return (
2024-06-25 22:52:46 +00:00
2022-10-19 22:16:17 +00:00
<footer class={styles.discoursFooter}>
2022-11-20 21:23:12 +00:00
<div class="wide-container">
2022-09-09 11:53:35 +00:00
<div class="row">
2024-06-25 22:52:46 +00:00
<For each={footerLinks()}>
2022-09-09 11:53:35 +00:00
{({ header, items }) => (
2023-03-10 17:42:48 +00:00
<div class="col-sm-8 col-md-6">
2024-06-25 22:52:46 +00:00
<h5>{t(header)}</h5>
2022-09-09 11:53:35 +00:00
<ul>
<For each={items}>
2024-06-25 22:52:46 +00:00
{({ slug, title, rel }: FooterItem) => (
2022-09-09 11:53:35 +00:00
<li>
{' '}
2024-06-25 22:52:46 +00:00
<a href={slug} rel={rel}>
{rel ? title : t(title)}
2023-02-17 09:21:02 +00:00
</a>{' '}
2022-09-09 11:53:35 +00:00
</li>
)}
</For>
</ul>
</div>
)}
</For>
2023-03-10 17:42:48 +00:00
<div class="col-md-6">
2022-09-09 11:53:35 +00:00
<h5>{t('Subscription')}</h5>
<p>{t('Join our maillist')}</p>
<Newsletter />
2022-09-09 11:53:35 +00:00
</div>
</div>
2022-10-19 22:16:17 +00:00
<div class={clsx(styles.footerCopyright, 'row')}>
2023-03-10 17:42:48 +00:00
<div class="col-md-18 col-lg-20">
2023-02-17 09:21:02 +00:00
{t(
'Independant magazine with an open horizontal cooperation about culture, science and society',
2023-02-17 09:21:02 +00:00
)}
. {t('Discours')} &copy; 2015&ndash;{new Date().getFullYear()}{' '}
2022-09-09 11:53:35 +00:00
<a href="/about/terms-of-use">{t('Terms of use')}</a>
</div>
2023-03-10 17:42:48 +00:00
<div class={clsx(styles.footerCopyrightSocial, 'col-md-6 col-lg-4')}>
2024-02-05 15:04:23 +00:00
<For each={social}>
2024-06-25 22:52:46 +00:00
{(provider) => (
<div class={clsx(styles.socialItem, styles[`socialItem${provider.name}` as keyof typeof styles])}>
<a href={provider.href}>
<Icon name={`${provider.name}-white`} class={styles.icon} />
</a>
</div>
)}
2022-09-09 11:53:35 +00:00
</For>
</div>
</div>
</div>
</footer>
)
}