chore: handling no bot

This commit is contained in:
wonderlandpark 2021-03-22 10:14:30 +09:00
parent ed18292a46
commit b6f4847a3d
2 changed files with 39 additions and 23 deletions

View File

@ -27,18 +27,25 @@ const Panel:NextPage<PanelProps> = ({ logged, user, submits }) => {
}
return <Container paddingTop className='pt-5 pb-10'>
<SEO title='관리 패널' />
<h1 className='text-3xl font-bold'> </h1>
<h1 className='text-4xl font-bold'> </h1>
<div className='mt-6'>
<h2 className='text-2xl font-bold'> </h2>
<h2 className='text-3xl font-bold'> </h2>
{
user.bots.length === 0 ? <h2 className='text-xl'> .</h2> :
<ResponsiveGrid>
{
(user.bots as Bot[]).map(bot=> <BotCard key={bot.id} bot={bot} manage />)
}
</ResponsiveGrid>
}
</div>
<div className='mt-6'>
<h2 className='text-2xl font-bold'> </h2>
<h2 className='text-3xl font-bold'> </h2>
{
submits.length === 0 ? <h2 className='text-xl'> .</h2> :
<>
<p className='text-left text-gray-400 text-sm font-medium'> .</p>
<div className='grid gap-4 2xl:grid-cols-4 lg:grid-cols-2 mt-12'>
{
submits.slice(0, submitLimit).map(el=> <SubmittedBotCard key={el.date} href={`/pendingBots/${el.id}/${el.date}`} submit={el} />)
@ -49,6 +56,9 @@ const Panel:NextPage<PanelProps> = ({ logged, user, submits }) => {
<Button onClick={() => setSubmitLimit(submitLimit+8)}></Button>
</div>
}
</>
}
</div>
</Container>
}

View File

@ -44,7 +44,7 @@ const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
<Container paddingTop className='py-10'>
<SEO
title={data.username}
description={josa(
description={data.bots.length === 0 ? `${data.username}님의 프로필입니다.` : josa(
`${(data.bots as Bot[])
.slice(0, 5)
.map(el => el.name)
@ -171,11 +171,17 @@ const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
</div>
<Divider />
<h2 className='mt-8 text-3xl font-bold'> </h2>
{data.bots.length === 0 ? <h2 className='text-xl'> .</h2> :
<ResponsiveGrid>
{(data.bots as Bot[]).map((bot: Bot) => (
{
(data.bots as Bot[]).map((bot: Bot) => (
<BotCard key={bot.id} bot={bot} />
))}
))
}
</ResponsiveGrid>
}
<Advertisement />
</Container>
)