nova-betterchat/src/components/AboutMenu/AboutMenu.tsx

145 lines
4.9 KiB
TypeScript
Raw Normal View History

2023-03-06 12:53:20 +01:00
import React, { useState } from 'react';
import { useTranslation, Trans } from 'react-i18next';
2023-03-06 12:53:20 +01:00
import PopupModal from '@components/PopupModal';
import AboutIcon from '@icon/AboutIcon';
const AboutMenu = () => {
const { t } = useTranslation(['main', 'about']);
2023-03-06 12:53:20 +01:00
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
return (
<>
<a
className='flex py-3 px-3 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm'
onClick={() => {
setIsModalOpen(true);
}}
>
<div>
<AboutIcon />
</div>
{t('about')}
2023-03-06 12:53:20 +01:00
</a>
{isModalOpen && (
<PopupModal
2023-03-11 19:34:10 +01:00
title={t('about') as string}
2023-03-06 12:53:20 +01:00
setIsModalOpen={setIsModalOpen}
cancelButton={false}
>
<div className='p-6 border-b border-gray-200 dark:border-gray-600'>
2023-03-11 19:34:10 +01:00
<div className='min-w-fit text-gray-900 dark:text-gray-300 text-sm flex flex-col gap-3 leading-relaxed'>
<p>{t('description', { ns: 'about' })}</p>
<p>
<Trans
2023-03-11 19:34:10 +01:00
i18nKey='sourceCode'
ns='about'
components={[
<a
2023-03-25 06:35:26 +01:00
href='https://github.com/ztjhz/BetterChatGPT'
target='_blank'
2023-03-11 19:34:10 +01:00
className='link'
/>,
]}
/>
</p>
<p>
<Trans
2023-03-11 19:34:10 +01:00
i18nKey='initiative.description'
ns='about'
components={[
<a
href={t('initiative.link', { ns: 'about' }) as string}
target='_blank'
className='link'
/>,
]}
/>
</p>
2023-03-11 19:34:10 +01:00
<>
<h2 className='text-lg font-bold'>
{t('support.title', { ns: 'about' })}
</h2>
<p>{t('support.paragraph1', { ns: 'about' })}</p>
<p>
<Trans
i18nKey='support.paragraph2'
ns='about'
components={[
<a
2023-03-25 06:35:26 +01:00
href='https://github.com/ztjhz/BetterChatGPT'
2023-03-11 19:34:10 +01:00
target='_blank'
className='link'
/>,
]}
/>
2023-03-11 19:34:10 +01:00
</p>
<p>{t('support.paragraph3', { ns: 'about' })}</p>
<div className='flex flex-col items-center gap-4 my-4'>
2023-03-25 06:40:42 +01:00
<a href='https://ko-fi.com/betterchatgpt' target='_blank'>
<img
2023-03-11 19:34:10 +01:00
src='/kofi.svg'
alt='Support us through the Ko-fi platform.'
/>
2023-03-11 19:34:10 +01:00
</a>
<div className='flex gap-x-10 gap-y-4 flex-wrap justify-center'>
<div className='flex flex-col items-center justify-center gap-1'>
<div>{t('support.alipay', { ns: 'about' })} (Ayaka)</div>
<img
className='rounded-md w-32 h-32'
src='https://ayaka14732.github.io/sponsor/alipay.jpg'
alt='Support us through Alipay'
/>
</div>
<div className='flex flex-col items-center justify-center gap-1'>
<div>
{t('support.wechatPay', { ns: 'about' })} (Ayaka)
</div>
<img
className='rounded-md w-32 h-32'
src='https://ayaka14732.github.io/sponsor/wechat.png'
alt='Support us through WeChat Pay'
/>
</div>
</div>
</div>
2023-03-11 19:34:10 +01:00
<p>{t('support.paragraph4', { ns: 'about' })}</p>
</>
<h2 className='text-lg font-bold'>
{t('discordServer.title', { ns: 'about' })}
</h2>
<p>{t('discordServer.paragraph1', { ns: 'about' })}</p>
<p>
<Trans
i18nKey='discordServer.paragraph2'
ns='about'
components={[
<a
className='link'
href='https://discord.gg/g3Qnwy4V6A'
target='_blank'
/>,
]}
/>
</p>
2023-03-11 19:34:10 +01:00
<h2 className='text-lg font-bold'>
{t('privacyStatement.title', { ns: 'about' })}
</h2>
<p>{t('privacyStatement.paragraph1', { ns: 'about' })}</p>
<p>{t('privacyStatement.paragraph2', { ns: 'about' })}</p>
2023-03-06 12:53:20 +01:00
</div>
</div>
</PopupModal>
)}
</>
);
};
export default AboutMenu;