aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/topbar
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2021-07-30 13:26:25 -0400
committergeireann <geireann.lindfield@gmail.com>2021-07-30 13:26:25 -0400
commitc9f379adab864132e6cf044f808a43254601e4bb (patch)
tree9474a6e05be18f9bd626f4cae616be3513dbc4ad /src/client/views/topbar
parentb33e45f1f839b3c6eaf1076e605abacd1bc6883c (diff)
major UI / updates + refactoring
Diffstat (limited to 'src/client/views/topbar')
-rw-r--r--src/client/views/topbar/TopBar.scss12
-rw-r--r--src/client/views/topbar/TopBar.tsx89
2 files changed, 52 insertions, 49 deletions
diff --git a/src/client/views/topbar/TopBar.scss b/src/client/views/topbar/TopBar.scss
index 324b96dbd..e2d27d5a6 100644
--- a/src/client/views/topbar/TopBar.scss
+++ b/src/client/views/topbar/TopBar.scss
@@ -30,7 +30,7 @@
display: flex;
.topbar-dashboards {
- display: none;
+ display: inline-flex;
}
.topbar-dashSelect {
@@ -46,12 +46,6 @@
}
}
}
-
- .topbar-lozenge-dashboard:hover {
- .topbar-dashboards {
- display: inline-flex;
- }
- }
}
.topBar-icon {
@@ -85,7 +79,7 @@
.topbar-lozenge {
height: 23;
font-size: 12;
- color: black;
+ color: white;
font-family: 'Roboto';
font-weight: 400;
padding: 4px;
@@ -93,7 +87,7 @@
margin-right: 7px;
display: flex;
align-items: center;
- border: black 1px solid;
+ border: white 1px solid;
.topbar-logoff {
border-radius: 3px;
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index 79239d4ea..65da717f8 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -1,58 +1,67 @@
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { observer } from "mobx-react";
import * as React from 'react';
import { Doc, DocListCast } from '../../../fields/Doc';
import { Id } from '../../../fields/FieldSymbols';
import { StrCast } from '../../../fields/Types';
import { Utils } from '../../../Utils';
import { CurrentUserUtils } from "../../util/CurrentUserUtils";
-import { ColorScheme, SettingsManager } from "../../util/SettingsManager";
+import { SettingsManager } from "../../util/SettingsManager";
import { undoBatch } from "../../util/UndoManager";
+import { Borders, Colors } from "../global/globalEnums";
import "./TopBar.scss";
-import { Colors, Borders } from "../global/globalEnums";
-export const TopBar = () => {
-
- const myDashboards = DocListCast(CurrentUserUtils.MyDashboards.data);
- return (
- <div style={{ pointerEvents: "all" }} className="topbar-container">
- <div className="topbar-bar" style={{ background: Doc.UserDoc().colorScheme === ColorScheme.Dark ? Colors.DARK_GRAY : Colors.LIGHT_GRAY, borderBottom: Borders.STANDARD }}>
- <div className="topbar-center" >
- <div className="topbar-lozenge-dashboard">
- <select className="topbar-dashSelect" onChange={e => CurrentUserUtils.openDashboard(Doc.UserDoc(), myDashboards[Number(e.target.value)])}
- value={myDashboards.indexOf(CurrentUserUtils.ActiveDashboard)}
- style={{ color: Doc.UserDoc().colorScheme === ColorScheme.Dark ? "white" : "black" }}>
- {myDashboards.map((dash, i) => <option key={dash[Id]} value={i}> {StrCast(dash.title)} </option>)}
- </select>
- <div className="topbar-dashboards">
- <div className="topbar-icon" onClick={undoBatch(() => CurrentUserUtils.createNewDashboard(Doc.UserDoc()))}
- style={{ color: Doc.UserDoc().colorScheme === ColorScheme.Dark ? "white" : "black" }}>
- <FontAwesomeIcon icon="plus"></FontAwesomeIcon>
- </div>
- <div className="topbar-icon" onClick={undoBatch(() => CurrentUserUtils.snapshotDashboard(Doc.UserDoc()))}
- style={{ color: Doc.UserDoc().colorScheme === ColorScheme.Dark ? "white" : "black" }}>
- <FontAwesomeIcon icon="camera"></FontAwesomeIcon>
+/**
+ * REACT TYPE: FUNCTIONAL
+ * ABOUT: This is the topbar in Dash, which included the current Dashboard as well as access to information on the user
+ * and settings and help buttons. Future scope for this bar is to include the collaborators that are on the same Dashboard.
+ */
+@observer
+export class TopBar extends React.Component {
+ render() {
+ const myDashboards = DocListCast(CurrentUserUtils.MyDashboards.data);
+ return (
+ //TODO:glr Add support for light / dark mode
+ <div style={{ pointerEvents: "all" }} className="topbar-container">
+ <div className="topbar-bar" style={{ background: Colors.DARK_GRAY, borderBottom: Borders.STANDARD }}>
+ <div className="topbar-center" >
+ <div className="topbar-lozenge-dashboard">
+ <select className="topbar-dashSelect" onChange={e => CurrentUserUtils.openDashboard(Doc.UserDoc(), myDashboards[Number(e.target.value)])}
+ value={myDashboards.indexOf(CurrentUserUtils.ActiveDashboard)}
+ style={{ color: Colors.WHITE }}>
+ {myDashboards.map((dash, i) => <option key={dash[Id]} value={i}> {StrCast(dash.title)} </option>)}
+ </select>
+ <div className="topbar-dashboards">
+ <div className="topbar-icon" onClick={undoBatch(() => CurrentUserUtils.createNewDashboard(Doc.UserDoc()))}
+ style={{ color: Colors.WHITE }}>
+ <FontAwesomeIcon icon="plus"></FontAwesomeIcon>
+ </div>
+ <div className="topbar-icon" onClick={undoBatch(() => CurrentUserUtils.snapshotDashboard(Doc.UserDoc()))}
+ style={{ color: Colors.WHITE }}>
+ <FontAwesomeIcon icon="camera"></FontAwesomeIcon>
+ </div>
</div>
</div>
</div>
- </div>
- <div className="topbar-right" >
- <div className="topbar-icon"
- style={{ color: Doc.UserDoc().colorScheme === ColorScheme.Dark ? "white" : "black" }}>
- <FontAwesomeIcon icon="question-circle"></FontAwesomeIcon>
- </div>
- <div className="topbar-icon" onClick={() => SettingsManager.Instance.open()}
- style={{ color: Doc.UserDoc().colorScheme === ColorScheme.Dark ? "white" : "black" }}>
- <FontAwesomeIcon icon="cog"></FontAwesomeIcon>
- </div>
- <div className="topbar-lozenge-user">
- {`${Doc.CurrentUserEmail}`}
- <div className="topbar-logoff" onClick={() => window.location.assign(Utils.prepend("/logout"))}>
- Logoff
+ <div className="topbar-right" >
+ <div className="topbar-icon"
+ style={{ color: Colors.WHITE }}>
+ <FontAwesomeIcon icon="question-circle"></FontAwesomeIcon>
+ </div>
+ <div className="topbar-icon" onClick={() => SettingsManager.Instance.open()}
+ style={{ color: Colors.WHITE }}>
+ <FontAwesomeIcon icon="cog"></FontAwesomeIcon>
+ </div>
+ <div className="topbar-lozenge-user">
+ {`${Doc.CurrentUserEmail}`}
+ <div className="topbar-logoff" onClick={() => window.location.assign(Utils.prepend("/logout"))}>
+ Logoff
+ </div>
</div>
</div>
- </div>
+ </div >
</div >
- </div >
- );
+ );
+ }
} \ No newline at end of file