diff --git a/src/app/app.js b/src/app/app.js index 648cc97..152b501 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -6,8 +6,11 @@ import PagesPie from './pages-pie.js'; import injectTapEventPlugin from 'react-tap-event-plugin'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; +import {Header} from './header' +import Footer from './footer' + const { ipcRenderer, remote } = require('electron'); -const currentWindow = remote.getCurrentWindow() +window.currentWindow = remote.getCurrentWindow() //var io = require("socket.io-client"); //window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/')); @@ -110,14 +113,13 @@ class App extends Component { return (
- { - !currentWindow.isModal() + !window.currentWindow.isModal() && -
0 ? 'green' : 'grey'}}> - rats peers: {window.peers} {window.peers > 0 ? ' (p2p rats search enabled)' : ' (p2p rats search not available at this moment)'} -
+
} + +
); diff --git a/src/app/config-page.js b/src/app/config-page.js index 9c1cf3c..d3ca159 100644 --- a/src/app/config-page.js +++ b/src/app/config-page.js @@ -1,7 +1,5 @@ import React from 'react'; import Page from './page'; -import Footer from './footer'; -import {Header} from './index-page' import Toggle from 'material-ui/Toggle'; import RaisedButton from 'material-ui/RaisedButton'; @@ -39,7 +37,6 @@ export default class ConfigPage extends Page { render() { return (
-
{ window.router('/') @@ -279,7 +276,7 @@ export default class ConfigPage extends Page { this.saveSettings() }} />
-
); diff --git a/src/app/download-page.js b/src/app/download-page.js index 8ee5e1d..6fbaf8d 100644 --- a/src/app/download-page.js +++ b/src/app/download-page.js @@ -1,7 +1,5 @@ import React from 'react'; import Page from './page'; -import Footer from './footer'; -import { Header } from './index-page' import TorrentLine from './torrent' import {List} from 'material-ui/List'; @@ -41,7 +39,6 @@ export default class TopPage extends Page { render() { return (
-
{ window.router('/') @@ -53,7 +50,6 @@ export default class TopPage extends Page { }) } -
); diff --git a/src/app/header.js b/src/app/header.js new file mode 100644 index 0000000..eafc582 --- /dev/null +++ b/src/app/header.js @@ -0,0 +1,84 @@ +import React from 'react'; +import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card'; +import Background from './images/pirate-mod.jpg' +import RaisedButton from 'material-ui/RaisedButton'; + +const Header = (props) => { + return ( + + } + > +
+ { + window.router('/downloads') + }} + backgroundColor='#2080E4' + labelColor='white' + style={{height: 60, borderRadius: 5, margin: 5, zIndex: 1}} + buttonStyle={{borderRadius: 5}} + icon={ + + + } + /> + { + window.router('/top') + }} + backgroundColor='#B1CE57' + labelColor='white' + style={{height: 60, width: 120, borderRadius: 5, margin: 5, zIndex: 1}} + buttonStyle={{borderRadius: 5}} + icon={ + + + + + + } + /> + { + !window.currentWindow.isModal() + && +
0 ? '#42f445' : 'white'}}> + rats peers: {window.peers} {window.peers > 0 ? ' (p2p rats search enabled)' : ' (p2p rats search not available at this moment)'} +
+ } +
+
+ + Welcome to ROTB! This is file search engine based on the torrents from the internet. + Here you can easily find torrent or file that you intrested for. We are not responsible for any content: + this is only information about content that collected automatically! + +
+ ) +} + +export {Header} diff --git a/src/app/index-page.js b/src/app/index-page.js index 98ded98..b500008 100644 --- a/src/app/index-page.js +++ b/src/app/index-page.js @@ -1,88 +1,9 @@ import React from 'react'; import Page from './page'; -import Footer from './footer'; import RecentTorrents from './recent-torrents' import Search from './search' -import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card'; -import Background from './images/pirate-mod.jpg' - -import RaisedButton from 'material-ui/RaisedButton'; - -const Header = (props) => { - return ( - - } - > -
- { - window.router('/downloads') - }} - backgroundColor='#2080E4' - labelColor='white' - style={{height: 60, borderRadius: 5, margin: 5, zIndex: 1}} - buttonStyle={{borderRadius: 5}} - icon={ - - - } - /> - { - window.router('/top') - }} - backgroundColor='#B1CE57' - labelColor='white' - style={{height: 60, width: 120, borderRadius: 5, margin: 5, zIndex: 1}} - buttonStyle={{borderRadius: 5}} - icon={ - - - - - - } - /> -
-
- - Welcome to ROTB! This is file search engine based on the torrents from the internet. - Here you can easily find torrent or file that you intrested for. We are not responsible for any content: - this is only information about content that collected automatically! - -
- ) -} - -export {Header} - export default class IndexPage extends Page { constructor(props) { super(props) @@ -91,11 +12,9 @@ export default class IndexPage extends Page { render() { return (
-
-
); diff --git a/src/app/top-page.js b/src/app/top-page.js index 10a94ee..7a12edc 100644 --- a/src/app/top-page.js +++ b/src/app/top-page.js @@ -1,7 +1,5 @@ import React from 'react'; import Page from './page'; -import Footer from './footer'; -import { Header } from './index-page' import TorrentLine from './torrent' import {List} from 'material-ui/List'; @@ -41,7 +39,6 @@ export default class TopPage extends Page { render() { return (
-
{ window.router('/') @@ -70,7 +67,6 @@ export default class TopPage extends Page { }) } -
); diff --git a/src/app/torrent-page.js b/src/app/torrent-page.js index 688f9f4..ead80f4 100644 --- a/src/app/torrent-page.js +++ b/src/app/torrent-page.js @@ -1,7 +1,6 @@ import React from 'react'; import Page from './page'; import formatBytes from './format-bytes' -import Footer from './footer'; import {List, ListItem} from 'material-ui/List'; import Subheader from 'material-ui/Subheader'; @@ -510,7 +509,6 @@ export default class TorrentPage extends Page { : null } -