fix(locale): Remove hard coded string literals (#3333)

This commit is contained in:
tiuweehan
2020-02-28 18:12:10 +08:00
committed by GitHub
parent 1dcb79a874
commit 7c45a3cda9
22 changed files with 216 additions and 6 deletions

View File

@ -69,6 +69,7 @@ const AuthenticationPage = ({
renderPageContent,
logoUrl,
siteUrl,
t,
}) => {
return (
<StyledAuthenticationPage>
@ -80,7 +81,7 @@ const AuthenticationPage = ({
{renderButtonContent()}
</LoginButton>
)}
{siteUrl && <GoBackButton href={siteUrl} />}
{siteUrl && <GoBackButton href={siteUrl} t={t} />}
{logoUrl ? <NetlifyCreditIcon size="100px" type="netlify-cms" /> : null}
</StyledAuthenticationPage>
);
@ -94,6 +95,7 @@ AuthenticationPage.propTypes = {
loginErrorMessage: PropTypes.node,
renderButtonContent: PropTypes.func,
renderPageContent: PropTypes.func,
t: PropTypes.func.isRequired,
};
export default AuthenticationPage;

View File

@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import React from 'react';
import PropTypes from 'prop-types';
import { colorsRaw } from './styles.js';
import Icon from './Icon';
@ -20,11 +21,18 @@ const ButtonText = styled.p`
`;
export default class GoBackButton extends React.Component {
static propTypes = {
href: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
};
render() {
const { href, t } = this.props;
return (
<GoBackButtonStyle href={this.props.href}>
<GoBackButtonStyle href={href}>
<Icon type="arrow" size="small" />
<ButtonText>Go back to site</ButtonText>
<ButtonText>{t('ui.default.goBackToSite')}</ButtonText>
</GoBackButtonStyle>
);
}