aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/topbar
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-03-22 22:11:37 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-03-22 22:11:37 -0400
commit3c5bc5b89c3158c6c1dce02f99aa0c08d24dcb39 (patch)
tree99bed6d83f5a01ff2654cd4fb635ea5c48bcc820 /src/client/views/topbar
parent26d7e045c5b0a9a29612e68d976e35c0e7e23d00 (diff)
parenta974aa4e6573c8becf93f78610406747fec14c1c (diff)
Merge branch 'master' into nathan-starter
Diffstat (limited to 'src/client/views/topbar')
-rw-r--r--src/client/views/topbar/TopBar.tsx24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index 0952dda20..addad2bbc 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -1,6 +1,6 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Button, IconButton, isDark, Size, Type } from 'browndash-components';
-import { action, computed, observable, reaction } from 'mobx';
+import { action, computed, makeObservable, observable, reaction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { FaBug } from 'react-icons/fa';
@@ -26,13 +26,23 @@ import { DocumentViewInternal, returnEmptyDocViewList } from '../nodes/DocumentV
import { DefaultStyleProvider } from '../StyleProvider';
import './TopBar.scss';
import { dropActionType } from '../../util/DragManager';
+import { Flip } from 'react-awesome-reveal';
+import { ObservableReactComponent } from '../ObservableReactComponent';
/**
* 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 {
+export class TopBar extends ObservableReactComponent<{}> {
+ static Instance: TopBar;
+ @observable private _flipDocumentation = 0;
+ constructor(props: any) {
+ super(props);
+ makeObservable(this);
+ TopBar.Instance = this;
+ }
+
navigateToHome = () => {
(CollectionDockingView.Instance?.CaptureThumbnail() ?? new Promise<void>(res => res())).then(() => {
Doc.ActivePage = 'home';
@@ -162,7 +172,6 @@ export class TopBar extends React.Component {
</div>
) : null;
}
-
/**
* Returns the right hand side of the topbar.
* This part of the topbar includes information about the current user,
@@ -184,7 +193,9 @@ export class TopBar extends React.Component {
/>
) : null}
<IconButton tooltip={'Issue Reporter ⌘I'} size={Size.SMALL} color={this.color} onClick={ReportManager.Instance.open} icon={<FaBug />} />
- <IconButton tooltip={'Documentation ⌘D'} size={Size.SMALL} color={this.color} onClick={() => window.open('https://brown-dash.github.io/Dash-Documentation/', '_blank')} icon={<FontAwesomeIcon icon="question-circle" />} />
+ <Flip key={this._flipDocumentation}>
+ <IconButton tooltip={'Documentation ⌘D'} size={Size.SMALL} color={this.color} onClick={() => window.open('https://brown-dash.github.io/Dash-Documentation/', '_blank')} icon={<FontAwesomeIcon icon="question-circle" />} />
+ </Flip>
<IconButton tooltip={'Settings ⌘⇧S'} size={Size.SMALL} color={this.color} onClick={SettingsManager.Instance.open} icon={<FontAwesomeIcon icon="cog" />} />
<IconButton
size={Size.SMALL}
@@ -199,6 +210,11 @@ export class TopBar extends React.Component {
);
}
+ /**
+ * Make the documentation icon flip around to draw attention to it.
+ */
+ FlipDocumentationIcon = action(() => (this._flipDocumentation = this._flipDocumentation + 1));
+
render() {
return (
//TODO:glr Add support for light / dark mode