diff --git a/src/serviceWorker.ts b/serviceWorker.js old mode 100755 new mode 100644 similarity index 87% rename from src/serviceWorker.ts rename to serviceWorker.js index c0b1310..f8c7e50 --- a/src/serviceWorker.ts +++ b/serviceWorker.js @@ -8,7 +8,7 @@ // resources are updated in the background. // To learn more about the benefits of this model and instructions on how to -// opt-in, read http://bit.ly/CRA-PWA +// opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( window.location.hostname === 'localhost' || @@ -20,18 +20,10 @@ const isLocalhost = Boolean( ) ); -type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; -}; - -export function register(config?: Config) { +export function register(config) { if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL( - (process as { env: { [key: string]: string } }).env.PUBLIC_URL, - window.location.href - ); + const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); if (publicUrl.origin !== window.location.origin) { // Our service worker won't work if PUBLIC_URL is on a different origin // from what our page is served on. This might happen if a CDN is used to @@ -51,7 +43,7 @@ export function register(config?: Config) { navigator.serviceWorker.ready.then(() => { console.log( 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit http://bit.ly/CRA-PWA' + 'worker. To learn more, visit https://bit.ly/CRA-PWA' ); }); } else { @@ -62,7 +54,7 @@ export function register(config?: Config) { } } -function registerValidSW(swUrl: string, config?: Config) { +function registerValidSW(swUrl, config) { navigator.serviceWorker .register(swUrl) .then(registration => { @@ -79,7 +71,7 @@ function registerValidSW(swUrl: string, config?: Config) { // content until all client tabs are closed. console.log( 'New content is available and will be used when all ' + - 'tabs for this page are closed. See http://bit.ly/CRA-PWA.' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' ); // Execute callback @@ -106,7 +98,7 @@ function registerValidSW(swUrl: string, config?: Config) { }); } -function checkValidServiceWorker(swUrl: string, config?: Config) { +function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl) .then(response => { diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..9920e82 --- /dev/null +++ b/src/App.js @@ -0,0 +1,17 @@ +import React from 'react'; +import { BrowserRouter as Router, Route } from 'react-router-dom'; +import Home from './components/Home'; +import Header from './components/Header'; + +const App = () => { + return ( +
+
+ + + +
+ ); +}; + +export default App; diff --git a/src/App.scss b/src/App.scss deleted file mode 100644 index 74ebcac..0000000 --- a/src/App.scss +++ /dev/null @@ -1,5 +0,0 @@ -body { - background-color: #4a4a4a; - font-size: 160%; - color: #fff -} diff --git a/src/App.tsx b/src/App.tsx deleted file mode 100755 index 5802c45..0000000 --- a/src/App.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React, { Component } from 'react'; -import { BrowserRouter as Router, Route } from 'react-router-dom'; - -import Header from './components/Header/Header'; - -import './App.scss'; -import Home from './components/Home'; - -class App extends Component { - public render() { - return ( -
-
- - - -
- ); - } -} - -export default App; diff --git a/src/components/Channel/ChannelEntry.tsx b/src/components/Channel/ChannelEntry.js similarity index 82% rename from src/components/Channel/ChannelEntry.tsx rename to src/components/Channel/ChannelEntry.js index 31af0e0..8d11c67 100644 --- a/src/components/Channel/ChannelEntry.tsx +++ b/src/components/Channel/ChannelEntry.js @@ -1,9 +1,9 @@ -import React, { Component } from 'react'; +import React from 'react'; import ChannelList from './ChannelList'; -const ChannelEntry = (props: ChannelEntryProps) => { +const ChannelEntry = props => { const { clients, channel } = props; - const joined: Client[] = []; + const joined = []; if (channel.totalClients > 0) { clients.forEach(client => { if (client.channelId === channel.id) joined.push(client); diff --git a/src/components/Channel/ChannelList.tsx b/src/components/Channel/ChannelList.js similarity index 62% rename from src/components/Channel/ChannelList.tsx rename to src/components/Channel/ChannelList.js index 4058702..1ceed80 100644 --- a/src/components/Channel/ChannelList.tsx +++ b/src/components/Channel/ChannelList.js @@ -1,10 +1,8 @@ -import React, { Component } from 'react'; -import ApiService from '../../services/ApiService'; +import React from 'react'; + import ChannelEntry from './ChannelEntry'; -import './ChannelList.scss'; - -const ChannelList = ({ channels, clients }: ChannelListProps) => { +const ChannelList = ({ channels, clients }) => { return (