Skip to content

Commit 4d9c18e

Browse files
authored
Add microsoft for opening night party and sponsor images to schedule (#125)
* Add microsoft information to opening night party * Add ability to have logo images for sponsored events
1 parent ce4778a commit 4d9c18e

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

content/2019/schedule.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@
236236
},
237237
{
238238
"time": "7:00 PM - 10:00 PM",
239-
"title": "Opening Night Party"
239+
"title": "Opening Night Party",
240+
"desc": "The opening night party will take place at Microsoft SF and is RSVP only. Check your email / slack for information on how to RSVP!",
241+
"eventSponsors": ["Microsoft"]
240242
}
241243
]
242244
},

src/components/event/event.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@
4343
margin-top: 0;
4444
}
4545
}
46+
47+
.sponsorLogo {
48+
max-width: 150px;
49+
}

src/components/event/index.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,29 @@ function renderEventInfo(title, desc) {
2020
}
2121

2222
// When the talk information is in the schedule.json
23-
const ConfEvent = ({ title, desc, type, additionalNames, speakers }) => {
23+
const ConfEvent = ({
24+
title,
25+
desc,
26+
type,
27+
additionalNames,
28+
speakers,
29+
sponsors,
30+
eventSponsors,
31+
}) => {
2432
const allSpeakers = []
2533
if (additionalNames) {
2634
additionalNames.map(name =>
2735
allSpeakers.push(speakers.find(s => s.name === name))
2836
)
2937
}
38+
39+
const allSponsors = []
40+
if (eventSponsors) {
41+
eventSponsors.map(sponsorName =>
42+
allSponsors.push(sponsors.find(s => s.name === sponsorName))
43+
)
44+
}
45+
3046
return (
3147
<>
3248
{type && <TalkType type={type} secondary />}
@@ -41,6 +57,21 @@ const ConfEvent = ({ title, desc, type, additionalNames, speakers }) => {
4157
key={`speaker-${speaker.name}-${index}`}
4258
/>
4359
))}
60+
{eventSponsors &&
61+
allSponsors.map(company => (
62+
<a
63+
target="_blank"
64+
rel="noopener noreferrer"
65+
href={company.url}
66+
key={company.id}
67+
>
68+
<img
69+
src={company.logo}
70+
alt={`${company.name} logo`}
71+
className={styles.sponsorLogo}
72+
/>
73+
</a>
74+
))}
4475
</div>
4576
</div>
4677
</>
@@ -77,6 +108,8 @@ const Event = ({
77108
name,
78109
time,
79110
speakers,
111+
sponsors,
112+
eventSponsors,
80113
title,
81114
desc,
82115
type,
@@ -93,6 +126,8 @@ const Event = ({
93126
type={type}
94127
additionalNames={additionalNames}
95128
speakers={speakers}
129+
sponsors={sponsors}
130+
eventSponsors={eventSponsors}
96131
/>
97132
) : (
98133
<TalkEvent

src/pages/2019/schedule.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const Tracks = ({ tracks, speakers, day }) => {
4343

4444
const Schedule = ({ data }) => {
4545
const speakers = data.allSpeakersJson.nodes
46+
const sponsors = data.allSponsorsJson.nodes
4647

4748
return (
4849
<ConfLayout subpage={true}>
@@ -78,6 +79,7 @@ const Schedule = ({ data }) => {
7879
<Event
7980
{...event}
8081
speakers={speakers}
82+
sponsors={sponsors}
8183
day={day}
8284
key={`event-${parameterize(day.date)}-${parameterize(
8385
event.time
@@ -119,5 +121,13 @@ export const scheduleQuery = graphql`
119121
}
120122
}
121123
}
124+
allSponsorsJson {
125+
nodes {
126+
id
127+
name
128+
url
129+
logo
130+
}
131+
}
122132
}
123133
`

0 commit comments

Comments
 (0)