Skip to content

Commit

Permalink
fix: display custom logo when using a proxy server (decaporg#7235)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Jagodic <jagodicmartin1@gmail.com>
  • Loading branch information
MichalRsa and martinjagodic authored Jun 26, 2024
1 parent 6715701 commit 7feca52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 2 additions & 7 deletions packages/decap-cms-backend-proxy/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { Icon, buttons, shadows, GoBackButton } from 'decap-cms-ui-default';
import { Icon, buttons, shadows, GoBackButton, renderPageLogo } from 'decap-cms-ui-default';

const StyledAuthenticationPage = styled.section`
display: flex;
Expand All @@ -11,11 +11,6 @@ const StyledAuthenticationPage = styled.section`
height: 100vh;
`;

const PageLogoIcon = styled(Icon)`
color: #c4c6d2;
margin-top: -300px;
`;

const LoginButton = styled.button`
${buttons.button};
${shadows.dropDeep};
Expand Down Expand Up @@ -51,7 +46,7 @@ export default class AuthenticationPage extends React.Component {

return (
<StyledAuthenticationPage>
<PageLogoIcon size="300px" type="decap-cms" />
{renderPageLogo(config.logo_url)}
<LoginButton disabled={inProgress} onClick={this.handleLogin}>
{inProgress ? t('auth.loggingIn') : t('auth.login')}
</LoginButton>
Expand Down
2 changes: 1 addition & 1 deletion packages/decap-cms-ui-default/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ AuthenticationPage.propTypes = {
t: PropTypes.func.isRequired,
};

export default AuthenticationPage;
export { AuthenticationPage as default, renderPageLogo };
4 changes: 3 additions & 1 deletion packages/decap-cms-ui-default/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Loader from './Loader';
import FieldLabel from './FieldLabel';
import IconButton from './IconButton';
import Toggle, { ToggleContainer, ToggleBackground, ToggleHandle } from './Toggle';
import AuthenticationPage from './AuthenticationPage';
import AuthenticationPage, { renderPageLogo } from './AuthenticationPage';
import WidgetPreviewContainer from './WidgetPreviewContainer';
import ObjectWidgetTopBar from './ObjectWidgetTopBar';
import GoBackButton from './GoBackButton';
Expand Down Expand Up @@ -63,6 +63,7 @@ export const DecapCmsUiDefault = {
zIndex,
reactSelectStyles,
GlobalStyles,
renderPageLogo,
};
export {
Dropdown,
Expand Down Expand Up @@ -97,4 +98,5 @@ export {
reactSelectStyles,
GlobalStyles,
GoBackButton,
renderPageLogo,
};

0 comments on commit 7feca52

Please sign in to comment.