Skip to content

Commit

Permalink
Docs(web-react): Add the missing demo of DropdownModern with enhanc…
Browse files Browse the repository at this point in the history
…ed shadow
  • Loading branch information
adamkudrna committed Nov 14, 2023
1 parent deb054c commit 4430fbb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import DropdownModern from '../../Dropdown/DropdownModern';
import DropdownTrigger from '../../Dropdown/DropdownTrigger';
import DropdownPopover from '../../Dropdown/DropdownPopover';
import { Button } from '../../Button';
import { dropdownContent } from './constants';
import DropdownContentFactory from './DropdownContentFactory';

const DropdownModernEnhancedShadow = () => {
const [isOpen, setIsOpen] = React.useState(false);
const onToggle = () => setIsOpen(!isOpen);

return (
<div className="spirit-feature-dropdown-enable-enhanced-shadow">
<DropdownModern id="DropdownModernEnhancedShadow" isOpen={isOpen} onToggle={onToggle} placement="top-left">
<DropdownTrigger elementType={Button}>Finibus quis imperdiet, semper imperdiet aliquam</DropdownTrigger>
<DropdownPopover>
<DropdownContentFactory content={dropdownContent} />
</DropdownPopover>
</DropdownModern>
</div>
);
};

export default DropdownModernEnhancedShadow;
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<DocsSection title="Full-width mode 'mobile-only'">
<DropdownModernFullwidthMobileOnly />
</DocsSection>
<DocsSection title="Feature Flag: Enhanced Shadow">
<DropdownModernEnhancedShadow />
</DocsSection>
</IconsProvider>
</React.StrictMode>,
);

0 comments on commit 4430fbb

Please sign in to comment.