Skip to content

Commit

Permalink
delete modal in the sample
Browse files Browse the repository at this point in the history
Refs: #6899
  • Loading branch information
anicyne committed Jan 20, 2025
1 parent d008302 commit cd2d52a
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions packages/samples/react/src/components/drawer/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@ export const DrawerBasic: FC = () => {
const defaultAlign = searchParams.get('align') as AlignPropType;
const hideMenus = useContext(HideMenusContext);
const drawerElement = useRef<HTMLKolDrawerElement>(null);
const drawerModalElement = useRef<HTMLKolDrawerElement>(null);
const [align, setAlign] = useState<AlignPropType>(defaultAlign || 'left');
useEffect(() => {
if (defaultAlign) {
drawerModalElement.current?.open();
}
}, [defaultAlign]);
useEffect(() => {}, [defaultAlign]);
return (
<>
{!hideMenus && <KolBadge className="block mb-3" _label="Component is a DRAFT - Don't use in production yet." _color="#db5461" />}
<SampleDescription>
<p>
KolDrawer shows a dialog attached to one of the sides of the viewport, when opened. This sample illustrates the four alignments and the modal- and
non-modal modes.
</p>
<p>KolDrawer shows a dialog attached to one of the sides of the viewport, when opened. This sample illustrates the four alignments.</p>
</SampleDescription>

<DrawerRadioAlign value={align} onChange={(_, value) => setAlign(value as AlignPropType)} />
Expand All @@ -41,14 +33,6 @@ export const DrawerBasic: FC = () => {
<KolButton _label="Close drawer" _on={{ onClick: () => drawerElement.current?.close() }} />
</KolDrawer>
<KolButton _label="Open drawer" _on={{ onClick: () => drawerElement.current?.open() }} />
<KolDrawer ref={drawerModalElement} _align={align} _label="I am a Drawer Modal" _on={{ onClose: () => console.log('Drawer Modal onClose triggered!') }}>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</p>
<KolButton _label="Close drawer modal" _on={{ onClick: () => drawerModalElement.current?.close() }} />
</KolDrawer>
<KolButton _label="Open drawer as modal" _on={{ onClick: () => drawerModalElement.current?.open() }} />
</div>
</>
);
Expand Down

0 comments on commit cd2d52a

Please sign in to comment.