Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nextui-org/nextui into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Jul 22, 2024
2 parents e9eb949 + 8b7df92 commit df765bc
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 df765bc

Please sign in to comment.