Skip to content

Commit

Permalink
Merge pull request #257 from TEAM-BEAT/fix/#256/Stepper
Browse files Browse the repository at this point in the history
[Fix/#256] stepper 수정
  • Loading branch information
imddoy authored Jul 19, 2024
2 parents c99d188 + 803773f commit 9343d09
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/assets/svgs/IconMinus.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SVGProps } from "react";
const SvgIconMinus = (props: SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" {...props}>
<path stroke="#fff" strokeMiterlimit={10} strokeWidth={1.2} d="M17 12H7" />
<path stroke="current" strokeMiterlimit={10} strokeWidth={1.2} d="M17 12H7" />
</svg>
);
export default SvgIconMinus;
2 changes: 1 addition & 1 deletion src/assets/svgs/IconPlus.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SVGProps } from "react";
const SvgIconPlus = (props: SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" {...props}>
<path stroke="#fff" strokeMiterlimit={10} strokeWidth={1.2} d="M12 7v10M17 12H7" />
<path stroke="current" strokeMiterlimit={10} strokeWidth={1.2} d="M12 7v10M17 12H7" />
</svg>
);
export default SvgIconPlus;
12 changes: 3 additions & 9 deletions src/components/commons/stepper/Stepper.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,14 @@ export const StepperWrapper = styled.div`
border-radius: 6px;
`;

export const StepperBtn = styled.button`
export const StepperBtn = styled.button<{ disabled: boolean }>`
${Generators.flexGenerator()};
width: 2.4rem;
height: 2.4rem;
color: ${({ theme }) => theme.colors.white};
cursor: pointer;
&:disabled {
color: ${({ theme }) => theme.colors.gray_500};
cursor: ${({ theme, disabled }) => (disabled ? "not-allowed" : "pointer")};
cursor: not-allowed;
}
stroke: ${({ theme, disabled }) => (disabled ? theme.colors.gray_500 : theme.colors.white)};
`;

export const StepperNum = styled.p`
Expand Down
2 changes: 1 addition & 1 deletion src/components/commons/stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Stepper = ({ round, max, disabled, onMinusClick, onPlusClick }: StepperPro
</S.StepperBtn>
<S.StepperNum>{round}</S.StepperNum>
<S.StepperBtn
disabled={max === 1 || disabled}
disabled={max === round || disabled}
onClick={() => {
setNum((prev) => prev + 1);
onPlusClick();
Expand Down

0 comments on commit 9343d09

Please sign in to comment.