Skip to content

Commit

Permalink
UI: Fix sidebar footer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Nov 12, 2024
1 parent 5fd4e2f commit 5145123
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-donkeys-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---

Fix sidebar footer issues
19 changes: 15 additions & 4 deletions packages/ui/src/layouts/docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,24 @@ function SidebarHeaderItems({

function SidebarFooterItems({
iconItems,
...props
i18n,
sidebarCollapsible,
disableThemeSwitch,
}: {
i18n: boolean;
iconItems: IconItemType[];
disableThemeSwitch: boolean;
sidebarCollapsible: boolean;
}) {
// empty footer items
if (
iconItems.length === 0 &&
!i18n &&
disableThemeSwitch &&
!sidebarCollapsible
)
return null;

return (
<div className="flex flex-row items-center">
{iconItems.map((item, i) => (
Expand All @@ -216,16 +227,16 @@ function SidebarFooterItems({
</BaseLinkItem>
))}
<div role="separator" className="flex-1" />
{props.i18n ? (
{i18n ? (
<LanguageToggle className="me-1.5">
<Languages className="size-5" />
<LanguageToggleText className="md:hidden" />
</LanguageToggle>
) : null}
{!props.disableThemeSwitch ? (
{!disableThemeSwitch ? (
<ThemeToggle className="p-0 md:order-first" />
) : null}
{props.sidebarCollapsible ? (
{sidebarCollapsible ? (
<SidebarCollapseTrigger className="-me-1.5 max-md:hidden" />
) : null}
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/theme/typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const tableStyles = {
border: '0',
},
th: {
'@apply p-2.5 border-l bg-muted': '',
'@apply p-2.5 border-l bg-fd-muted': '',
},
'th:first-of-type': {
'@apply border-l-0': '',
Expand Down

0 comments on commit 5145123

Please sign in to comment.