Skip to content

Commit

Permalink
revamped menu/credits
Browse files Browse the repository at this point in the history
  • Loading branch information
jackschedel committed Apr 26, 2023
1 parent 23a00ee commit d0eba5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 144 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"clearConversation": "Clear Conversation",
"import": "Import",
"export": "Export",
"author": "Made by Jing Hua",
"host": "Hosted by Jack Schedel",
"author": "Original Repo by Jing Hua",
"about": "About & Sponsor",
"api": "API",
"personal": "Personal",
Expand Down
156 changes: 13 additions & 143 deletions src/components/AboutMenu/AboutMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,151 +1,21 @@
import React, { useState } from 'react';
import { useTranslation, Trans } from 'react-i18next';
import PopupModal from '@components/PopupModal';
import React from 'react';
import { useTranslation } from 'react-i18next';

import AboutIcon from '@icon/AboutIcon';

const AboutMenu = () => {
const { t } = useTranslation(['main', 'about']);
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);

const { t } = useTranslation();
return (
<>
<a
className='flex py-2 px-2 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')}
</a>
{isModalOpen && (
<PopupModal
title={t('about') as string}
setIsModalOpen={setIsModalOpen}
cancelButton={false}
>
<div className='p-6 border-b border-gray-200 dark:border-gray-600'>
<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
i18nKey='sourceCode'
ns='about'
components={[
<a
href='https://github.com/ztjhz/BetterChatGPT'
target='_blank'
className='link'
/>,
]}
/>
</p>

<p>
<Trans
i18nKey='initiative.description'
ns='about'
components={[
<a
href={t('initiative.link', { ns: 'about' }) as string}
target='_blank'
className='link'
/>,
]}
/>
</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>

<>
<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
href='https://github.com/ztjhz/BetterChatGPT'
target='_blank'
className='link'
/>,
]}
/>
</p>
<p>{t('support.paragraph3', { ns: 'about' })}</p>

<div className='flex flex-col items-center gap-4 my-4'>
<a href='https://github.com/sponsors/ztjhz' target='_blank'>
<img
src='https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86'
width='120px'
alt='Support us through GitHub Sponsors'
/>
</a>
<a href='https://ko-fi.com/betterchatgpt' target='_blank'>
<img
src='./kofi.svg'
alt='Support us through the Ko-fi platform.'
/>
</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>
<p>{t('support.paragraph4', { ns: 'about' })}</p>
</>

<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>
</div>
</div>
</PopupModal>
)}
</>
<a
className='flex py-2 px-2 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm'
href='https://https://github.com/jackschedel/gpt.koaladev.io'
target='_blank'
>
<AboutIcon />
{t('host')}
</a>
);
};


export default AboutMenu;

0 comments on commit d0eba5b

Please sign in to comment.