From 96d6f83c1f93af5bcfc4525c2f75a38a7d5b91e2 Mon Sep 17 00:00:00 2001 From: Emil Nielsen Date: Fri, 14 Apr 2023 15:03:44 +0700 Subject: [PATCH] Fix avaiable storeItems --- src/app/Components/Store/StoreItemView.tsx | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/app/Components/Store/StoreItemView.tsx b/src/app/Components/Store/StoreItemView.tsx index 8cbb6f0..5042014 100644 --- a/src/app/Components/Store/StoreItemView.tsx +++ b/src/app/Components/Store/StoreItemView.tsx @@ -7,29 +7,20 @@ const StoreItemView = (props: { storeItems: IStoreItem[]; buyStoreItem: (storeItemId: number) => void; }) => { - const availableItems = () => { - const items = props.storeItems.filter((item) => !item.isOwned); - if (items.length > 0) { - items.map((storeItem, id) => ( - - )); - } else { - return ( -

No items.. Check back later!

- ); - } - }; - return (

Store

- {availableItems()} + {props.storeItems + .filter((item) => !item.isOwned) + .map((storeItem, id) => ( + + ))}