Skip to content

Commit

Permalink
Merge branch 'nextui-org:canary' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
awesome-pro authored Jul 23, 2024
2 parents 626e0e0 + df765bc commit 9ae43dd
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions apps/docs/components/marketing/a11y-otb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Link as NextUILink,
Dropdown,
DropdownSection,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Tooltip,
Expand All @@ -22,7 +21,7 @@ import {
} from "@nextui-org/shared-icons";
import Link from "next/link";
import dynamic from "next/dynamic";
import {useEffect, useRef, useState} from "react";
import {Fragment, useEffect, useRef, useState} from "react";

import {FeaturesGrid} from "./features-grid";

Expand Down Expand Up @@ -79,6 +78,8 @@ export const A11yOtb = () => {

const ref = useRef<any>(null);

const triggerRef = useRef<HTMLButtonElement>(null);

const isMobile = useIsMobile();

const isInView = useInView(ref, {
Expand Down Expand Up @@ -155,6 +156,15 @@ export const A11yOtb = () => {
<InfoBoldIcon className="rotate-180" />
</Button>
</Tooltip>
<Button
ref={triggerRef}
className="bg-success-50"
color="success"
variant="flat"
onPress={() => setIsDropdownOpen((prevOpenState) => !prevOpenState)}
>
{isMobile ? "Click me" : "Actions"}
</Button>
{ref.current && (
<Dropdown
className="shadow-xl"
Expand All @@ -164,13 +174,9 @@ export const A11yOtb = () => {
portalContainer={ref.current}
shouldBlockScroll={false}
shouldFlip={isMobile}
onOpenChange={(open) => setIsDropdownOpen(open)}
triggerRef={triggerRef}
>
<DropdownTrigger>
<Button className="bg-success-50" color="success" variant="flat">
{isMobile ? "Click me" : "Actions"}
</Button>
</DropdownTrigger>
<Fragment />
<DropdownMenu
aria-label="Actions"
closeOnSelect={true}
Expand Down

0 comments on commit 9ae43dd

Please sign in to comment.