-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted Speakers class to function (#240)
- Loading branch information
1 parent
c3c3e9b
commit fbc5963
Showing
1 changed file
with
26 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) => ( | ||
<div className="speaker-img-wrapper"> | ||
<img | ||
src={require("assets/images/speaker-photos/" + photo + ".jpeg")} | ||
alt={name + "'s profile picture"} | ||
/> | ||
<div className="text"> | ||
<h4>{name}</h4> | ||
<p>{title}</p> | ||
</div> | ||
<img | ||
src = {require('assets/images/speaker-photos/'+photo+'.jpeg')} | ||
alt = {name + "'s profile picture"} | ||
/> | ||
<div className="text"> | ||
<h4>{name}</h4> | ||
<p>{title}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
); | ||
|
||
const renderSpeakers = (speakers) => { | ||
return ( | ||
const renderSpeakers = (speakers) => ( | ||
<div className="speaker-photos"> | ||
{speakers.map((speaker) => | ||
Speaker(speaker.name, speaker.title, speaker.photo), | ||
)} | ||
{speakers.map((speaker) => | ||
Speaker(speaker.name, speaker.title, speaker.photo) | ||
)} | ||
</div> | ||
); | ||
}; | ||
); | ||
|
||
export default class Speakers extends React.Component { | ||
render() { | ||
const Speakers = () => { | ||
return ( | ||
<div id="speakers"> | ||
<p className="subheader">Opening Speakers</p> | ||
{renderSpeakers(speakersData.opening)} | ||
<p className="subheader">Closing Speakers</p> | ||
{renderSpeakers(speakersData.closing)} | ||
<p className="subheader">Panelists</p> | ||
{renderSpeakers(speakersData.panelists)} | ||
</div> | ||
<div id="speakers"> | ||
<p className="subheader">Opening Speakers</p> | ||
{renderSpeakers(speakersData.opening)} | ||
<p className="subheader">Closing Speakers</p> | ||
{renderSpeakers(speakersData.closing)} | ||
<p className="subheader">Panelists</p> | ||
{renderSpeakers(speakersData.panelists)} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
// <p className="subheader">Keynote</p> | ||
// {renderSpeakers(speakersData.keynotes)} | ||
export default Speakers; |