webapp/src/components/Discours/Footer.tsx

167 lines
4.2 KiB
TypeScript
Raw Normal View History

2023-03-04 17:26:28 +00:00
import { createMemo, For } from 'solid-js'
2022-10-19 22:16:17 +00:00
import styles from './Footer.module.scss'
2022-11-14 17:41:05 +00:00
import { Icon } from '../_shared/Icon'
2022-09-09 11:53:35 +00:00
import Subscribe from './Subscribe'
2023-02-17 09:21:02 +00:00
2022-10-25 15:40:12 +00:00
import { clsx } from 'clsx'
2023-02-17 09:21:02 +00:00
import { useLocalize } from '../../context/localize'
2022-09-09 11:53:35 +00:00
export const Footer = () => {
2023-02-17 09:21:02 +00:00
const { t, lang } = useLocalize()
const changeLangTitle = createMemo(() => (lang() === 'ru' ? 'English' : 'Русский'))
const changeLangLink = createMemo(() => '?lng=' + (lang() === 'ru' ? 'en' : 'ru'))
2022-09-09 11:53:35 +00:00
const links = createMemo(() => [
{
header: 'About the project',
items: [
{
title: 'Manifest',
slug: '/about/manifest'
},
{
title: 'How it works',
slug: '/about/guide'
},
{
title: 'Dogma',
slug: '/about/dogma'
},
{
2022-11-02 21:43:38 +00:00
title: 'Principles',
slug: '/about/principles'
2022-09-09 11:53:35 +00:00
},
{
title: 'How to write an article',
slug: '/how-to-write-a-good-article'
}
]
},
{
header: 'Participating',
items: [
{
title: 'Suggest an idea',
slug: '/connect'
},
{
title: 'Become an author',
slug: '/create'
},
{
title: 'Support us',
slug: '/about/help'
},
{
title: 'Feedback',
slug: '/#feedback'
},
{
title: 'Work with us',
slug: 'https://docs.google.com/forms/d/e/1FAIpQLSeNNvIzKlXElJtkPkYiXl-jQjlvsL9u4-kpnoRjz1O8Wo40xQ/viewform'
}
]
},
{
header: 'Sections',
items: [
{
title: 'Authors',
slug: '/authors'
},
{
title: 'Communities',
slug: '/community'
},
{
title: 'Partners',
slug: '/about/partners'
},
{
title: 'Special projects',
slug: '/about/projects'
},
{
2023-02-17 09:21:02 +00:00
title: changeLangTitle(),
slug: changeLangLink(),
rel: 'external'
2022-09-09 11:53:35 +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'
}
]
return (
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">
<For each={links()}>
{({ header, items }) => (
2022-10-19 22:16:17 +00:00
<div class="col-sm-4 col-md-3">
2022-09-09 11:53:35 +00:00
<h5>{t(header)}</h5>
<ul>
<For each={items}>
2023-02-17 09:21:02 +00:00
{({ slug, title, ...rest }) => (
2022-09-09 11:53:35 +00:00
<li>
{' '}
2023-02-17 09:21:02 +00:00
<a href={slug} {...rest}>
{slug.startsWith('?') ? title : t(title)}
</a>{' '}
2022-09-09 11:53:35 +00:00
</li>
)}
</For>
</ul>
</div>
)}
</For>
<div class="col-md-3">
<h5>{t('Subscription')}</h5>
<p>{t('Join our maillist')}</p>
<Subscribe />
</div>
</div>
2022-10-19 22:16:17 +00:00
<div class={clsx(styles.footerCopyright, 'row')}>
<div class="col-md-9 col-lg-10">
2023-02-17 09:21:02 +00:00
{t(
'Independant magazine with an open horizontal cooperation about culture, science and society'
)}
. {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>
2022-10-19 22:16:17 +00:00
<div class={clsx(styles.footerCopyrightSocial, 'col-md-3 col-lg-2')}>
2023-02-17 09:21:02 +00:00
<For each={SOCIAL}>
2022-09-09 11:53:35 +00:00
{(social) => (
2022-10-19 22:16:17 +00:00
<div class={clsx(styles.socialItem, styles[`socialItem${social.name}`])}>
2022-09-09 11:53:35 +00:00
<a href={social.href}>
2022-10-19 22:16:17 +00:00
<Icon name={`${social.name}-white`} class={styles.icon} />
2022-09-09 11:53:35 +00:00
</a>
</div>
)}
</For>
</div>
</div>
</div>
</footer>
)
}