diff --git a/client/common/Button.jsx b/client/common/Button.jsx index ae736abc..58353693 100644 --- a/client/common/Button.jsx +++ b/client/common/Button.jsx @@ -153,11 +153,11 @@ const StyledIconButton = styled.button` const Button = ({ children, href, iconAfterName, iconBeforeName, kind, label, to, type, ...props }) => { - const iconAfter = iconAfterName && ; - const iconBefore = iconBeforeName && ; + const IconAfter = Icon[iconAfterName]; + const IconBefore = Icon[iconBeforeName]; const hasChildren = React.Children.count(children) > 0; - const content = <>{iconBefore}{hasChildren && {children}}{iconAfter}; + const content = <>{IconBefore}{hasChildren && {children}}{IconAfter}; let StyledComponent = StyledButton; @@ -190,7 +190,7 @@ Button.defaultProps = { type: 'button', }; -Button.iconNames = Icon.names; +Button.iconNames = Object.keys(Icon); Button.kinds = kinds; Button.propTypes = { diff --git a/client/common/Button.stories.jsx b/client/common/Button.stories.jsx index 2f14f9fc..4ce30d4c 100644 --- a/client/common/Button.stories.jsx +++ b/client/common/Button.stories.jsx @@ -36,17 +36,17 @@ export const ReactRouterLink = () => ( ); export const ButtonWithIconBefore = () => ( - + ); export const ButtonWithIconAfter = () => ( - + ); export const InlineButtonWithIconAfter = () => ( - + ); export const InlineIconOnlyButton = () => ( - diff --git a/client/modules/User/components/SocialAuthButton.jsx b/client/modules/User/components/SocialAuthButton.jsx index c0539eb6..c70490ae 100644 --- a/client/modules/User/components/SocialAuthButton.jsx +++ b/client/modules/User/components/SocialAuthButton.jsx @@ -7,18 +7,18 @@ import { remSize } from '../../../theme'; 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 services = { - github: 'github', - google: 'google' + Github: 'github', + Google: 'google' }; const StyledButton = styled(Button)` @@ -39,7 +39,7 @@ function SocialAuthButton({ service }) { SocialAuthButton.services = services; SocialAuthButton.propTypes = { - service: PropTypes.oneOf(['github', 'google']).isRequired + service: PropTypes.oneOf(['Github', 'Google']).isRequired }; export default SocialAuthButton; diff --git a/package-lock.json b/package-lock.json index 261fa1f9..57ed68cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26924,11 +26924,6 @@ "use-sidecar": "^1.0.1" } }, - "react-from-dom": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/react-from-dom/-/react-from-dom-0.3.1.tgz", - "integrity": "sha512-PeNBa8iuzoD7qHA9O7YpGnXFvC+XFFwStmFh2/r2zJAvEIaRg6EwOj+EPcDIFwyYBhqPIItxIx/dGdeWiFivjQ==" - }, "react-helmet": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.1.tgz", @@ -27015,15 +27010,6 @@ "prop-types": "^15.6.1" } }, - "react-inlinesvg": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/react-inlinesvg/-/react-inlinesvg-1.2.0.tgz", - "integrity": "sha512-IsznU+UzpUwDGzBWbf0bfSRA5Jbqz87xeoqLM/nSIDPkoHksInF1wCGybTSn4sIui+30TqboRQP1wAelNTkdog==", - "requires": { - "exenv": "^1.2.2", - "react-from-dom": "^0.3.0" - } - }, "react-input-autosize": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/react-input-autosize/-/react-input-autosize-2.2.2.tgz", diff --git a/package.json b/package.json index b7141d16..855b40e4 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,6 @@ "react-dom": "^16.12.0", "react-helmet": "^5.1.3", "react-hot-loader": "^4.12.19", - "react-inlinesvg": "^1.2.0", "react-redux": "^5.1.2", "react-router": "^3.2.5", "react-split-pane": "^0.1.89",