From 99cf68c8f78785bebe48ec4fbe91dacf6acc2666 Mon Sep 17 00:00:00 2001 From: Dokyun Lim Date: Fri, 9 Aug 2024 21:20:48 +0900 Subject: [PATCH] refact: change string buttons to array --- src/component/home/HomeButtons.jsx | 37 +++++++++--------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/src/component/home/HomeButtons.jsx b/src/component/home/HomeButtons.jsx index 470b472..6c1f8b0 100644 --- a/src/component/home/HomeButtons.jsx +++ b/src/component/home/HomeButtons.jsx @@ -29,37 +29,22 @@ const Button = styled.button({ export default function HomeButtons({ handleClickAbout, handleClickCheerSongList, - handleClickSongList, handleClickMembers, handleClickAlbum, }) { + const buttons = [ + {text: "About", onClick: handleClickAbout}, + {text: "Member", onClick: handleClickMembers}, + {text: "Album", onClick: handleClickAlbum}, + {text: "Cheer Song", onClick: handleClickCheerSongList}, + ] return ( - - - - - + { + buttons.map(({text, onClick}) => + + ) + } ); }