Skip to content

Commit

Permalink
fix: use max-width prop instead of width %
Browse files Browse the repository at this point in the history
  • Loading branch information
dani69654 committed Mar 8, 2022
1 parent b4960d8 commit 2314de9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Stepper/Stepper.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ SmallerStepperCount.args = {
step: 1,
stepData: noNavTestStepData,
hasNavButtons: false,
headerWidth: 40,
headerWidth: '40',
};
4 changes: 2 additions & 2 deletions src/components/Stepper/Stepper.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ export const DivStyledHelper = styled.div`
`;

export const HeaderStyled = styled.header<THeaderStyleProps>`
${(p) => p.headerWidth && `width: ${p.headerWidth}%`};
align-self: 'center';
${(p) => p.headerWidth && `max-width: ${p.headerWidth}px`};
width: 100%;
`;
2 changes: 1 addition & 1 deletion src/components/Stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Stepper: React.FC<StepperProps> = ({
completeTitle = 'all done, nice!',
completeMessage = 'You should tell the user what to do next, or use the onComplete function to programmatically fire an event',
onComplete = () => null,
headerWidth = 100,
headerWidth,
}) => {
const [activeStep, setActiveStep] = useState(step);
const myStepRef = useRef(activeStep);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stepper/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface StepperProps {
/**
* header width
*/
headerWidth?: number;
headerWidth?: string;
}

/**
Expand Down

0 comments on commit 2314de9

Please sign in to comment.