Use concatenated speaker name from API

This commit is contained in:
Vencislav Atanasov 2024-09-24 02:17:37 +03:00
parent 338eb555ad
commit 04cf4740ac
2 changed files with 2 additions and 6 deletions

View File

@ -1,16 +1,14 @@
import { getSpeakerName } from './utils.js';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
export default function Speaker(speaker) { export default function Speaker(speaker) {
return (<> return (<>
<a href={'#speaker-'.concat(speaker.id.toString())}>{getSpeakerName(speaker)}</a> <a href={'#speaker-'.concat(speaker.id.toString())}>{speaker.name}</a>
{speaker.organisation && <>/&#8288;{speaker.organisation}&#8288;/</>} {speaker.organisation && <>/&#8288;{speaker.organisation}&#8288;/</>}
</>); </>);
} }
Speaker.propTypes = { Speaker.propTypes = {
id: PropTypes.number.isRequired, id: PropTypes.number.isRequired,
first_name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
last_name: PropTypes.string.isRequired,
organisation: PropTypes.string, organisation: PropTypes.string,
}; };

View File

@ -1,3 +1 @@
export const getSpeakerName = speaker => speaker.first_name.concat(' ').concat(speaker.last_name);
export const isTrackHidden = track => track?.name?.en === 'Other' || track?.name?.bg === 'Други'; export const isTrackHidden = track => track?.name?.en === 'Other' || track?.name?.bg === 'Други';