added settings

This commit is contained in:
thislight 2024-07-22 21:57:04 +08:00
parent b4f7a863a2
commit 71b9a60b35
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
15 changed files with 359 additions and 91 deletions

View 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;