Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 97a6b46

Browse files
committed
add all modals to menu
1 parent d699095 commit 97a6b46

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

images/goto.svg

Lines changed: 1 addition & 0 deletions
Loading

images/search.svg

Lines changed: 1 addition & 0 deletions
Loading

script/viewer/Analyse/AnalyseMenu.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import {ModalState} from "./Analyser";
2+
import {Show} from "solid-js";
3+
14
export interface AnalyseMenuProps {
25
sessionName: string;
36
onShare: Function;
47
canShare: boolean;
58
isShared: boolean;
6-
clients: number,
7-
inShared: boolean,
8-
open: boolean,
9-
openHelp: Function;
9+
clients: number;
10+
inShared: boolean;
11+
open: boolean;
12+
openModal: (ModalState) => void;
1013
}
1114

1215
export function AnalyseMenu(props: AnalyseMenuProps) {
@@ -23,7 +26,7 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
2326
<summary title="Menu"></summary>
2427
<ul class="menu">
2528
<li>
26-
<button class="share-session" title="Start a shared session" disabled={props.isShared}
29+
<button className="share-session" title="Start a shared session" disabled={props.isShared}
2730
onClick={() => {
2831
props.onShare()
2932
}}>
@@ -41,10 +44,21 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
4144
</button>
4245
</li>
4346
<li>
44-
<button class="help" title="Help" onClick={() => props.openHelp()}>
47+
<button className="help" title="Help" onClick={() => props.openModal(ModalState.Help)}>
4548
Help
4649
</button>
4750
</li>
51+
<li>
52+
<button className="goto" title="Goto Tick" onClick={() => props.openModal(ModalState.Goto)}>
53+
Goto Tick
54+
</button>
55+
</li>
56+
<li>
57+
<button className="search" title="Search Events"
58+
onClick={() => props.openModal(ModalState.Search)}>
59+
Search Events
60+
</button>
61+
</li>
4862
</ul>
4963
</details>
5064
</Show>

script/viewer/Analyse/Analyser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {DemoHead} from "../../header";
1818
import {EventSearch} from "./EventSearch";
1919
import {Event} from "./Data/Parser";
2020

21-
enum ModalState {
21+
export enum ModalState {
2222
Closed,
2323
Help,
2424
Goto,
@@ -254,7 +254,7 @@ export const Analyser = (props: AnalyseProps) => {
254254
}, onUpdate);
255255
setSessionName(session.sessionName);
256256
}}
257-
openHelp={() => setHelpOpen(true)}
257+
openModal={setModalState}
258258
canShare={props.isStored && !inShared}
259259
isShared={isShared()}
260260
clients={clients()}

style/pages/viewer/AnalyseMenu.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
background-image: url("inline://images//help.svg");
3131
}
3232

33+
& button.goto {
34+
background-image: url("inline://images//goto.svg");
35+
}
36+
37+
& button.search {
38+
background-image: url("inline://images//search.svg");
39+
}
40+
3341
& input.share-text {
3442
color: var(--primary-color);
3543
background-color: var(--text-secondary);

0 commit comments

Comments
 (0)