feat: added state notice

chore: https://github.com/koreanbots/v2-testing/issues/64
This commit is contained in:
Junseo Park 2021-03-01 20:46:31 +09:00
parent ffa5171ddf
commit a13256242c

View File

@ -26,6 +26,7 @@ const LongButton = dynamic(() => import('@components/LongButton'))
const Advertisement = dynamic(() => import('@components/Advertisement'))
const Tooltip = dynamic(() => import('@components/Tooltip'))
const Markdown = dynamic(() => import ('@components/Markdown'))
const Message = dynamic(() => import('@components/Message'))
const Bots: NextPage<BotsProps> = ({ data, date, user, theme, setTheme }) => {
const bg = checkBotFlag(data?.flags, 'trusted') && data?.banner
@ -43,6 +44,20 @@ const Bots: NextPage<BotsProps> = ({ data, date, user, theme, setTheme }) => {
: `https://cdn.discordapp.com/embed/avatars/${Number(data.tag) % 5}.png?size=1024`
}
/>
<div className='w-full pb-2'>
{
data.state === 'private' ? <Message type='info'>
<h2 className='text-lg font-black'> .</h2>
<p> . .</p>
</Message> :
data.state === 'reported' ?
<Message type='error'>
<h2 className='text-lg font-black'> , .</h2>
<p> .</p>
<p> <Link href='/guidelines'><a className='text-blue-500 hover:text-blue-400'></a></Link> <Link href='/discord'><a className='text-blue-500 hover:text-blue-400'> </a></Link> .</p>
</Message> : ''
}
</div>
<div className='lg:flex w-full'>
<div className='w-full text-center lg:w-1/4'>
<DiscordAvatar
@ -73,17 +88,19 @@ const Bots: NextPage<BotsProps> = ({ data, date, user, theme, setTheme }) => {
<p className={`${bg ? 'text-gray-300' : 'dark:text-gray-300 text-gray-800'} text-base`}>{data.intro}</p>
</div>
<div className='w-full lg:w-1/4 lg:pt-10'>
<LongButton
newTab
href={
data.url ||
{
data.state === 'ok' && <LongButton
newTab
href={
data.url ||
`https://discordapp.com/oauth2/authorize?client_id=${data.id}&scope=bot&permissions=0`
}
>
<h4 className='whitespace-nowrap'>
<i className='fas fa-user-plus text-discord-blurple' />
</h4>
</LongButton>
}
>
<h4 className='whitespace-nowrap'>
<i className='fas fa-user-plus text-discord-blurple' />
</h4>
</LongButton>
}
<Link href={{ pathname: `/bots/${router.query.id}/vote` }}>
<LongButton>
<h4>