feat(recent-list): add an explanatory label (#591)

This commit is contained in:
csett86 2021-06-28 09:44:01 +02:00 committed by GitHub
parent 0fdb2257ab
commit defb570e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 8 deletions

View File

@ -2,15 +2,19 @@
import moment from 'moment';
import React, { Component } from 'react';
import { withTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import type { Dispatch } from 'redux';
import { compose } from 'redux';
import { push } from 'react-router-redux';
import { conferenceRemoved } from '../actions';
import {
ConferenceCard,
ConferenceTitle,
Label,
RecentListContainer,
RecentListWrapper,
TruncatedText
} from '../styled';
import type { RecentListItem } from '../types';
@ -28,6 +32,11 @@ type Props = {
* Array of recent conferences.
*/
_recentList: Array<RecentListItem>;
/**
* I18next translation function.
*/
t: Function;
};
/**
@ -40,14 +49,23 @@ class RecentList extends Component<Props, *> {
* @returns {ReactElement}
*/
render() {
const { t } = this.props;
if (this.props._recentList.length === 0) {
return null;
}
return (
<RecentListContainer>
{
this.props._recentList.map(
conference => this._renderRecentListEntry(conference)
)
}
</RecentListContainer>
<RecentListWrapper>
<Label>{ t('recentListLabel') }</Label>
<RecentListContainer>
{
this.props._recentList.map(
conference => this._renderRecentListEntry(conference)
)
}
</RecentListContainer>
</RecentListWrapper>
);
}
@ -160,4 +178,4 @@ function _mapStateToProps(state: Object) {
};
}
export default connect(_mapStateToProps)(RecentList);
export default compose(connect(_mapStateToProps), withTranslation())(RecentList);

View File

@ -0,0 +1,8 @@
// @flow
import styled from 'styled-components';
export default styled.span`
color: white;
padding: 1em;
`;

View File

@ -0,0 +1,5 @@
// @flow
import styled from 'styled-components';
export default styled.div``;

View File

@ -1,4 +1,6 @@
export { default as ConferenceCard } from './ConferenceCard';
export { default as ConferenceTitle } from './ConferenceTitle';
export { default as Label } from './Label';
export { default as RecentListContainer } from './RecentListContainer';
export { default as RecentListWrapper } from './RecentListWrapper';
export { default as TruncatedText } from './TruncatedText';

View File

@ -4,6 +4,7 @@
"help": "Hilfe",
"termsLink": "Nutzungsbedingungen",
"privacyLink": "Datenschutzbedingungen",
"recentListLabel": "oder einen zuletzt genutzen Konferenzraum betreten",
"sendFeedbackLink": "Eine Rückmeldung senden",
"aboutLink": "F&A",
"sourceLink": "Quelltext",

View File

@ -4,6 +4,7 @@
"help": "Help",
"termsLink": "Terms",
"privacyLink": "Privacy",
"recentListLabel": "or rejoin one of your recent conference rooms",
"sendFeedbackLink": "Send Feedback",
"aboutLink": "About",
"sourceLink": "Source Code",