UI: Fix sidebar footer issues

This commit is contained in:
Fuma Nama
2024-11-12 21:00:29 +08:00
parent 5fd4e2fa80
commit 51451236a5
3 changed files with 21 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---
Fix sidebar footer issues
+15 -4
View File
@@ -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) => (
@@ -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>
+1 -1
View File
@@ -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': '',