-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export modal and css improvements
- Loading branch information
1 parent
9d5b311
commit 5e96ecd
Showing
20 changed files
with
521 additions
and
224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as React from 'react' | ||
import numeral from 'numeral' | ||
|
||
import { Structure, Commit } from '../models/dataset' | ||
|
||
import Icon from './chrome/Icon' | ||
import RelativeTimestamp from './RelativeTimestamp' | ||
|
||
interface CommitDetailsProps { | ||
structure: Structure | ||
commit: Commit | ||
path: string | ||
} | ||
|
||
const CommitDetails: React.FunctionComponent<CommitDetailsProps> = (props) => { | ||
const { structure, commit, path } = props | ||
return ( | ||
<> | ||
<span className='dataset-details' style={{ marginBottom: '6px' }}><Icon icon='stickyNote' size='sm' color='default' />{commit.title}</span> | ||
<div className='dataset-details-container'> | ||
<span className='dataset-details'><Icon icon='commit' size='sm' color='default' /><span title={path}>{path.substring(path.length - 7)}</span></span> | ||
<span className='dataset-details'><Icon icon='clock' size='sm' color='default' /><RelativeTimestamp timestamp={commit.timestamp}/></span> | ||
<span className='dataset-details'><Icon icon='hdd' size='sm' color='default' />{numeral(structure.length).format('0.0b')}</span> | ||
<span className='dataset-details'><Icon icon='bars' size='sm' color='default' />{numeral(structure.entries).format('0,0')} rows</span> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default CommitDetails |
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,17 @@ | ||
import React from 'react' | ||
import moment from 'moment' | ||
|
||
interface RelativeTimestampProps { | ||
timestamp: string | ||
} | ||
|
||
const RelativeTimestamp: React.FunctionComponent<RelativeTimestampProps> = ({ timestamp }) => ( | ||
<span | ||
className='relative-timestamp' | ||
title={moment(timestamp).format('MMM D YYYY, h:mm A zz')} | ||
> | ||
{moment(timestamp).fromNow()} | ||
</span> | ||
) | ||
|
||
export default RelativeTimestamp |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react' | ||
import classNames from 'classnames' | ||
|
||
export interface RadioInputProps { | ||
label?: string | ||
name: string | ||
checked: boolean | ||
onChange: (name: string, checked: any) => void | ||
strong?: boolean | ||
disabled?: boolean | ||
} | ||
|
||
const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => { | ||
const { label, name, checked, onChange, strong = false, disabled = false } = props | ||
|
||
return ( | ||
<> | ||
<div className={classNames('radio-input-container', { 'disabled': disabled === true })}> | ||
<input | ||
id={name} | ||
name={name} | ||
type='radio' | ||
className='radio-input' | ||
checked={checked} | ||
onChange={ () => { onChange(name, !checked) }} | ||
disabled={disabled} | ||
/> | ||
{ strong && ( | ||
<strong>{label}</strong> | ||
)} | ||
{!strong && label} | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default RadioInput |
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.