mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
refactor(docs): use onPress event instead (#4353)
This commit is contained in:
parent
00fc0a0f85
commit
d9a55d0360
@ -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}>
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = () => (
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user