refactor(docs): use onPress event instead (#4353)

This commit is contained in:
աӄա 2024-12-17 22:17:11 +08:00 committed by GitHub
parent 00fc0a0f85
commit d9a55d0360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 18 additions and 96 deletions

View File

@ -58,7 +58,7 @@ export default function Page() {
</p>
</ModalBody>
<ModalFooter>
<Button color="danger" variant="light" onClick={onClose}>
<Button color="danger" variant="light" onPress={onClose}>
Close
</Button>
<Button color="primary" onPress={onClose}>

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -9,13 +9,10 @@ import {
NavbarMenuItem,
NavbarMenuToggle,
Button,
Link as NextUiLink,
LinkProps,
Link,
} from "@nextui-org/react";
import React from "react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">
<path

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -6,16 +6,13 @@ import {
NavbarContent,
NavbarItem,
Button,
Link as NextUiLink,
LinkProps,
Link,
NavbarMenu,
NavbarMenuItem,
NavbarMenuToggle,
} from "@nextui-org/react";
import React from "react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">
<path

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -1,16 +1,6 @@
"use client";
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Button,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {Navbar, NavbarBrand, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">

View File

@ -5,8 +5,7 @@ import {
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Link,
DropdownItem,
DropdownTrigger,
Dropdown,
@ -14,8 +13,6 @@ import {
Avatar,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">
<path

View File

@ -5,8 +5,7 @@ import {
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Link,
Button,
DropdownItem,
DropdownTrigger,
@ -15,8 +14,6 @@ import {
} from "@nextui-org/react";
import {ChevronDown, Lock, Activity, Flash, Server, TagUser, Scale} from "@nextui-org/shared-icons";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">
<path

View File

@ -5,8 +5,7 @@ import {
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Link,
Button,
NavbarMenuToggle,
NavbarMenu,
@ -14,8 +13,6 @@ import {
} from "@nextui-org/react";
import React from "react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
const AcmeLogo = () => (
<svg fill="none" height="36" viewBox="0 0 32 32" width="36">
<path

View File

@ -5,8 +5,7 @@ import {
NavbarBrand,
NavbarContent,
NavbarItem,
Link as NextUiLink,
LinkProps,
Link,
Input,
DropdownItem,
DropdownTrigger,
@ -15,8 +14,6 @@ import {
Avatar,
} from "@nextui-org/react";
const Link = (props: LinkProps) => <NextUiLink {...props} onClick={(e) => e.preventDefault()} />;
import {SearchLinearIcon} from "@/components/icons";
const AcmeLogo = () => (

View File

@ -72,7 +72,7 @@ export const InstallBanner = () => {
href="/docs/guide/installation"
radius="full"
size="md"
onClick={() => {
onPress={() => {
posthog.capture("InstallBanner - Get Started", {
action: "press",
category: "landing-page",
@ -91,7 +91,7 @@ export const InstallBanner = () => {
size="md"
startContent={<GithubIcon />}
variant="bordered"
onClick={() => {
onPress={() => {
posthog.capture("InstallBanner - Github", {
action: "press",
category: "landing-page",

View File

@ -17,7 +17,7 @@ export const SponsorItem = ({name, href, logo}: Sponsor) => {
isExternal
className="flex flex-col items-center justify-center"
href={href}
onClick={() => {
onPress={() => {
posthog.capture("Hero - Sponsors", {
name,
action: "click",

View File

@ -198,7 +198,7 @@ const Link = ({href, children}: {href?: string; children?: React.ReactNode}) =>
disableAnimation={true}
href={href}
{...externalProps}
onClick={handleClick}
onPress={handleClick}
>
{children}
</Components.Link>

View File

@ -23,7 +23,7 @@ export const CopyButton = ({code: codeProp}: {code?: string}) => {
content={copied ? "Copied!" : "Copy"}
radius="md"
>
<Button isIconOnly size="sm" title="Copy Code" variant="light" onClick={copyHandler}>
<Button isIconOnly size="sm" title="Copy Code" variant="light" onPress={copyHandler}>
<CopyLinearIcon className="text-white dark:text-zinc-500" height={16} width={16} />
</Button>
</Tooltip>