Skip to content

Commit

Permalink
[FE] fix: 이전 버튼이 눌리지 않는 현상 수정 (#580)
Browse files Browse the repository at this point in the history
* fix: 이전 버튼이 눌리지 않는 현상 수정

* chore: bool형 표현 방식 수정

* refactor: 이전 버튼 컴포넌트가 받는 불필요한 props 제거
  • Loading branch information
chysis authored Sep 6, 2024
1 parent 32cb9e1 commit b7ea307
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const CardSlider = ({ currentCardIndex, handleCurrentCardIndex, handleOpenModal
{isAblePrevStep(index) && (
<CardSliderController.PrevButton
data-testid={`${section.sectionId}-prevButton`}
currentCardIndex={currentCardIndex}
handleCurrentCardIndex={handleCurrentCardIndex}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ import { Button } from '@/components';
import { ButtonStyleType } from '@/types';

interface PrevButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
currentCardIndex: number;
handleCurrentCardIndex: (direction: 'prev' | 'next') => void;
}

const PrevButton = ({ currentCardIndex, handleCurrentCardIndex, ...rest }: PrevButtonProps) => {
const styledType: ButtonStyleType = currentCardIndex ? 'secondary' : 'disabled';

const PrevButton = ({ handleCurrentCardIndex, ...rest }: PrevButtonProps) => {
return (
<Button
disabled={!!currentCardIndex}
styleType={styledType}
type={'button'}
onClick={() => handleCurrentCardIndex('prev')}
{...rest}
>
<Button styleType={'secondary'} type={'button'} onClick={() => handleCurrentCardIndex('prev')} {...rest}>
이전
</Button>
);
Expand Down

0 comments on commit b7ea307

Please sign in to comment.