Skip to content

Commit

Permalink
Merge pull request Yanabada#266 from Yanabada/feature/Yanabada#265
Browse files Browse the repository at this point in the history
Fix: 버튼 반대색상 추가
  • Loading branch information
furaha707 authored Feb 23, 2024
2 parents d9cc27f + c323095 commit c1348a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/card/ListCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const ListCard = forwardRef(
leftBtnText: "판매 승인",
rightBtnText: "취소",
isVisible: isVisible,
opposite: true,
setIsVisible: setIsVisible,
leftAction: () => {
saleApproveMutate(tradeId);
Expand Down
16 changes: 13 additions & 3 deletions src/components/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface modalProp extends Pick<React.HTMLAttributes<HTMLButtonElement>, "title
setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
leftAction?: () => void;
rightAction?: () => void;
opposite?: boolean;
}

const Modal = ({
Expand All @@ -21,7 +22,8 @@ const Modal = ({
isVisible,
setIsVisible,
leftAction,
rightAction
rightAction,
opposite
}: modalProp) => {
return (
<AnimatePresence>
Expand All @@ -42,12 +44,20 @@ const Modal = ({

<S.ButtonsWrapper>
{leftBtnText && (
<BaseButton buttonType="gray" width="100%" onClick={leftAction}>
<BaseButton
buttonType={opposite ? "default" : "gray"}
width="100%"
onClick={leftAction}
>
{leftBtnText}
</BaseButton>
)}
{rightBtnText && (
<BaseButton buttonType="default" width="100%" onClick={rightAction}>
<BaseButton
buttonType={opposite ? "gray" : "default"}
width="100%"
onClick={rightAction}
>
{rightBtnText}
</BaseButton>
)}
Expand Down

0 comments on commit c1348a4

Please sign in to comment.