diff options
author | 2022-07-19 13:58:34 +0200 | |
---|---|---|
committer | 2022-07-19 13:58:34 +0200 | |
commit | 191581e287f78ba325fdd7681c83586309b59df2 (patch) | |
tree | 72331f121c3d5baa6f449e6c1ad362a98d35b5c8 /src/components/OAuth2Button.tsx | |
parent | Clear Authorization On Error (diff) |
Simplify Navigation Component
Extract the styles from the navigation component to common styles, and
convert it to a function component.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'src/components/OAuth2Button.tsx')
-rw-r--r-- | src/components/OAuth2Button.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/OAuth2Button.tsx b/src/components/OAuth2Button.tsx index 885c080..be8d160 100644 --- a/src/components/OAuth2Button.tsx +++ b/src/components/OAuth2Button.tsx @@ -11,7 +11,7 @@ import { selectable } from "../commonStyles"; interface OAuth2ButtonProps { scopes?: OAuthScopes[], - rerender: () => void + rerender?: () => void } const iconStyles = css` @@ -59,7 +59,7 @@ async function login(props: OAuth2ButtonProps, errorDialog: React.RefObject<HTML throw reason.Error; }); - if (checkScopes(props.scopes)) { + if (checkScopes(props.scopes) && props.rerender) { props.rerender(); } } @@ -71,7 +71,7 @@ function OAuth2Button(props: OAuth2ButtonProps): JSX.Element { return <span> <button disabled={disabled} onClick={() => login(props, errorDialog, setDisabled)}> <FontAwesomeIcon icon={faDiscord} css={iconStyles}/> - <span css={textStyles}>Discord Login</span> + <span css={textStyles}>Login To Submit</span> </button> <div css={[errorStyles, selectable]} ref={errorDialog}/> </span>; |