Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit aaa7a54

Browse files
committed
refactor done,log removed
1 parent 7766b3f commit aaa7a54

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

components/row-events.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,38 @@ const extractImageUrl = input => {
99
return matches ? matches[1] : '';
1010
};
1111

12-
const RowEvent = props => {
12+
const RowEvent = ({
13+
link,
14+
fluid,
15+
description,
16+
name,
17+
venue,
18+
time,
19+
yesCount,
20+
status,
21+
}) => {
1322
return (
14-
<Card fluid={props.fluid} raised centered target="_blank" href={props.link}>
15-
{props.description ? (
16-
<Image src={extractImageUrl(props.description)} />
17-
) : (
18-
<div />
19-
)}
23+
<Card fluid={fluid} raised centered target="_blank" href={link}>
24+
{description ? <Image src={extractImageUrl(description)} /> : <div />}
2025
<Card.Content>
21-
<Card.Header>{props.name}</Card.Header>
26+
<Card.Header>{name}</Card.Header>
2227
<div className="card_venue">
23-
<Card.Meta>
24-
{props.venue === undefined ? 'Online' : props.venue.name}
25-
</Card.Meta>
28+
<Card.Meta>{venue === undefined ? 'Online' : venue.name}</Card.Meta>
2629
</div>
2730
</Card.Content>
2831
<Card.Content extra>
2932
<span className="card_icons">
3033
<Icon name="clock" />
31-
{format(props.time, "h:mm A, ddd MMM Do 'YY")}
34+
{format(time, "h:mm A, ddd MMM Do 'YY")}
3235
</span>
3336
<span className="card_icons">
3437
<Icon name="users" />
35-
{props.yesCount}
36-
{props.status === 'upcoming' ? ' attending' : ' attended'}
38+
{yesCount}
39+
{status === 'upcoming' ? ' attending' : ' attended'}
3740
</span>
3841
<span className="card_icons">
3942
<Icon name="log out" />
40-
{props.venue === undefined ? 'Free session' : 'Free entry'}
43+
{venue === undefined ? 'Free session' : 'Free entry'}
4144
</span>
4245
</Card.Content>
4346
<style jsx>{`

pages/events.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class Events extends React.Component {
4545
}
4646
}
4747
renderEvents() {
48-
console.log('this.state', this.state);
4948
if (this.state.fetchError) {
5049
return <div>{this.state.fetchError}</div>;
5150
}

0 commit comments

Comments
 (0)