Skip to content

Commit

Permalink
fix: Pass in props to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyAziz committed Aug 28, 2021
1 parent c2ab863 commit ad0fbf4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/components/Buttons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,39 @@ const GradientText = ({text}) => (
</MaskedView>
);

const PrimaryButton = ({text}) => (
<Styled.PrimaryButton>
const PrimaryButton = props => (
<Styled.PrimaryButton {...props}>
<Styled.ButtonGradient
colors={['#56CCF2', '#2F80ED']}
start={{x: -14.5253, y: 2.02026}}
end={{x: 76.659, y: 291.348}}
useAngle
angle={108.08}
/>
<Styled.Text>{text}</Styled.Text>
<Styled.Text>{props.text}</Styled.Text>
</Styled.PrimaryButton>
);

const Button = ({type, text = 'Test'}) => {
const Button = props => {
const {type, text} = props;
switch (type) {
case 'primary':
return <PrimaryButton text={text} />;
return <PrimaryButton text={text} {...props} />;
case 'secondary':
return (
<Styled.SecondaryButton>
<Styled.SecondaryButton {...props}>
<GradientText text={text} />
</Styled.SecondaryButton>
);
case 'subtle':
return (
<Styled.SubtleButton>
<Styled.SubtleButton {...props}>
<GradientText text={text} />
</Styled.SubtleButton>
);
case 'disabled':
return (
<Styled.DisabledButton>
<Styled.DisabledButton {...props}>
<Styled.ButtonGradient
colors={['#56CCF2', '#2F80ED']}
start={{x: -14.5253, y: 2.02026}}
Expand All @@ -61,7 +62,7 @@ const Button = ({type, text = 'Test'}) => {
</Styled.DisabledButton>
);
default:
return <PrimaryButton text={text} />;
return <PrimaryButton text={text} {...props} />;
}
};

Expand Down

0 comments on commit ad0fbf4

Please sign in to comment.