Skip to content

Commit

Permalink
feat: tertiary sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Jul 28, 2022
1 parent ec43c18 commit a38c58d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
10 changes: 5 additions & 5 deletions packages/website/src/components/DocContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export interface DocContainerProps {

export function DocContainer({ name, kind, excerpt, summary, typeParams, children, extendsTokens }: DocContainerProps) {
return (
<>
<div className="bg-white dark:bg-dark border-b-solid border-gray border-0.5 border-width-0.5 sticky top-0 px-10 py-2">
<div className="flex flex-col min-h-full max-h-full grow">
<div className="border-0.5 border-gray px-10 py-2">
<h2 className="flex gap-2 items-center break-all m-0 dark:text-white">
{generateIcon(kind)}
{name}
</h2>
</div>

<div className="px-10 pt-5 pb-10">
<div className="min-h-full overflow-y-auto overflow-x-clip px-10 pt-5 pb-10">
<SyntaxHighlighter
wrapLines
wrapLongLines
Expand All @@ -50,7 +50,7 @@ export function DocContainer({ name, kind, excerpt, summary, typeParams, childre
) : null}
<div className="space-y-10">
<Section iconElement={<VscListSelection />} title="Summary" className="dark:text-white">
<p className="text-dark-100 dark:text-gray-300 m-0">{summary ?? 'No summary provided.'}</p>
<p className="text-dark-100 dark:text-gray-300">{summary ?? 'No summary provided.'}</p>
</Section>
{typeParams?.length ? (
<Section
Expand All @@ -65,6 +65,6 @@ export function DocContainer({ name, kind, excerpt, summary, typeParams, childre
<div className="space-y-10">{children}</div>
</div>
</div>
</>
</div>
);
}
2 changes: 1 addition & 1 deletion packages/website/src/components/ItemSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function ItemSidebar({ packageName, data, selectedMember }: ItemListProps
<FiMenu size={32} />
</button>
</div>
<div className="hidden lg:block lg:min-h-full overflow-y-auto overflow-x-clip py-7 px-4">
<div className="hidden lg:block lg:min-h-full overflow-y-auto overflow-x-clip py-3 px-4">
<ListSidebar members={data.members} title="test" selectedMember={selectedMember} />
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion packages/website/src/components/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function Section({
{collapsed ? null : (
<>
<motion.div
className="ml-7 mb-5"
transition={{ duration: 0.5, ease: [0.04, 0.62, 0.23, 0.98] }}
key="content"
initial="collapsed"
Expand Down
9 changes: 7 additions & 2 deletions packages/website/src/components/SidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ export function SidebarLayout({
}: PropsWithChildren<Partial<ItemListProps & { data: { member: ReturnType<typeof findMember> } }>>) {
return (
<div className="flex flex-col lg:flex-row overflow-hidden max-w-full h-full max-h-full bg-white dark:bg-dark">
<div className="h-full w-full lg:max-w-[370px] lg:min-w-[370px]">
<div className="h-full w-full lg:max-w-[310px] lg:min-w-[310px]">
{packageName && data ? (
<ItemSidebar packageName={packageName} data={data} selectedMember={data.member?.name} />
) : null}
</div>
<div className="max-h-full grow overflow-x-hidden overflow-y-auto">{children}</div>
<div className="h-full grow">{children}</div>
<div className="h-full w-full lg:max-w-[310px] lg:min-w-[310px]">
{packageName && data?.member ? (
<ItemSidebar packageName={packageName} data={data} selectedMember={data.member.name} />
) : null}
</div>
</div>
);
}

1 comment on commit a38c58d

@vercel
Copy link

@vercel vercel bot commented on a38c58d Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.