From 2de400676d742980e2ef9c889e3f47db647f8c24 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 17 May 2022 21:32:48 -0500 Subject: add toast container --- src/web/src/components/App.js | 240 ++++++++++++++++++++++-------------------- 1 file changed, 128 insertions(+), 112 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 9654c2ff..a5bf936a 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -1,6 +1,9 @@ import React, { Component } from 'react'; import { Route, Link, Switch, Redirect } from "react-router-dom"; +import { ToastContainer } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; + import * as session from '../lib/session'; import { connect, disconnect } from '../lib/server'; import { urlBase } from '../config'; @@ -137,124 +140,137 @@ class App extends Component { } return ( - - - {version.isCanary && - Canary - } - - - Search - - - - - Downloads - - - - - Uploads - - - - - Rooms - - - - - Chat - - - - - Users - - - - - Browse - - - - {server?.isConnected && disconnect()} - > - Connected - } - {(!server?.isConnected) && connect()} - > - - - - Disconnected + <> + + + {version.isCanary && + Canary } - {isUpdateAvailable && - - - New Version! - } - centered - closeIcon - size='mini' - > - New Version! - -

You are currently running version {current} while version {latest} is available.

-
- - - - } - + + + Search + + + + + Downloads + + + + + Uploads + + + - System + Rooms - {session.isLoggedIn() && + + Chat + + + + + Users + + + + + Browse + + + + {server?.isConnected && disconnect()} + > + Connected + } + {(!server?.isConnected) && connect()} + > + + + + Disconnected + } + {isUpdateAvailable && + + + New Version! + } + centered + closeIcon + size='mini' + > + New Version! + +

You are currently running version {current} while version {latest} is available.

+
+ + + +
} + - Log Out + System - } - centered - size='mini' - header={
} - content='Are you sure you want to log out?' - actions={['Cancel', { key: 'done', content: 'Log Out', negative: true, onClick: this.logout }]} - />} -
- - - - this.withTokenCheck(
)}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - -
-
- + + {session.isLoggedIn() && + Log Out + + } + centered + size='mini' + header={
} + content='Are you sure you want to log out?' + actions={['Cancel', { key: 'done', content: 'Log Out', negative: true, onClick: this.logout }]} + />} +
+
+ + + this.withTokenCheck(
)}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + +
+
+
+ + ) }; }; -- cgit v1.2.3