From 02f7615c103a0b1f8f94f50b312eb6493dc57cdf Mon Sep 17 00:00:00 2001 From: Nishant Mittal Date: Wed, 3 Nov 2021 21:33:18 +0530 Subject: [PATCH] [GH-1432]: Use Button component on welcomePage.tsx (#1734) * feat: use Button component on welcomePage.tsx * update snapshots and fix lint errors Co-authored-by: Mattermod --- .../__snapshots__/welcomePage.test.tsx.snap | 5 ++++- webapp/src/pages/welcome/welcomePage.tsx | 18 +++++++++++------- webapp/src/widgets/buttons/button.tsx | 4 +++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/webapp/src/pages/welcome/__snapshots__/welcomePage.test.tsx.snap b/webapp/src/pages/welcome/__snapshots__/welcomePage.test.tsx.snap index bffc88d07..cf01a17e9 100644 --- a/webapp/src/pages/welcome/__snapshots__/welcomePage.test.tsx.snap +++ b/webapp/src/pages/welcome/__snapshots__/welcomePage.test.tsx.snap @@ -28,8 +28,11 @@ exports[`pages/welcome Welcome Page shows Explore Page 1`] = ` /> + ) diff --git a/webapp/src/widgets/buttons/button.tsx b/webapp/src/widgets/buttons/button.tsx index 5efc21b26..e85d275e6 100644 --- a/webapp/src/widgets/buttons/button.tsx +++ b/webapp/src/widgets/buttons/button.tsx @@ -18,6 +18,7 @@ type Props = { size?: string danger?: boolean className?: string + rightIcon?: boolean } function Button(props: Props): JSX.Element { @@ -39,8 +40,9 @@ function Button(props: Props): JSX.Element { title={props.title} onBlur={props.onBlur} > - {props.icon} + {!props.rightIcon && props.icon} {props.children} + {props.rightIcon && props.icon} ) }