-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from PyConColombia/issue-107
Issue 107
- Loading branch information
Showing
11 changed files
with
734 additions
and
143 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
import { Col, Row } from 'react-bootstrap'; | ||
|
||
const Event = ({ talk, event, type, size, lang }) => { | ||
return ( | ||
<Col xs={12} md={type !== 'talk' ? 12 : size} className="event"> | ||
<Row> | ||
<Col xs={12}> | ||
<div className="event-title"> | ||
{type === 'keynote' ? ( | ||
<Link href={`/${lang}/keynotes/${event.id}`}>{event.title}</Link> | ||
) : ( | ||
event.title | ||
)} | ||
</div> | ||
</Col> | ||
{talk?.tags && ( | ||
<Col xs={12} className="talk-card"> | ||
{(talk?.tags || []).map((tag) => ( | ||
<Link key={tag} href={`/${lang}/talks/tags/${tag}`}> | ||
<span className={`badge default ${tag}`}>{tag}</span> | ||
</Link> | ||
))} | ||
</Col> | ||
)} | ||
|
||
<Col xs={12}> | ||
{talk.title && ( | ||
<div className="event-title"> | ||
<Link href={`/${lang}/talks/${talk.id}`}>{talk.title[lang]}</Link> | ||
</div> | ||
)} | ||
</Col> | ||
{talk.title && ( | ||
<Col xs={12}> | ||
<div className="event-title"> | ||
<Link href={`/${lang}/talks/${talk.id}`}>{talk.title[lang]}</Link> | ||
</div> | ||
</Col> | ||
)} | ||
|
||
{talk?.spoken_language && event?.room && ( | ||
<> | ||
<Col xs={12} md={6} className="event-description right"> | ||
{talk?.spoken_language} | ||
</Col> | ||
<Col xs={12} md={6} className="event-description left"> | ||
<span>{event?.room || ''}</span> | ||
</Col> | ||
</> | ||
)} | ||
</Row> | ||
</Col> | ||
); | ||
}; | ||
|
||
export default Event; |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react'; | ||
import propTypes from 'prop-types'; | ||
import Row from 'react-bootstrap/Row'; | ||
import Col from 'react-bootstrap/Col'; | ||
import Event from './Event'; | ||
|
||
const Events = ({ order, lang, talksList }) => { | ||
const getTalkById = (id) => { | ||
return talksList.find((talk) => talk.id === id); | ||
}; | ||
|
||
return ( | ||
<Row className="justify-content-center"> | ||
<Col xs={12}> | ||
{order.map((order, index) => { | ||
return ( | ||
<Row key={index}> | ||
<Col | ||
xs={12} | ||
md={order.events.length > 1 ? 12 : 6} | ||
className={`event-container ${order.type}`}> | ||
<h3 className="event-hour">{order.hour}</h3> | ||
<Row> | ||
{order.events.map((event) => { | ||
const talk = getTalkById(event.event_id) || {}; | ||
|
||
return ( | ||
<Event | ||
key={event.event_id} | ||
talk={talk} | ||
event={event} | ||
type={order.type} | ||
size={event.title ? '6' : '4'} | ||
lang={lang} | ||
/> | ||
); | ||
})} | ||
</Row> | ||
</Col> | ||
</Row> | ||
); | ||
})} | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
Events.propTypes = { | ||
talkData: propTypes.shape({ | ||
id: propTypes.number, | ||
first_name: propTypes.string, | ||
last_name: propTypes.string, | ||
biography: propTypes.shape({}), | ||
photo: propTypes.string, | ||
type: propTypes.string, | ||
country_origin: propTypes.string, | ||
facebook: propTypes.string, | ||
twitter: propTypes.string, | ||
linkedin: propTypes.string, | ||
github: propTypes.string, | ||
website: propTypes.string | ||
}), | ||
reverse: propTypes.bool, | ||
index: propTypes.number, | ||
lang: propTypes.string | ||
}; | ||
|
||
export default Events; |
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
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
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
Oops, something went wrong.