aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/topbar
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/topbar')
-rw-r--r--src/client/views/topbar/TopBar.tsx27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index 4155800b8..eab33114e 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -1,8 +1,9 @@
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 { Flip } from 'react-awesome-reveal';
import { FaBug } from 'react-icons/fa';
import { Doc, DocListCast } from '../../../fields/Doc';
import { AclAdmin, DashVersion } from '../../../fields/DocSymbols';
@@ -11,6 +12,7 @@ import { GetEffectiveAcl } from '../../../fields/util';
import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue } from '../../../Utils';
import { CurrentUserUtils } from '../../util/CurrentUserUtils';
import { DocumentManager } from '../../util/DocumentManager';
+import { dropActionType } from '../../util/DragManager';
import { PingManager } from '../../util/PingManager';
import { ReportManager } from '../../util/reportManager/ReportManager';
import { ServerStats } from '../../util/ServerStats';
@@ -23,6 +25,7 @@ import { CollectionLinearView } from '../collections/collectionLinear';
import { DashboardView } from '../DashboardView';
import { Colors } from '../global/globalEnums';
import { DocumentViewInternal, returnEmptyDocViewList } from '../nodes/DocumentView';
+import { ObservableReactComponent } from '../ObservableReactComponent';
import { DefaultStyleProvider } from '../StyleProvider';
import './TopBar.scss';
@@ -31,7 +34,15 @@ import './TopBar.scss';
* 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';
@@ -102,7 +113,7 @@ export class TopBar extends React.Component {
Document={selDoc}
docViewPath={returnEmptyDocViewList}
fieldKey="data"
- dropAction="embed"
+ dropAction={dropActionType.embed}
styleProvider={DefaultStyleProvider}
select={emptyFunction}
isContentActive={returnTrue}
@@ -161,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,
@@ -183,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}
@@ -198,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