Skip to content

Commit

Permalink
refactor: ErrorSection의 buttons 네이밍 변경 및 요소에 key 추가
Browse files Browse the repository at this point in the history
- buttons -> buttonList
  • Loading branch information
BadaHertz52 committed Aug 1, 2024
1 parent 88a2c23 commit 79ee76b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/error/ErrorSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ interface ErrorSectionProps {
}

const ErrorSection = ({ errorMessage, handleReload, handleGoHome }: ErrorSectionProps) => {
const buttons = [
const buttonList = [
{
buttonType: 'primary' as ButtonType,
key: 'refreshButton',
text: '새로고침하기',
image: ReloadIcon,
imageDescription: '새로고침 이미지',
onClick: handleReload,
},
{
buttonType: 'secondary' as ButtonType,
key: 'homeButton',
text: '홈으로 이동하기',
image: HomeIcon,
imageDescription: '홈 이미지',
Expand All @@ -37,9 +39,9 @@ const ErrorSection = ({ errorMessage, handleReload, handleGoHome }: ErrorSection
</S.ErrorLogoWrapper>
<S.ErrorMessage>{errorMessage}</S.ErrorMessage>
<S.Container>
{buttons.map((button) => (
{buttonList.map((button) => (
<Button
key={button.text}
key={button.key}
buttonType={button.buttonType}
text={button.text}
image={button.image}
Expand Down

0 comments on commit 79ee76b

Please sign in to comment.