- {/* TODO make sure this has the right aria-label and SVG attributes */}
- {/*
diff --git a/client/modules/User/components/GithubButton.jsx b/client/modules/User/components/GithubButton.jsx
deleted file mode 100644
index 32edfe8a..00000000
--- a/client/modules/User/components/GithubButton.jsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import GithubIcon from '../../../images/github.svg';
-
-function GithubButton(props) {
- return (
-
-
- {props.buttonText}
-
- );
-}
-
-GithubButton.propTypes = {
- buttonText: PropTypes.string.isRequired
-};
-
-export default GithubButton;
diff --git a/client/modules/User/components/GoogleButton.jsx b/client/modules/User/components/GoogleButton.jsx
deleted file mode 100644
index c508aa9b..00000000
--- a/client/modules/User/components/GoogleButton.jsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import GoogleIcon from '../../../images/google.svg';
-
-function GoogleButton(props) {
- return (
-
-
- {props.buttonText}
-
- );
-}
-
-GoogleButton.propTypes = {
- buttonText: PropTypes.string.isRequired
-};
-
-export default GoogleButton;
diff --git a/client/modules/User/components/SocialAuthButton.jsx b/client/modules/User/components/SocialAuthButton.jsx
index c70490ae..95f8e2b2 100644
--- a/client/modules/User/components/SocialAuthButton.jsx
+++ b/client/modules/User/components/SocialAuthButton.jsx
@@ -4,21 +4,27 @@ import styled from 'styled-components';
import { remSize } from '../../../theme';
+import Icons from '../../../common/Icons';
import Button from '../../../common/Button';
const authUrls = {
- Github: '/auth-github',
- Google: '/auth/google/'
+ github: '/auth/github',
+ google: '/auth/google'
};
const labels = {
- Github: 'Login with GitHub',
- Google: 'Login with Google'
+ github: 'Login with GitHub',
+ google: 'Login with Google'
+};
+
+const icons = {
+ github: Icons.Github,
+ google: Icons.Google
};
const services = {
- Github: 'github',
- Google: 'google'
+ github: 'github',
+ google: 'google'
};
const StyledButton = styled(Button)`
@@ -26,12 +32,13 @@ const StyledButton = styled(Button)`
`;
function SocialAuthButton({ service }) {
+ const ServiceIcon = icons[service];
return (
- {labels[service]}
+
+ {labels[service]}
);
}
@@ -39,7 +46,7 @@ function SocialAuthButton({ service }) {
SocialAuthButton.services = services;
SocialAuthButton.propTypes = {
- service: PropTypes.oneOf(['Github', 'Google']).isRequired
+ service: PropTypes.oneOf(['github', 'google']).isRequired
};
export default SocialAuthButton;