From 75412ea76f29f94a6b0419c1d8cc3d67ce99e59b Mon Sep 17 00:00:00 2001 From: Kogepan25629 Date: Tue, 16 Jan 2024 13:46:45 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA?= =?UTF-8?q?=E3=81=8C=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84=E6=99=82?= =?UTF-8?q?=E3=81=AB=E6=96=B0=E8=A6=8F=E8=BF=BD=E5=8A=A0=E3=82=AB=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/list/page.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/app/list/page.tsx b/src/app/list/page.tsx index fb5266d9..a083b242 100644 --- a/src/app/list/page.tsx +++ b/src/app/list/page.tsx @@ -41,12 +41,22 @@ export default function list(): React.ReactElement { const [Waiting, StartWaiting] = useWaiting(); function CardList(): React.ReactElement[] { + const card_new_category = ( +
SetIsModalOpen(true)}> +
+ +
+

新規作成

+
+ ) + if (!list || list.length === 0) { - return []; + return [card_new_category]; } + let cards: React.ReactElement[] = []; let searchResult: AllCategoryDataType[] = []; - cards = []; + // 検索欄になにか記入されていたら、検索 if (search_str !== '') { list.forEach(e => { @@ -94,14 +104,8 @@ export default function list(): React.ReactElement { } // カテゴリ作成ページへ飛ぶカードを追加 - cards.unshift( -
SetIsModalOpen(true)}> -
- -
-

新規作成

-
, - ); + cards.unshift(card_new_category); + return cards; }