aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorEzekiel Aquino <ezekiel@bakkenbaeck.no>2018-11-29 21:36:35 +0800
committerEzekiel Aquino <ezekiel@bakkenbaeck.no>2018-11-29 21:36:35 +0800
commit0e7329bcecb893b34b3f4199ba653748f55d852b (patch)
tree9322fdf6c7287c6702797ba7974893acc8681ebd /packages/website/ts
parentb564f090f9fcc0bff97dfec829d8380af5a78418 (diff)
downloaddexon-sol-tools-0e7329bcecb893b34b3f4199ba653748f55d852b.tar.gz
dexon-sol-tools-0e7329bcecb893b34b3f4199ba653748f55d852b.tar.zst
dexon-sol-tools-0e7329bcecb893b34b3f4199ba653748f55d852b.zip
Tweaks button
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/@next/components/button.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/packages/website/ts/@next/components/button.tsx b/packages/website/ts/@next/components/button.tsx
index 07d598cba..9cadc4fd5 100644
--- a/packages/website/ts/@next/components/button.tsx
+++ b/packages/website/ts/@next/components/button.tsx
@@ -46,10 +46,9 @@ const Text = styled.span`
export const Button: React.StatelessComponent<ButtonInterface> = props => {
const { onClick, href } = props;
+ const Component = onClick ? StyledButton : StyledButton.withComponent('a');
- // This button is as link
- if (props.href) return StyledButton.withComponent('a');
- else return StyledButton;
+ return <Component {...props}>{ props.children || 'Text' }</Component>;
};
@@ -60,11 +59,11 @@ export const Button: React.StatelessComponent<ButtonInterface> = props => {
-export const Button: React.StatelessComponent<ButtonInterface> = ({ ...props }) => (
- <StyledButton {...props}>
- <Text>{props.text}</Text>
- </StyledButton>
-);
+// export const Button: React.StatelessComponent<ButtonInterface> = ({ ...props }) => (
+// <StyledButton {...props}>
+// <Text>{props.text}</Text>
+// </StyledButton>
+// );
// also feel like a transparent prop would suffice instead of having a separate button
// so we have the logic with the Link/button--- and props = styling. in this case: