Skip to content

Commit

Permalink
Add title to landing page (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejritter authored Apr 30, 2024
1 parent a2a8403 commit a668883
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 25 deletions.
3 changes: 3 additions & 0 deletions docs/configuration/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5007,6 +5007,9 @@ export default {
// The title of the login modal.
"loginModal.title": "Sign In",

// The title of the welcome page.
"welcomePage.title": "Welcome",

// The title (advisory text) of the application logo image.
"logo.title": "CollectionSpace",

Expand Down
18 changes: 0 additions & 18 deletions src/components/pages/LoginPage.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/pages/LogoutPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import qs from 'qs';
import styles from '../../../styles/cspace-ui/LoginPage.css';
import styles from '../../../styles/cspace-ui/WelcomePage.css';

const propTypes = {
history: PropTypes.shape({
Expand Down Expand Up @@ -76,7 +76,7 @@ export default class LogoutPage extends Component {
logout();
}

history.replace('/login');
history.replace('/welcome');
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/RootPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import CreatePageContainer from '../../containers/pages/CreatePageContainer';
import DashboardPage from './DashboardPage';
import ExportViewerPageContainer from '../../containers/pages/ExportViewerPageContainer';
import ToolPageContainer from '../../containers/pages/ToolPageContainer';
import LoginPage from './LoginPage';
import WelcomePage from './WelcomePage';
import LogoutPageContainer from '../../containers/pages/LogoutPageContainer';
import RecordPageContainer from '../../containers/pages/RecordPageContainer';
import ReportViewerPageContainer from '../../containers/pages/ReportViewerPageContainer';
Expand Down Expand Up @@ -62,7 +62,7 @@ function RootPage(props) {
</Helmet>

<Switch>
<PublicRoute path="/login" component={LoginPage} />
<PublicRoute path="/welcome" component={WelcomePage} />
<PublicRoute path="/logout" component={LogoutPageContainer} decorated={false} />
<PublicRoute path="/config" component={ConfigPage} />
<PublicRoute path="/authorize" component={AuthorizePageContainer} decorated={false} />
Expand Down
45 changes: 45 additions & 0 deletions src/components/pages/WelcomePage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import About from '../sections/About';
import LoginForm from '../login/LoginForm';
import styles from '../../../styles/cspace-ui/WelcomePage.css';

const propTypes = {
intl: intlShape.isRequired,
};

const messages = defineMessages({
title: {
id: 'welcomePage.title',
description: 'Title of the welcome page.',
defaultMessage: 'Welcome',
},
});

function WelcomePage(props) {
const {
intl,
} = props;

return (
<>
<Helmet>
<title>{intl.formatMessage(messages.title)}</title>
</Helmet>
<div className={styles.common}>
<div className={styles.about}>
<About />
</div>

<div className={styles.login}>
<LoginForm />
</div>
</div>
</>
);
}

WelcomePage.propTypes = propTypes;

export default injectIntl(WelcomePage);
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Immutable from 'immutable';
import createTestContainer from '../../../helpers/createTestContainer';
import { render } from '../../../helpers/renderHelpers';
import mockHistory from '../../../helpers/mockHistory';
import LoginPage from '../../../../src/components/pages/LoginPage';
import WelcomePage from '../../../../src/components/pages/WelcomePage';

chai.should();

Expand All @@ -19,7 +19,7 @@ const store = mockStore({

const history = mockHistory();

describe('LoginPage', () => {
describe('WelcomePage', () => {
beforeEach(function before() {
this.container = createTestContainer(this);
});
Expand All @@ -29,7 +29,7 @@ describe('LoginPage', () => {
<IntlProvider locale="en">
<StoreProvider store={store}>
<Router>
<LoginPage
<WelcomePage
history={history}
location={{}}
/>
Expand Down

0 comments on commit a668883

Please sign in to comment.