|
| 1 | +import { Root, Trigger, Portal, Overlay, Content, Label, Description } from '@corvu/dialog'; |
| 2 | +import { Dialog } from './dialog.service'; |
| 3 | +import { createEffect, createSignal, Show, type Component } from 'solid-js'; |
| 4 | +import { Dynamic } from 'solid-js/web'; |
| 5 | +import { DialogComponent, DialogOptions } from './dialog.types'; |
| 6 | +import { ConfirmDialog } from '@spuxx/solid'; |
| 7 | + |
| 8 | +export const DialogContainer: Component = () => { |
| 9 | + // const [component, setComponent] = createSignal<Component | null>(null); |
| 10 | + const [props, setProps] = createSignal<DialogOptions | undefined>(undefined); |
| 11 | + |
| 12 | + createEffect(() => { |
| 13 | + // setComponent(Dialog.currentDialog); |
| 14 | + console.log(Dialog.currentDialog); |
| 15 | + console.log(Dialog.currentOptions); |
| 16 | + }); |
| 17 | + |
| 18 | + console.log(Dialog.currentDialog); |
| 19 | + |
| 20 | + // return ( |
| 21 | + // <> |
| 22 | + // {typeof DialogService.currentDialog === 'function' ? 'function' : 'not a function'} |
| 23 | + // <br /> |
| 24 | + // {JSON.stringify(DialogService.currentOptions) ?? 'undefined'} |
| 25 | + // </> |
| 26 | + // ); |
| 27 | + // if (typeof DialogService.currentDialog !== 'function') return null; |
| 28 | + return ( |
| 29 | + // <Show when={typeof Dialog.currentDialog === 'function'}> |
| 30 | + <Root open={typeof Dialog.currentDialog === 'function'}> |
| 31 | + {/* <Trigger>Open Dialog</Trigger> */} |
| 32 | + <Portal> |
| 33 | + {/* <Overlay /> */} |
| 34 | + <Content> |
| 35 | + <Label>foo</Label> |
| 36 | + <Description>awdawd</Description> |
| 37 | + {/* <Dynamic component={DialogService.currentDialog!} {...DialogService.currentOptions} /> */} |
| 38 | + </Content> |
| 39 | + </Portal> |
| 40 | + </Root> |
| 41 | + // </Show> |
| 42 | + ); |
| 43 | + // <Dynamic component={DialogService.currentDialog} {...DialogService.currentOptions} /> |
| 44 | + // <Dynamic component={DialogService.currentDialog} {...DialogService.currentOptions} /> |
| 45 | + // <Dialog> |
| 46 | + // <Dialog.Portal> |
| 47 | + // <Dialog.Overlay /> |
| 48 | + // <Dialog.Content> |
| 49 | + // yolo |
| 50 | + // <Dynamic component={DialogService.currentDialog} {...DialogService.currentOptions} /> |
| 51 | + // </Dialog.Content> |
| 52 | + // </Dialog.Portal> |
| 53 | + // </Dialog> |
| 54 | +}; |
0 commit comments