added settings
This commit is contained in:
parent
b4f7a863a2
commit
71b9a60b35
15 changed files with 359 additions and 91 deletions
26
src/material/BottomSheet.tsx
Normal file
26
src/material/BottomSheet.tsx
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { createEffect, type ParentComponent } from "solid-js";
|
||||
import styles from './BottomSheet.module.css'
|
||||
|
||||
export type BottomSheetProps = {
|
||||
open?: boolean;
|
||||
};
|
||||
|
||||
const BottomSheet: ParentComponent<BottomSheetProps> = (props) => {
|
||||
let element: HTMLDialogElement;
|
||||
|
||||
createEffect(() => {
|
||||
if (props.open) {
|
||||
if (!element.open) {
|
||||
element.showModal();
|
||||
}
|
||||
} else {
|
||||
if (element.open) {
|
||||
element.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return <dialog class={styles.bottomSheet} ref={element!}>{props.children}</dialog>;
|
||||
};
|
||||
|
||||
export default BottomSheet;
|
Loading…
Add table
Add a link
Reference in a new issue