mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 10:14:13 +02:00
add all modals to menu
This commit is contained in:
parent
d699095369
commit
97a6b46879
5 changed files with 32 additions and 8 deletions
|
|
@ -1,12 +1,15 @@
|
|||
import {ModalState} from "./Analyser";
|
||||
import {Show} from "solid-js";
|
||||
|
||||
export interface AnalyseMenuProps {
|
||||
sessionName: string;
|
||||
onShare: Function;
|
||||
canShare: boolean;
|
||||
isShared: boolean;
|
||||
clients: number,
|
||||
inShared: boolean,
|
||||
open: boolean,
|
||||
openHelp: Function;
|
||||
clients: number;
|
||||
inShared: boolean;
|
||||
open: boolean;
|
||||
openModal: (ModalState) => void;
|
||||
}
|
||||
|
||||
export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||
|
|
@ -23,7 +26,7 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
|||
<summary title="Menu">☰</summary>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<button class="share-session" title="Start a shared session" disabled={props.isShared}
|
||||
<button className="share-session" title="Start a shared session" disabled={props.isShared}
|
||||
onClick={() => {
|
||||
props.onShare()
|
||||
}}>
|
||||
|
|
@ -41,10 +44,21 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
|||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="help" title="Help" onClick={() => props.openHelp()}>
|
||||
<button className="help" title="Help" onClick={() => props.openModal(ModalState.Help)}>
|
||||
Help
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button className="goto" title="Goto Tick" onClick={() => props.openModal(ModalState.Goto)}>
|
||||
Goto Tick
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button className="search" title="Search Events"
|
||||
onClick={() => props.openModal(ModalState.Search)}>
|
||||
Search Events
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</Show>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {DemoHead} from "../../header";
|
|||
import {EventSearch} from "./EventSearch";
|
||||
import {Event} from "./Data/Parser";
|
||||
|
||||
enum ModalState {
|
||||
export enum ModalState {
|
||||
Closed,
|
||||
Help,
|
||||
Goto,
|
||||
|
|
@ -254,7 +254,7 @@ export const Analyser = (props: AnalyseProps) => {
|
|||
}, onUpdate);
|
||||
setSessionName(session.sessionName);
|
||||
}}
|
||||
openHelp={() => setHelpOpen(true)}
|
||||
openModal={setModalState}
|
||||
canShare={props.isStored && !inShared}
|
||||
isShared={isShared()}
|
||||
clients={clients()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue