mirror of
https://github.com/zadam/trilium.git
synced 2026-02-11 08:14:39 +01:00
chore(mobile/tab_switcher): create empty modal
This commit is contained in:
parent
a45fb975c0
commit
3a9b448a83
6
apps/client/src/widgets/mobile_widgets/TabSwitcher.css
Normal file
6
apps/client/src/widgets/mobile_widgets/TabSwitcher.css
Normal file
@ -0,0 +1,6 @@
|
||||
.modal.tab-bar-modal {
|
||||
.modal-dialog {
|
||||
max-height: unset;
|
||||
height: 95vh;
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,40 @@
|
||||
import "./TabSwitcher.css";
|
||||
|
||||
import { createPortal } from "preact/compat";
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
import { LaunchBarActionButton } from "../launch_bar/launch_bar_widgets";
|
||||
import Modal from "../react/Modal";
|
||||
|
||||
export default function TabSwitcher() {
|
||||
const [ shown, setShown ] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<LaunchBarActionButton
|
||||
icon="bx bx-rectangle"
|
||||
text="Tabs"
|
||||
onClick={() => {
|
||||
|
||||
}}
|
||||
onClick={() => setShown(true)}
|
||||
/>
|
||||
{createPortal(<TabBarModal shown={shown} setShown={setShown} />, document.body)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function TabBarModal({ shown, setShown }: {
|
||||
shown: boolean;
|
||||
setShown: (newValue: boolean) => void;
|
||||
}) {
|
||||
return (
|
||||
<Modal
|
||||
className="tab-bar-modal"
|
||||
size="xl"
|
||||
title="Tabs"
|
||||
show={shown}
|
||||
onHidden={() => setShown(false)}
|
||||
>
|
||||
Hi
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user