annonomize function components

This commit is contained in:
Niel 2019-04-21 13:31:01 +02:00
parent cb768c9fac
commit 3487e53115
7 changed files with 16 additions and 28 deletions

View file

@ -1,9 +1,9 @@
import React from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Home from './components/Home';
import Header from './components/Header';
import Home from './Home';
import Header from './Header';
const App = () => {
export default () => {
return (
<div className='App'>
<Header />
@ -13,5 +13,3 @@ const App = () => {
</div>
);
};
export default App;

View file

@ -1,7 +1,7 @@
import React from 'react';
import ChannelList from './ChannelList';
const ChannelEntry = props => {
export default props => {
const { clients, channel } = props;
const joined = [];
if (channel.totalClients > 0) {
@ -26,5 +26,3 @@ const ChannelEntry = props => {
</>
);
};
export default ChannelEntry;

View file

@ -2,7 +2,7 @@ import React from 'react';
import ChannelEntry from './ChannelEntry';
const ChannelList = ({ channels, clients }) => {
export default ({ channels, clients }) => {
return (
<ul className='channelList'>
{channels.map(channel => {
@ -15,5 +15,3 @@ const ChannelList = ({ channels, clients }) => {
</ul>
);
};
export default ChannelList;

View file

@ -1,6 +1,6 @@
import React from 'react';
const ChannelView = ({ channel }) => {
export default ({ channel }) => {
return (
<div className='channel-view'>
<h2>{channel.name}</h2>
@ -24,5 +24,3 @@ const ChannelView = ({ channel }) => {
</div>
);
};
export default ChannelView;

View file

@ -1,7 +1,5 @@
import React from 'react';
const Header = () => {
export default () => {
return <div className='app-header'>Cliffbreak.de</div>;
};
export default Header;

View file

@ -1,12 +1,10 @@
import React, { Component } from 'react';
import React from 'react';
import Channels from './Channel/Channels';
export default class Home extends Component {
render() {
export default () => {
return (
<div>
<Channels />
</div>
);
}
}
};

View file

@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import App from './components/App';
import './index.scss';
import * as serviceWorker from './serviceWorker';