这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 0 additions & 101 deletions docs/site/components/local-storage-hook.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions docs/site/components/root-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { RootProvider as FumaRootProvider } from "fumadocs-ui/provider";
import type { ReactNode } from "react";
import { SearchDialog } from "@/components/search-dialog";
import { LocalStorageProvider } from "./local-storage-hook";
import { TopLevelMobileMenuProvider } from "./docs-layout/use-mobile-menu-context";

export function RootProvider({
Expand All @@ -13,11 +12,7 @@ export function RootProvider({
}): JSX.Element {
return (
<TopLevelMobileMenuProvider>
<LocalStorageProvider>
<FumaRootProvider search={{ SearchDialog }}>
{children}
</FumaRootProvider>
</LocalStorageProvider>
<FumaRootProvider search={{ SearchDialog }}>{children}</FumaRootProvider>
</TopLevelMobileMenuProvider>
);
}
19 changes: 12 additions & 7 deletions docs/site/components/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ const checkPackageManagerIndex = (index: number, provided: string) => {
}
};

/** Use <Tab /> component to create the tabs. They will automatically be assigned their values in the order ["npm", "yarn", "pnpm"]. */
/** Use <Tab /> component to create the tabs. */
export function PackageManagerTabs({
storageKey = "package-manager-tabs",
children,
...props
}: {
storageKey?: string;
children: ReactNode;
}): JSX.Element {
if (!Array.isArray(children)) {
Expand All @@ -54,12 +52,20 @@ export function PackageManagerTabs({
});

return (
<FumaTabs id={storageKey} items={packageManagers} {...props}>
<FumaTabs
groupId="package-manager"
items={packageManagers}
persist
{...props}
>
{children.map((child, index) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment
return {
...child,
props: { ...child.props, value: packageManagers[index] },
props: {
...child.props,
value: packageManagers[index],
},
};
})}
</FumaTabs>
Expand All @@ -68,7 +74,6 @@ export function PackageManagerTabs({

/** Use <Tab /> component to create the tabs. They will automatically be assigned their values in the order ["UNIX", "Windows"]. */
export function PlatformTabs({
storageKey = "platform-tabs",
children,
...props
}: {
Expand All @@ -82,7 +87,7 @@ export function PlatformTabs({
}

return (
<FumaTabs id={storageKey} items={items} {...props}>
<FumaTabs groupId="platform-tabs" items={items} persist {...props}>
{Children.map(children, (child, index) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
cloneElement(child, { ...child.props, value: items[index] })
Expand Down
Loading