import React from 'react'; 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; flex-flow: column nowrap; align-items: center; justify-content: center; gap: 50px; height: 100vh; `; const CustomIconWrapper = styled.span` width: 300px; height: auto; `; const DecapLogoIcon = styled(Icon)` height: auto; `; const NetlifyCreditIcon = styled(Icon)` color: #c4c6d2; position: absolute; bottom: 10px; `; function CustomLogoIcon({ url }) { return ( Logo ); } function renderPageLogo(logoUrl) { if (logoUrl) { return ; } return ; } const LoginButton = styled.button` ${buttons.button}; ${shadows.dropDeep}; ${buttons.default}; ${buttons.gray}; &[disabled] { ${buttons.disabled}; } padding: 0 12px; margin-top: 0; display: flex; align-items: center; position: relative; `; const TextButton = styled.button` ${buttons.button}; ${buttons.default}; ${buttons.grayText}; margin-top: 0; display: flex; align-items: center; position: relative; `; function AuthenticationPage({ onLogin, loginDisabled, loginErrorMessage, renderButtonContent, renderPageContent, logoUrl, siteUrl, t, }) { return ( {renderPageLogo(logoUrl)} {loginErrorMessage ?

{loginErrorMessage}

: null} {!renderPageContent ? null : renderPageContent({ LoginButton, TextButton, showAbortButton: !siteUrl })} {!renderButtonContent ? null : ( {renderButtonContent()} )} {siteUrl && } {logoUrl ? : null}
); } AuthenticationPage.propTypes = { onLogin: PropTypes.func, logoUrl: PropTypes.string, siteUrl: PropTypes.string, loginDisabled: PropTypes.bool, loginErrorMessage: PropTypes.node, renderButtonContent: PropTypes.func, renderPageContent: PropTypes.func, t: PropTypes.func.isRequired, }; export { AuthenticationPage as default, renderPageLogo };