diff --git a/packages/netlify-cms-backend-bitbucket/src/AuthenticationPage.js b/packages/netlify-cms-backend-bitbucket/src/AuthenticationPage.js index f1538c73..31f50346 100644 --- a/packages/netlify-cms-backend-bitbucket/src/AuthenticationPage.js +++ b/packages/netlify-cms-backend-bitbucket/src/AuthenticationPage.js @@ -76,6 +76,7 @@ export default class BitbucketAuthenticationPage extends React.Component { loginDisabled={inProgress} loginErrorMessage={this.state.loginError} logoUrl={config.get('logo_url')} + siteUrl={config.get('site_url')} renderButtonContent={() => ( diff --git a/packages/netlify-cms-backend-git-gateway/src/AuthenticationPage.js b/packages/netlify-cms-backend-git-gateway/src/AuthenticationPage.js index ee8dbc11..60fc72d8 100644 --- a/packages/netlify-cms-backend-git-gateway/src/AuthenticationPage.js +++ b/packages/netlify-cms-backend-git-gateway/src/AuthenticationPage.js @@ -157,6 +157,7 @@ export default class GitGatewayAuthenticationPage extends React.Component { return ( ( {!error ? null : {error}} diff --git a/packages/netlify-cms-backend-github/src/AuthenticationPage.js b/packages/netlify-cms-backend-github/src/AuthenticationPage.js index 8e84e189..63dc0c31 100644 --- a/packages/netlify-cms-backend-github/src/AuthenticationPage.js +++ b/packages/netlify-cms-backend-github/src/AuthenticationPage.js @@ -133,6 +133,7 @@ export default class GitHubAuthenticationPage extends React.Component { loginDisabled={inProgress || findingFork || requestingFork} loginErrorMessage={loginError} logoUrl={config.get('logo_url')} + siteUrl={config.get('site_url')} {...this.getAuthenticationPageRenderArgs()} /> ); diff --git a/packages/netlify-cms-backend-gitlab/src/AuthenticationPage.js b/packages/netlify-cms-backend-gitlab/src/AuthenticationPage.js index 3672e715..3ffa116a 100644 --- a/packages/netlify-cms-backend-gitlab/src/AuthenticationPage.js +++ b/packages/netlify-cms-backend-gitlab/src/AuthenticationPage.js @@ -70,6 +70,7 @@ export default class GitLabAuthenticationPage extends React.Component { loginDisabled={inProgress} loginErrorMessage={this.state.loginError} logoUrl={config.get('logo_url')} + siteUrl={config.get('site_url')} renderButtonContent={() => ( {inProgress ? 'Logging in...' : 'Login with GitLab'} diff --git a/packages/netlify-cms-backend-test/src/AuthenticationPage.js b/packages/netlify-cms-backend-test/src/AuthenticationPage.js index 199d7019..3487ea97 100644 --- a/packages/netlify-cms-backend-test/src/AuthenticationPage.js +++ b/packages/netlify-cms-backend-test/src/AuthenticationPage.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import styled from '@emotion/styled'; -import { Icon, buttons, shadows } from 'netlify-cms-ui-default'; +import { Icon, buttons, shadows, GoBackButton } from 'netlify-cms-ui-default'; const StyledAuthenticationPage = styled.section` display: flex; @@ -57,7 +57,7 @@ export default class AuthenticationPage extends React.Component { }; render() { - const { inProgress } = this.props; + const { config, inProgress } = this.props; return ( @@ -65,6 +65,7 @@ export default class AuthenticationPage extends React.Component { {inProgress ? 'Logging in...' : 'Login'} + {config.get('site_url') && } ); } diff --git a/packages/netlify-cms-ui-default/src/AuthenticationPage.js b/packages/netlify-cms-ui-default/src/AuthenticationPage.js index 0973b6d5..619c7f42 100644 --- a/packages/netlify-cms-ui-default/src/AuthenticationPage.js +++ b/packages/netlify-cms-ui-default/src/AuthenticationPage.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import styled from '@emotion/styled'; import Icon from './Icon'; import { buttons, shadows } from './styles'; +import { GoBackButton } from './GoBackButton'; const StyledAuthenticationPage = styled.section` display: flex; @@ -67,6 +68,7 @@ const AuthenticationPage = ({ renderButtonContent, renderPageContent, logoUrl, + siteUrl, }) => { return ( @@ -78,6 +80,7 @@ const AuthenticationPage = ({ {renderButtonContent()} )} + {siteUrl && } {logoUrl ? : null} ); @@ -86,6 +89,7 @@ const AuthenticationPage = ({ AuthenticationPage.propTypes = { onLogin: PropTypes.func, logoUrl: PropTypes.string, + siteUrl: PropTypes.string, loginDisabled: PropTypes.bool, loginErrorMessage: PropTypes.node, renderButtonContent: PropTypes.func, diff --git a/packages/netlify-cms-ui-default/src/GoBackButton.js b/packages/netlify-cms-ui-default/src/GoBackButton.js new file mode 100644 index 00000000..a7d27c3c --- /dev/null +++ b/packages/netlify-cms-ui-default/src/GoBackButton.js @@ -0,0 +1,31 @@ +import styled from '@emotion/styled'; +import React from 'react'; + +import { colorsRaw } from './styles.js'; +import Icon from './Icon'; + +const GoBackButtonStyle = styled.a` + display: flex; + align-items: center; + + margin-top: 50px; + padding: 10px; + + font-size: 14px; +`; + +const ButtonText = styled.p` + color: ${colorsRaw.gray}; + margin: 0 10px; +`; + +export default class GoBackButton extends React.Component { + render() { + return ( + + + Go back to site + + ); + } +} diff --git a/packages/netlify-cms-ui-default/src/index.js b/packages/netlify-cms-ui-default/src/index.js index 02f9f2b5..40eba40a 100644 --- a/packages/netlify-cms-ui-default/src/index.js +++ b/packages/netlify-cms-ui-default/src/index.js @@ -6,6 +6,7 @@ import Toggle, { ToggleContainer, ToggleBackground, ToggleHandle } from './Toggl import AuthenticationPage from './AuthenticationPage'; import WidgetPreviewContainer from './WidgetPreviewContainer'; import ObjectWidgetTopBar from './ObjectWidgetTopBar'; +import GoBackButton from './GoBackButton'; import { fonts, colorsRaw, @@ -76,4 +77,5 @@ export { effects, reactSelectStyles, GlobalStyles, + GoBackButton, };