From 2103334a21dfa48b2b896ff27872236257f9fbaa Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 24 Aug 2017 08:30:22 -0400 Subject: [PATCH] Add react-router --- package.json | 3 +++ src/actions/resources.js | 1 + src/index.js | 15 +++++++++------ src/reducers/index.js | 4 +++- src/reducers/torrents.js | 9 ++++++++- src/socket.js | 1 + src/store.js | 6 +++++- src/ui/add_torrent.js | 9 +++++++++ src/ui/main.js | 7 +++++-- src/ui/navigation.js | 7 ++++++- src/ui/torrent_details.js | 10 ++++++++++ 11 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 src/ui/add_torrent.js create mode 100644 src/ui/torrent_details.js diff --git a/package.json b/package.json index d221a70..aebb174 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,10 @@ "express": "^4.15.3", "file-loader": "^0.11.2", "font-awesome": "^4.7.0", + "history": "^4.7.2", "node-sass": "^4.5.3", + "react-router-dom": "^4.2.0", + "react-router-redux": "^5.0.0-alpha.6", "sass-loader": "^6.0.6" } } diff --git a/src/actions/resources.js b/src/actions/resources.js index 2eaff0a..b4afc58 100644 --- a/src/actions/resources.js +++ b/src/actions/resources.js @@ -1 +1,2 @@ export const UPDATE_RESOURCES = 'UPDATE_RESOURCES'; +export const RESOURCES_REMOVED = 'RESOURCES_REMOVED'; diff --git a/src/index.js b/src/index.js index 5204d12..202ac0a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,9 @@ import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; +import { ConnectedRouter } from 'react-router-redux'; -import store from './store'; +import store, { history } from './store'; import scss from '../scss/main.scss'; import { ws_init } from './socket'; import { filter_subscribe } from './actions/filter_subscribe'; @@ -17,12 +18,14 @@ ws_init(() => { render( -
-
-

archlinux-2017.08.01-x86_64.iso

-

TODO details

+ +
); diff --git a/src/ui/navigation.js b/src/ui/navigation.js index 37fd735..29e543b 100644 --- a/src/ui/navigation.js +++ b/src/ui/navigation.js @@ -1,4 +1,5 @@ import React from 'react'; +import { NavLink } from 'react-router-dom'; export default function render(props) { return