Name: ipfs-filexp
Owner: TABLEFLIP
Description: Web based file manager for use with IPFS.
Created: 2017-05-04 14:50:23.0
Updated: 2017-05-08 09:24:35.0
Pushed: 2017-05-08 12:02:11.0
Homepage: null
Size: 35
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a web based file manager for use with IPFS.
The explorer is built in React, and requires a redux store, with saga middleware to be available in your app.
Install these peer dependencies in your app:
i --save react react-dom react-bootstrap react-redux react-redux-toastr react-router-redux redux-saga
Add the file explorer to your app:
main.js
rt React from 'react'
rt {render} from 'react-dom'
rt {Route} from 'react-router'
rt {syncHistoryWithStore} from 'react-router-redux'
rt configureStore from './configure-store'
. GRAB THE Explorer AND Preview COMPONENT!
rt {Explorer, Preview} from '@tableflip/ipfs-filexp'
t ExplorerPage = () => <Explorer />
t PreviewPage = () => <Preview />
t store = configureStore()
t history = syncHistoryWithStore(hashHistory, store)
. WIRE INTO APP
er(
rovider store={store}>
<Router history={history}>
<Route path='/' component={ExplorerPage}>
<Route path='preview' component={PreviewPage} />
</Route>
</Router>
Provider>,
cument.getElementById('root')
That's it! Although we need an appropriate configureStore
function which will apply the file explorer redux reducers and run the file explorer sagas for us. Here's how you might do that:
configure-store.js
rt {createStore, applyMiddleware, combineReducers} from 'redux'
rt createSagaMiddleware from 'redux-saga'
rt {fork} from 'redux-saga/effects'
rt * as Filexp from '@tableflip/ipfs-filexp'
YO reducers and sagas
rt reducers from './reducers'
rt sagas from './sagas'
rt default function configureStore (initialState) {
nst rootReducer = combineReducers({ ...reducers, ...Filexp.reducers })
nst sagaMiddleware = createSagaMiddleware()
nst store = createStore(
rootReducer,
initialState,
applyMiddleware(sagaMiddleware)
gaMiddleware.run(function * () {
yield [
fork(sagas),
fork(Filexp.sagas)
]
turn store
Make sure node.js version 4+ and npm version 3+ are installed and in your path.
run build # The result will be in /lib
Please contribute! The more people who work on this, the faster we'll be able to ship it. Dive in by testing it and looking at the issues.
The CONTRIBUTING file has more information relevant to this repo. To contribute to IPFS in general, just click on the image above to go to our global contributing guide.