Skip to content

Commit

Permalink
feat: show human-friendly timestamp in commit detail header, add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Sep 26, 2019
1 parent 76e06c8 commit 6b46090
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/components/CommitDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as React from 'react'
import moment from 'moment'
import { Action } from 'redux'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faClock } from '@fortawesome/free-regular-svg-icons'

import ComponentList from '../components/ComponentList'
import DatasetComponent from './DatasetComponent'
import { CSSTransition } from 'react-transition-group'
Expand Down Expand Up @@ -96,7 +99,8 @@ const CommitDetails: React.FunctionComponent<CommitDetailsProps> = ({
<div className='subtext'>
{/* <img className= 'user-image' src = {'https://avatars0.githubusercontent.com/u/1154390?s=60&v=4'} /> */}
<div className='time-message'>
{commit && moment(commit.timestamp).fromNow()}
<FontAwesomeIcon icon={faClock} size='sm'/>&nbsp;
{commit && moment(commit.timestamp).format('MMMM Do YYYY, h:mm:ss a')}
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/components/DatasetSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import moment from 'moment'
import { CSSTransition } from 'react-transition-group'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faTimes } from '@fortawesome/free-solid-svg-icons'
import { faClock } from '@fortawesome/free-regular-svg-icons'

import { ApiActionThunk } from '../store/api'
import SaveFormContainer from '../containers/SaveFormContainer'
Expand Down Expand Up @@ -33,7 +34,7 @@ const HistoryListItem: React.FunctionComponent<HistoryListItemProps> = (props) =
<div className='subtext'>
{/* Bring back avatar later <img className= 'user-image' src = {props.avatarUrl} /> */}
<div className='time-message'>
{props.timeMessage}
<FontAwesomeIcon icon={faClock} size='sm'/> {props.timeMessage}
</div>
</div>
</div>
Expand Down

0 comments on commit 6b46090

Please sign in to comment.