From fbc5963a6d1fa6cd043d1831c6d4ccaf78f983a2 Mon Sep 17 00:00:00 2001 From: alicetran1221 <108845502+alicetran1221@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:53:13 -0700 Subject: [PATCH] Converted Speakers class to function (#240) --- src/app/components/speakers/speakers.js | 60 +++++++++++-------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/src/app/components/speakers/speakers.js b/src/app/components/speakers/speakers.js index dd23863..869d8b8 100644 --- a/src/app/components/speakers/speakers.js +++ b/src/app/components/speakers/speakers.js @@ -1,46 +1,38 @@ -import React from "react"; +import React from 'react'; import { speakersData } from "assets/data/speakers-info.js"; import "./speakers.scss"; -const Speaker = (name, title, photo) => { - return ( +const Speaker = (name, title, photo) => (
- {name -
-

{name}

-

{title}

-
+ {name +
+

{name}

+

{title}

+
- ); -}; +); -const renderSpeakers = (speakers) => { - return ( +const renderSpeakers = (speakers) => (
- {speakers.map((speaker) => - Speaker(speaker.name, speaker.title, speaker.photo), - )} + {speakers.map((speaker) => + Speaker(speaker.name, speaker.title, speaker.photo) + )}
- ); -}; +); -export default class Speakers extends React.Component { - render() { +const Speakers = () => { return ( -
-

Opening Speakers

- {renderSpeakers(speakersData.opening)} -

Closing Speakers

- {renderSpeakers(speakersData.closing)} -

Panelists

- {renderSpeakers(speakersData.panelists)} -
+
+

Opening Speakers

+ {renderSpeakers(speakersData.opening)} +

Closing Speakers

+ {renderSpeakers(speakersData.closing)} +

Panelists

+ {renderSpeakers(speakersData.panelists)} +
); - } -} -//

Keynote

-// {renderSpeakers(speakersData.keynotes)} +export default Speakers; \ No newline at end of file