From b6f4847a3d88c7bb6eba1b64553d52c64d678b77 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Mon, 22 Mar 2021 10:14:30 +0900 Subject: [PATCH] chore: handling no bot --- pages/panel.tsx | 44 +++++++++++++++++++++++++++----------------- pages/users/[id].tsx | 18 ++++++++++++------ 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/pages/panel.tsx b/pages/panel.tsx index f9169df..8815f8f 100644 --- a/pages/panel.tsx +++ b/pages/panel.tsx @@ -27,28 +27,38 @@ const Panel:NextPage = ({ logged, user, submits }) => { } return -

관리 패널

+

관리 패널

-

나의 봇

- - { - (user.bots as Bot[]).map(bot=> ) - } - +

나의 봇

+ { + user.bots.length === 0 ?

소유한 봇이 없습니다.

: + + { + (user.bots as Bot[]).map(bot=> ) + } + + }
-

봇 심사이력

-

자세히 보려면 카드를 클릭하세요.

-
- { - submits.slice(0, submitLimit).map(el=> ) - } -
+

봇 심사이력

{ - submitLimit < submits.length &&
- -
+ submits.length === 0 ?

심사이력이 없습니다.

: + <> +

자세히 보려면 카드를 클릭하세요.

+ +
+ { + submits.slice(0, submitLimit).map(el=> ) + } +
+ { + submitLimit < submits.length &&
+ +
+ } + } +
} diff --git a/pages/users/[id].tsx b/pages/users/[id].tsx index 4d630ef..6113c0c 100644 --- a/pages/users/[id].tsx +++ b/pages/users/[id].tsx @@ -44,7 +44,7 @@ const Users: NextPage = ({ user, data, csrfToken, theme }) => { el.name) @@ -171,11 +171,17 @@ const Users: NextPage = ({ user, data, csrfToken, theme }) => {

제작한 봇

- - {(data.bots as Bot[]).map((bot: Bot) => ( - - ))} - + + {data.bots.length === 0 ?

소유한 봇이 없습니다.

: + + { + (data.bots as Bot[]).map((bot: Bot) => ( + + )) + } + + } +
)