From 87a78a467ebc11e0302b2f189e47469353703555 Mon Sep 17 00:00:00 2001 From: Ariel Salem Date: Fri, 28 Feb 2020 05:34:48 -0800 Subject: [PATCH] feat(ui): added social button component (#17033) feat(ui): added social button component --- .../clientLibraries/graphics/GithubLogo.tsx | 18 ++++++++++ .../clientLibraries/graphics/GoogleLogo.tsx | 33 +++++++++++++++++++ ui/src/clientLibraries/graphics/index.ts | 19 +++++++++++ ui/src/onboarding/containers/LoginPage.scss | 8 ++--- .../containers/LoginPageContents.tsx | 20 ++++++----- ui/src/shared/components/SocialButton.tsx | 26 +++++++++++++++ 6 files changed, 112 insertions(+), 12 deletions(-) create mode 100644 ui/src/clientLibraries/graphics/GithubLogo.tsx create mode 100644 ui/src/clientLibraries/graphics/GoogleLogo.tsx create mode 100644 ui/src/clientLibraries/graphics/index.ts create mode 100644 ui/src/shared/components/SocialButton.tsx diff --git a/ui/src/clientLibraries/graphics/GithubLogo.tsx b/ui/src/clientLibraries/graphics/GithubLogo.tsx new file mode 100644 index 00000000000..09d7850df3a --- /dev/null +++ b/ui/src/clientLibraries/graphics/GithubLogo.tsx @@ -0,0 +1,18 @@ +// Libraries +import React, {FC} from 'react' +import classnames from 'classnames' + +interface Props { + className?: string +} + +export const GithubLogo: FC = ({className}) => ( + + GitHub icon + + +) diff --git a/ui/src/clientLibraries/graphics/GoogleLogo.tsx b/ui/src/clientLibraries/graphics/GoogleLogo.tsx new file mode 100644 index 00000000000..a142917baab --- /dev/null +++ b/ui/src/clientLibraries/graphics/GoogleLogo.tsx @@ -0,0 +1,33 @@ +// Libraries +import React, {FC} from 'react' +import classnames from 'classnames' + +interface Props { + className?: string +} + +export const GoogleLogo: FC = ({className}) => ( + + + + + + +) diff --git a/ui/src/clientLibraries/graphics/index.ts b/ui/src/clientLibraries/graphics/index.ts new file mode 100644 index 00000000000..4573b909dc7 --- /dev/null +++ b/ui/src/clientLibraries/graphics/index.ts @@ -0,0 +1,19 @@ +import CSharpLogo from 'src/clientLibraries/graphics/CSharpLogo' +import {GithubLogo} from 'src/clientLibraries/graphics/GithubLogo' +import GoLogo from 'src/clientLibraries/graphics/GoLogo' +import {GoogleLogo} from 'src/clientLibraries/graphics/GoogleLogo' +import JavaLogo from 'src/clientLibraries/graphics/JavaLogo' +import JSLogo from 'src/clientLibraries/graphics/JSLogo' +import PythonLogo from 'src/clientLibraries/graphics/PythonLogo' +import RubyLogo from 'src/clientLibraries/graphics/RubyLogo' + +export { + CSharpLogo, + GithubLogo, + GoLogo, + GoogleLogo, + JavaLogo, + JSLogo, + PythonLogo, + RubyLogo, +} diff --git a/ui/src/onboarding/containers/LoginPage.scss b/ui/src/onboarding/containers/LoginPage.scss index 41fc62bd2a4..f6afa512523 100644 --- a/ui/src/onboarding/containers/LoginPage.scss +++ b/ui/src/onboarding/containers/LoginPage.scss @@ -148,19 +148,19 @@ height: $icon-size-md; width: $icon-size-md; - .google-blue { + .google-logo--blue { fill: #3e82f1; } - .google-green { + .google-logo--green { fill: #32a753; } - .google-red { + .google-logo--red { fill: #e74133; } - .google-yellow { + .google-logo--yellow { fill: #f9bb00; } } diff --git a/ui/src/onboarding/containers/LoginPageContents.tsx b/ui/src/onboarding/containers/LoginPageContents.tsx index fb87e1a5f9b..57f0443ebd2 100644 --- a/ui/src/onboarding/containers/LoginPageContents.tsx +++ b/ui/src/onboarding/containers/LoginPageContents.tsx @@ -19,6 +19,8 @@ import auth0js from 'auth0-js' // Components import {LoginForm} from 'src/onboarding/components/LoginForm' import {SignUpForm} from 'src/onboarding/components/SignUpForm' +import {SocialButton} from 'src/shared/components/SocialButton' +import {GoogleLogo, GithubLogo} from 'src/clientLibraries/graphics' // Types import {Auth0Connection, FormFieldValidation} from 'src/types' @@ -117,20 +119,22 @@ class LoginPageContents extends PureComponent { alignItems={AlignItems.Center} margin={ComponentSize.Large} > - - + + diff --git a/ui/src/shared/components/SocialButton.tsx b/ui/src/shared/components/SocialButton.tsx new file mode 100644 index 00000000000..8ad61c7aa8a --- /dev/null +++ b/ui/src/shared/components/SocialButton.tsx @@ -0,0 +1,26 @@ +// Libraries +import React, {FC} from 'react' +import {ButtonBase, ButtonShape, ComponentSize} from '@influxdata/clockface' + +interface Props { + buttonText: string + children: JSX.Element + handleClick?: () => void +} + +export const SocialButton: FC = ({ + buttonText, + children, + handleClick, +}) => { + return ( + + {children} + {buttonText} + + ) +}