From 1c4c501c43b24504b26b289c3668b5d544dd8292 Mon Sep 17 00:00:00 2001 From: Severiano Badajoz Date: Wed, 7 Oct 2020 15:02:55 -0700 Subject: [PATCH] Auth UI tweaks (#1915) * remove auth buttons and dataset info from info menu * add auth buttons to menubar * remove auth from top left * new auth buttons * move infomenu to lsb dir * styling fixes * feedback * more feedback Co-authored-by: Timmy Huang --- client/src/components/leftSidebar/infoMenu.js | 72 ++++++++++++ .../leftSidebar/topLeftLogoAndTitle.js | 14 +-- client/src/components/menubar/authButtons.js | 87 +++++++++++--- client/src/components/menubar/index.js | 4 + client/src/components/menubar/infoMenu.js | 108 ------------------ 5 files changed, 148 insertions(+), 137 deletions(-) create mode 100644 client/src/components/leftSidebar/infoMenu.js delete mode 100644 client/src/components/menubar/infoMenu.js diff --git a/client/src/components/leftSidebar/infoMenu.js b/client/src/components/leftSidebar/infoMenu.js new file mode 100644 index 00000000..6ab9bdde --- /dev/null +++ b/client/src/components/leftSidebar/infoMenu.js @@ -0,0 +1,72 @@ +// jshint esversion: 6 +import React from "react"; +import { Button, Menu, MenuItem, Popover, Position } from "@blueprintjs/core"; +import { IconNames } from "@blueprintjs/icons"; + +const InformationMenu = React.memo((props) => { + const { libraryVersions, tosURL, privacyURL } = props; + return ( + + + + + + + {tosURL && ( + + )} + {privacyURL && ( + + )} + + } + position={Position.BOTTOM_RIGHT} + modifiers={{ + preventOverflow: { enabled: false }, + hide: { enabled: false }, + }} + > + + + ); + } return ( - - + - - {!userinfo.is_authenticated ? "Log In" : "Log Out"} - - - + Log In + + ); }); diff --git a/client/src/components/menubar/index.js b/client/src/components/menubar/index.js index b4271302..115eb6ff 100644 --- a/client/src/components/menubar/index.js +++ b/client/src/components/menubar/index.js @@ -7,6 +7,7 @@ import styles from "./menubar.css"; import actions from "../../actions"; import Clip from "./clip"; +import AuthButtons from "./authButtons"; import Subset from "./subset"; import UndoRedoReset from "./undoRedo"; import DiffexpButtons from "./diffexpButtons"; @@ -216,6 +217,8 @@ class MenuBar extends React.PureComponent { subsetPossible, subsetResetPossible, enableReembedding, + userinfo, + auth, } = this.props; const { pendingClipPercentiles } = this.state; @@ -241,6 +244,7 @@ class MenuBar extends React.PureComponent { zIndex: 3, }} > + { - dispatch({ type: "toggle dataset drawer" }); -}; - -const InformationMenu = React.memo((props) => { - const { - libraryVersions, - tosURL, - privacyURL, - auth, - userinfo, - dispatch, - } = props; - return ( - - - handleClick(dispatch)} - icon="info-sign" - text="Dataset Overview" - /> - - - - - - - {tosURL ? ( - - ) : null} - {privacyURL ? ( - - ) : null} - - {auth?.["requires_client_login"] && - userinfo?.["is_authenticated"] ? ( - <> - - - - ) : null} - - } - position={Position.BOTTOM_RIGHT} - modifiers={{ - preventOverflow: { enabled: false }, - hide: { enabled: false }, - }} - > -