Created
September 19, 2018 08:52
-
-
Save ihorkatkov/a545b56c5c0df2bca67d91bab4257a6e to your computer and use it in GitHub Desktop.
Small react component example
This file contains hidden or 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
// @flow | |
import React from 'react' | |
import moment from 'moment' | |
import capitalize from '@/utils/capitalize' | |
import type { Event } from '@/modules/types/event' | |
type Props = { | |
event: Event, | |
} | |
const RecentEvent = ({ event }: Props) => ( | |
<a href={`/dashboard/deals/${event.relationId}`} data-cy="recentEvent"> | |
<div className="dashboard-card"> | |
<div className="card-text"> | |
<h4>{capitalize(event.eventType)}</h4> | |
<div> | |
<p className="events-description">{event.summary}</p> | |
</div> | |
</div> | |
<span className="hours-ago">{moment(event.insertedAt).fromNow()}</span> | |
</div> | |
</a> | |
) | |
export default RecentEvent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment