Skip to content

Commit

Permalink
feat(BoemlySteps): Make onClick optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rschiffer committed Sep 29, 2023
1 parent 2cbe53f commit 016289c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/BoemlySteps/BoemlySteps.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ Horizontal.args = {
orientation: 'horizontal',
currentStep: 2,
};

export const NotClickable = Template.bind({});
NotClickable.args = {
steps: [{ text: 'Step 1' }, { text: 'Step 2' }, { text: 'Step 3' }, { text: 'Step 4' }],
currentStep: 2,
};
10 changes: 8 additions & 2 deletions src/components/BoemlySteps/BoemlySteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import StepDivider from './StepDivider';
export interface BoemlyStepsProps {
steps: {
text: string;
onClick: () => void;
onClick?: () => void;
}[];
currentStep: number;
orientation?: 'vertical' | 'horizontal';
Expand Down Expand Up @@ -89,7 +89,13 @@ export const BoemlySteps: React.FC<BoemlyStepsProps> = ({
}

return (
<Flex key={stepNum} flexDir="row" alignItems="center" cursor="pointer" onClick={onClick}>
<Flex
key={stepNum}
flexDir="row"
alignItems="center"
cursor={onClick ? 'pointer' : undefined}
onClick={onClick}
>
{point}
<Text size="smLowNormal" color="black" ml="3">
{text}
Expand Down

1 comment on commit 016289c

@vercel
Copy link

@vercel vercel bot commented on 016289c Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.