aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index fa8a98402..027cfd376 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -9,11 +9,16 @@ import { CurrentUserUtils } from "../util/CurrentUserUtils";
import { UndoManager } from "../util/UndoManager";
import "./DashboardView.scss"
import { MainViewModal } from "./MainViewModal";
+import { ContextMenu } from "./ContextMenu";
+import { DocumentManager } from "../util/DocumentManager";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
enum DashboardGroup {
MyDashboards, SharedDashboards
}
+// DashboardView is the view with the dashboard previews, rendered when the app first loads
+
@observer
export class DashboardView extends React.Component {
@@ -23,7 +28,7 @@ export class DashboardView extends React.Component {
@observable private newDashboardName: string | undefined = undefined;
@action abortCreateNewDashboard = () => { this.newDashboardName = undefined }
- @action setNewDashboardName(name: string) { this.newDashboardName = name}
+ @action setNewDashboardName(name: string) { this.newDashboardName = name }
@action
selectDashboardGroup = (group: DashboardGroup) => {
@@ -75,7 +80,27 @@ export class DashboardView extends React.Component {
const href = ImageCast((dashboard.thumb as Doc)?.data)?.url.href;
return <div className="dashboard-container" key={dashboard[Id]} onClick={e => this.clickDashboard(e, dashboard)}>
<img src={href ?? "https://media.istockphoto.com/photos/hot-air-balloons-flying-over-the-botan-canyon-in-turkey-picture-id1297349747?b=1&k=20&m=1297349747&s=170667a&w=0&h=oH31fJty_4xWl_JQ4OIQWZKP8C6ji9Mz7L4XmEnbqRU="}></img>
- <div className="title"> {StrCast(dashboard.title)} </div>
+ <div className="info">
+ <div className="title"> {StrCast(dashboard.title)} </div>
+ <div className="more" onClick={e => {
+ const dashView = DocumentManager.Instance.getDocumentView(dashboard);
+ console.log(dashView)
+ ContextMenu.Instance.addItem({
+ description: "Share Dashboard", event: async () => {
+ // ...
+ }, icon: "edit"
+ });
+ ContextMenu.Instance.addItem({
+ description: "Delete Dashboard", event: async () => {
+ // ...
+ }, icon: "trash"
+ });
+ dashView?.showContextMenu(e.clientX + 20, e.clientY + 30);
+ }}>
+ <FontAwesomeIcon color="black" size="lg" icon="bars" />
+ </div>
+ </div>
+
</div>
})}