From 04cf4740aca8fc54b22ec132fc7f7cad043e80e5 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Tue, 24 Sep 2024 02:17:37 +0300 Subject: [PATCH] Use concatenated speaker name from API --- src/Schedule/Speaker.jsx | 6 ++---- src/Schedule/utils.js | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Schedule/Speaker.jsx b/src/Schedule/Speaker.jsx index c6ef067..c3ba6b6 100644 --- a/src/Schedule/Speaker.jsx +++ b/src/Schedule/Speaker.jsx @@ -1,16 +1,14 @@ -import { getSpeakerName } from './utils.js'; import PropTypes from 'prop-types'; export default function Speaker(speaker) { return (<> - {getSpeakerName(speaker)} + {speaker.name} {speaker.organisation && <>/⁠{speaker.organisation}⁠/} ); } Speaker.propTypes = { id: PropTypes.number.isRequired, - first_name: PropTypes.string.isRequired, - last_name: PropTypes.string.isRequired, + name: PropTypes.string.isRequired, organisation: PropTypes.string, }; diff --git a/src/Schedule/utils.js b/src/Schedule/utils.js index a1a7d75..529c2fd 100644 --- a/src/Schedule/utils.js +++ b/src/Schedule/utils.js @@ -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 === 'Други';