Skip to content

Commit

Permalink
chore: documentation adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Dec 1, 2024
1 parent 6bc616c commit e8bfdc8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ReactLiveDemo: React.FC<ReactLiveDemoProps> = ({
{files?.[DEFAULT_FILE] && (
<div className="absolute top-[-28px] right-[-8px]">
<CopyButton
className="opacity-0 group-hover/code-demo:opacity-100 transition-opacity text-zinc-400"
className="before:hidden opacity-0 group-hover/code-demo:opacity-100 transition-opacity text-zinc-400"
value={files?.[DEFAULT_FILE] as string}
/>
</div>
Expand Down
44 changes: 15 additions & 29 deletions apps/docs/components/docs/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import {getRoutePaths} from "./utils";

import {Route} from "@/libs/docs/page";
import {TreeKeyboardDelegate} from "@/utils/tree-keyboard-delegate";
import {FbFeedbackButton} from "@/components/featurebase/fb-feedback-button";
import {FbChangelogButton} from "@/components/featurebase/fb-changelog-button";
import {FbRoadmapLink} from "@/components/featurebase/fb-roadmap-link";
import {openFeedbackWidget} from "@/utils/featurebase";
import emitter from "@/libs/emitter";

export interface Props<T> extends Omit<ItemProps<T>, "title">, Route {
Expand Down Expand Up @@ -121,28 +117,11 @@ function TreeItem<T>(props: TreeItemProps<T>) {

const {focusProps, isFocused, isFocusVisible} = useFocusRing();

const renderFeaturebaseComponent = (key: string) => {
if (key === "roadmap")
return <FbRoadmapLink className={cn} innerClassName="opacity-80 dark:opacity-60" />;
if (key === "changelog")
return (
<NextUILink as={Link} className={cn} color="foreground" href="#">
<FbChangelogButton />
</NextUILink>
);

return (
<NextUILink as={Link} className={cn} color="foreground" href="#" onClick={openFeedbackWidget}>
<FbFeedbackButton />
</NextUILink>
);
};

const renderComponent = () => {
if (hasChildNodes) {
return (
<span className="flex items-center gap-3">
<span>{rendered}</span>
<span className="font-medium sm:text-sm">{rendered}</span>
<ChevronIcon
className={clsx("transition-transform", {
"-rotate-90": isExpanded,
Expand All @@ -152,14 +131,11 @@ function TreeItem<T>(props: TreeItemProps<T>) {
);
}

if (typeof key === "string" && ["changelog", "feedback", "roadmap"].includes(key)) {
return renderFeaturebaseComponent(key);
}

return (
<NextUILink as={Link} className={clsx(cn)} color="foreground" href={paths.pathname}>
<span
className={clsx(
"sm:text-sm",
isSelected
? "text-primary font-medium dark:text-foreground"
: "opacity-80 dark:opacity-60",
Expand All @@ -172,7 +148,7 @@ function TreeItem<T>(props: TreeItemProps<T>) {
</span>
{isUpdated && (
<Chip
className="ml-1 py-1 text-tiny text-default-500 dark:text-default-400 bg-default-100 dark:bg-default-100/50"
className="ml-1 py-1 font-medium text-tiny text-default-500 dark:text-default-400 bg-default-100 dark:bg-default-100/50"
color="default"
size="sm"
variant="flat"
Expand All @@ -181,12 +157,22 @@ function TreeItem<T>(props: TreeItemProps<T>) {
</Chip>
)}
{isNew && (
<Chip className="ml-1 py-1 text-tiny" color="primary" size="sm" variant="flat">
<Chip
className="font-medium ml-1 py-1 text-tiny"
color="primary"
size="sm"
variant="flat"
>
New
</Chip>
)}
{item.props?.comingSoon && (
<Chip className="ml-1 py-1 text-tiny" color="default" size="sm" variant="flat">
<Chip
className="font-medium ml-1 py-1 text-tiny"
color="secondary"
size="sm"
variant="flat"
>
Coming soon
</Chip>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/docs/toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const DocsToc: FC<DocsTocProps> = ({headings}) => {
}, transparent 100%)`,
}}
>
<p className="text-sm">On this page</p>
<p className="text-sm font-medium">On this page</p>
<ul className="scrollbar-hide flex flex-col gap-2">
{headings.map(
(heading, i) =>
Expand Down
47 changes: 0 additions & 47 deletions apps/docs/components/featurebase/fb-changelog-button.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions apps/docs/components/featurebase/fb-feedback-button.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions apps/docs/components/scripts/script-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import Script from "next/script";
export function ScriptProviders() {
return (
<>
<Script
id="featurebase-sdk"
src="https://do.featurebase.app/js/sdk.js"
strategy={"beforeInteractive"}
/>
<Script
defer
data-modal-disclaimer="This is a custom LLM for NextUI with access to all developer docs (nextui.org/docs) and GitHub Issues and PRs (github.com/nextui-org/nextui)."
Expand Down
7 changes: 7 additions & 0 deletions apps/docs/config/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@
"keywords": "tabs, section navigation, categorized content, tabbed interface",
"path": "/docs/components/tabs.mdx"
},
{
"key": "toast",
"title": "Toast",
"keywords": "toast, notification, message",
"path": "/docs/components/toast.mdx",
"comingSoon": true
},
{
"key": "textarea",
"title": "Textarea",
Expand Down
6 changes: 0 additions & 6 deletions apps/docs/utils/featurebase.ts

This file was deleted.

0 comments on commit e8bfdc8

Please sign in to comment.