fix doc: Fixed some errors in the Listbox Component documentation. (#1665)

* fix doc: export IconWrapper and ItemCounter

* fix doc: fix WatcherIcons -> WatcherIcon at everywhere
This commit is contained in:
cosine 2023-09-22 21:57:25 +08:00 committed by GitHub
parent 9f4bdf352d
commit 5a9b78d234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -72,7 +72,7 @@ const UsersIcon = `export const UsersIcon = (props) => (
</svg>
);`;
const WatchersIcon = `export const WatchersIcons = (props) => (
const WatchersIcon = `export const WatchersIcon = (props) => (
<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="m21.977 13.783-2-9A1.002 1.002 0 0 0 19 4h-3v2h2.198l.961 4.326A4.467 4.467 0 0 0 17.5 10c-1.953 0-3.603 1.258-4.224 3h-2.553c-.621-1.742-2.271-3-4.224-3-.587 0-1.145.121-1.659.326L5.802 6H8V4H5a1 1 0 0 0-.976.783l-2 9 .047.011A4.552 4.552 0 0 0 2 14.5C2 16.981 4.019 19 6.5 19c2.31 0 4.197-1.756 4.449-4h2.102c.252 2.244 2.139 4 4.449 4 2.481 0 4.5-2.019 4.5-4.5 0-.242-.034-.475-.071-.706l.048-.011zM6.5 17C5.122 17 4 15.878 4 14.5S5.122 12 6.5 12 9 13.122 9 14.5 7.878 17 6.5 17zm11 0c-1.379 0-2.5-1.122-2.5-2.5s1.121-2.5 2.5-2.5 2.5 1.122 2.5 2.5-1.121 2.5-2.5 2.5z"
@ -112,13 +112,13 @@ const ChevronRightIcon = `export const ChevronRightIcon = (props) => (
const IconWrapper = `import {cn} from "@nextui-org/react";
const IconWrapper = ({children, className}) => (
export const IconWrapper = ({children, className}) => (
<div className={cn(className, "flex items-center rounded-small justify-center w-7 h-7")}>
{children}
</div>
);`;
const ItemCounter = `const ItemCounter = ({number}) => (
const ItemCounter = `export const ItemCounter = ({number}) => (
<div className="flex items-center gap-1 text-default-400">
<span className="text-small">{number}</span>
<ChevronRightIcon className="text-xl" />
@ -242,7 +242,7 @@ export default function App() {
endContent={<ItemCounter number={82} />}
startContent={
<IconWrapper className="bg-default/50 text-foreground">
<WatchersIcons />
<WatchersIcon />
</IconWrapper>
}
>
@ -274,7 +274,7 @@ const react = {
"/LayoutIcon.jsx": LayoutIcon,
"/TagIcon.jsx": TagIcon,
"/UsersIcon.jsx": UsersIcon,
"/WatchersIcons.jsx": WatchersIcon,
"/WatchersIcon.jsx": WatchersIcon,
"/BookIcon.jsx": BookIcon,
"/ChevronRightIcon.jsx": ChevronRightIcon,
};

View File

@ -85,7 +85,7 @@ const UsersIcon = (props) => (
</svg>
);
const WatchersIcons = (props) => (
const WatchersIcon = (props) => (
<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="m21.977 13.783-2-9A1.002 1.002 0 0 0 19 4h-3v2h2.198l.961 4.326A4.467 4.467 0 0 0 17.5 10c-1.953 0-3.603 1.258-4.224 3h-2.553c-.621-1.742-2.271-3-4.224-3-.587 0-1.145.121-1.659.326L5.802 6H8V4H5a1 1 0 0 0-.976.783l-2 9 .047.011A4.552 4.552 0 0 0 2 14.5C2 16.981 4.019 19 6.5 19c2.31 0 4.197-1.756 4.449-4h2.102c.252 2.244 2.139 4 4.449 4 2.481 0 4.5-2.019 4.5-4.5 0-.242-.034-.475-.071-.706l.048-.011zM6.5 17C5.122 17 4 15.878 4 14.5S5.122 12 6.5 12 9 13.122 9 14.5 7.878 17 6.5 17zm11 0c-1.379 0-2.5-1.122-2.5-2.5s1.121-2.5 2.5-2.5 2.5 1.122 2.5 2.5-1.121 2.5-2.5 2.5z"
@ -499,7 +499,7 @@ const CustomWithClassNamesTemplate = ({color, variant, disableAnimation, ...args
endContent={<ItemCounter number={82} />}
startContent={
<IconWrapper className="bg-default/50 text-foreground">
<WatchersIcons />
<WatchersIcon/>
</IconWrapper>
}
>