Skip to content

Commit

Permalink
Start using components from ipfs-react-components
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 16, 2018
1 parent 8d7b93d commit 2834421
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 1,502 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"go-ipfs-dep": "^0.4.13",
"ipfsd-ctl": "^0.27.0",
"file-extension": "^4.0.1",
"ipfs-react-components": "hacdias/ipfs-react-components",
"ipfs-stats": "^1.0.4",
"moment": "^2.20.1",
"multiaddr": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/logic/new-pinned-hash.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'

import IconButton from '../view/icon-button'
import {IconButton} from 'ipfs-react-components'

/**
* Is a New Pinned Hash form.
Expand Down
25 changes: 0 additions & 25 deletions src/js/components/view/button.js

This file was deleted.

25 changes: 15 additions & 10 deletions src/js/components/view/checkbox-block.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import PropTypes from 'prop-types'

import {Block} from 'ipfs-react-components'

/**
* Is a Checkbox Block.
*
Expand All @@ -19,18 +21,21 @@ export default function CheckboxBlock (props) {
}

return (
<div onClick={_onClick} className='info-block checkbox'>
<div className='wrapper'>
<Block
onClick={_onClick}
className='checkbox'
wrapped={(
<div>
<p className='label'>{props.title}</p>
<p className='info'>{props.info}</p>
</div>
<div className='right'>
<input type='checkbox' onChange={_onClick} checked={props.value} />
<span className='checkbox' />
<div>
<p className='label'>{props.title}</p>
<p className='info'>{props.info}</p>
</div>
<div className='right'>
<input type='checkbox' onChange={_onClick} checked={props.value} />
<span className='checkbox' />
</div>
</div>
</div>
</div>
)} />
)
}

Expand Down
3 changes: 1 addition & 2 deletions src/js/components/view/file-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import moment from 'moment'
import fileExtension from 'file-extension'
import {ipcRenderer, clipboard} from 'electron'

import Button from './button'
import Icon from './icon'
import {Button, Icon} from 'ipfs-react-components'

/**
* Is a File Block.
Expand Down
23 changes: 0 additions & 23 deletions src/js/components/view/footer.js

This file was deleted.

48 changes: 0 additions & 48 deletions src/js/components/view/header.js

This file was deleted.

33 changes: 0 additions & 33 deletions src/js/components/view/icon-button.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/components/view/icon-dropdown-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'

import Icon from './icon'
import {Icon} from 'ipfs-react-components'

function onChangeWrapper (fn) {
return event => {
Expand Down
29 changes: 0 additions & 29 deletions src/js/components/view/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/components/view/info-block.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'

import Button from '../view/button'
import {Button} from 'ipfs-react-components'

/**
* Is an information block.
Expand Down
35 changes: 0 additions & 35 deletions src/js/components/view/menu-option.js

This file was deleted.

30 changes: 0 additions & 30 deletions src/js/components/view/pane-container.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/js/components/view/pane.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/components/view/pinned-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import {ipcRenderer} from 'electron'

import Button from './button'
import {Button} from 'ipfs-react-components'

/**
* Is a Pinned Hash.
Expand Down
11 changes: 7 additions & 4 deletions src/js/panes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import {ipcRenderer} from 'electron'
import {NativeTypes} from 'react-dnd-html5-backend'
import {DropTarget} from 'react-dnd'

import Pane from '../components/view/pane'
import Header from '../components/view/header'
import Footer from '../components/view/footer'
import {
Pane,
Header,
Footer,
IconButton
} from 'ipfs-react-components'

import File from '../components/view/file-block'
import IconButton from '../components/view/icon-button'

const fileTarget = {
drop (props, monitor) {
Expand Down
12 changes: 7 additions & 5 deletions src/js/panes/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import PropTypes from 'prop-types'
import {clipboard, ipcRenderer} from 'electron'
import prettyBytes from 'pretty-bytes'

import Pane from '../components/view/pane'
import Header from '../components/view/header'
import Footer from '../components/view/footer'
import IconButton from '../components/view/icon-button'
import InfoBlock from '../components/view/info-block'
import {
Pane,
Header,
Footer,
IconButton,
InfoBlock
} from 'ipfs-react-components'

function onClickCopy (text) {
return () => clipboard.writeText(text)
Expand Down
Loading

0 comments on commit 2834421

Please sign in to comment.