diff --git a/package.json b/package.json index 7682529..28c1f3e 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,10 @@ "version": "0.1.0", "private": true, "dependencies": { + "@types/react-router-dom": "^4.3.1", "react": "^16.8.1", - "react-dom": "^16.8.1" + "react-dom": "^16.8.1", + "react-router-dom": "^4.3.1" }, "devDependencies": { "@types/node": "10.12.21", diff --git a/src/App.tsx b/src/App.tsx index 654fa0e..c0ab4b3 100755 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,21 +1,20 @@ import React, { Component } from 'react'; +import { BrowserRouter as Router, Route } from 'react-router-dom'; import Header from './components/Header/Header'; import './App.scss'; +import Channellist from './components/Channel/ChannelList'; +import Home from './components/Home'; class App extends Component { public render() { - const channel: Channel = { - id: 1, - name: 'test', - totalClients: -1, - neededSubscribePower: 0, - subchannels: [], - }; return (
+ + +
); } diff --git a/src/components/Channel/ChannelList.tsx b/src/components/Channel/ChannelList.tsx index 546884b..ffb697a 100644 --- a/src/components/Channel/ChannelList.tsx +++ b/src/components/Channel/ChannelList.tsx @@ -15,8 +15,7 @@ export default class Channellist extends Component { } componentDidMount() { - fetch('http://haveachin.de:1888/v1/channels') - .then(res => res.json()) + ChannelService.getAllChannels() .then(data => this.setState({ channels: data, loaded: true })) .catch(e => console.log(e)); } @@ -29,7 +28,7 @@ export default class Channellist extends Component { return (