Skip to content

Commit b707849

Browse files
author
abrulic
committed
small UI fixes in sidebar
1 parent e102d8b commit b707849

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

app/components/sidebar/desktop-sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SidebarContent } from "./sidebar-content"
55
export const DesktopSidebarPanel = ({ sidebarTree, className }: { sidebarTree: SidebarTree; className: string }) => (
66
<div
77
className={cn(
8-
"sticky top-[var(--header-height)] flex h-[calc(100vh-var(--header-height))] w-80 flex-col overflow-hidden bg-[var(--color-background)] p-4",
8+
"sticky top-[var(--header-height)] flex h-[calc(100vh-var(--header-height))] w-72 flex-col overflow-hidden bg-[var(--color-background)] px-3 py-3",
99
className
1010
)}
1111
>

app/components/sidebar/mobile-sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const MobileSidebarCloseButton = () => {
6464
<button
6565
type="button"
6666
onClick={close}
67-
className="absolute top-2 right-4 z-10 rounded-full p-2 text-[var(--color-text-normal)] transition-colors duration-200 hover:text-[var(--color-text-hover)]"
67+
className="absolute top-2 right-3 z-10 rounded-full p-2 text-[var(--color-text-normal)] transition-colors duration-200 hover:text-[var(--color-text-hover)]"
6868
aria-label="Close navigation menu"
6969
>
7070
<Icon name="X" className="size-5" />
@@ -83,7 +83,7 @@ export const MobileSidebarPanel = ({
8383
return (
8484
<div
8585
className={cn(
86-
"scrollbar fixed left-0 z-50 flex h-[calc(100vh-var(--header-height))] w-80 flex-col overflow-hidden bg-[var(--color-background)] p-4 transition-transform duration-500 ease-in-out",
86+
"scrollbar fixed left-0 z-50 flex h-[calc(100vh-var(--header-height))] w-72 flex-col overflow-hidden bg-[var(--color-background)] px-3 py-3 transition-transform duration-500 ease-in-out",
8787
isOpen ? "translate-x-0" : "-translate-x-full",
8888
className
8989
)}

app/components/sidebar/sidebar-items.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { useCurrentVersion } from "~/utils/version-resolvers"
55
import type { SidebarSection } from "./sidebar"
66

77
const getIndentClass = (depth: number) => {
8-
const indentMap = { 0: "ml-0", 1: "ml-4", 2: "ml-8" }
9-
return indentMap[depth as keyof typeof indentMap] || "ml-8"
8+
const indentMap = { 0: "ml-4", 1: "ml-7", 2: "ml-10" }
9+
return indentMap[depth as keyof typeof indentMap] || "ml-10"
1010
}
1111

1212
type DocumentationNavLinkProps = {
@@ -24,7 +24,7 @@ export function DocumentationNavLink({ title, to, depth = 0, onClick }: Document
2424
to={to}
2525
onClick={onClick}
2626
className={({ isActive, isPending }) =>
27-
`block rounded-md px-3 py-2 text-sm md:text-base ${indentClass}
27+
`block rounded-md px-3 py-1 text-sm md:text-base ${indentClass}
2828
${isPending ? "text-[var(--color-text-hover)]" : ""}
2929
${
3030
isActive
@@ -46,7 +46,7 @@ interface SectionItemProps {
4646

4747
const SectionTitle = ({ title }: { title: string }) => {
4848
return (
49-
<h3 className="mb-3 px-3 font-semibold text-[var(--color-text-active)] text-base tracking-wide md:text-lg">
49+
<h3 className="mb-3 ml-4 px-3 font-semibold text-[var(--color-text-active)] text-sm uppercase tracking-wide md:text-base">
5050
{title}
5151
</h3>
5252
)
@@ -85,7 +85,7 @@ export const SectionItem = ({ item, depth = 0, onItemClick }: SectionItemProps)
8585
return (
8686
<AccordionItem
8787
title={item.title}
88-
titleElement="h4"
88+
titleElement="h5"
8989
titleClassName=" font-semibold tracking-wide text-[var(--color-text-active)]"
9090
content={content}
9191
defaultOpen={true}

app/ui/alert.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ export const Alert = ({ children, title, variant, className = "" }: AlertProps)
5353
const defaultTitle = variant === "info" ? t("titles.good_to_know") : t("titles.warning")
5454

5555
return (
56-
<div className={cn("my-6 flex flex-col gap-2 rounded-xl border p-4 md:p-6", styles.container, className)}>
56+
<div
57+
className={cn(
58+
"scrollbar scrollbar-thin my-6 flex flex-col gap-2 overflow-x-auto rounded-xl border p-4 md:p-6",
59+
styles.container,
60+
className
61+
)}
62+
>
5763
<div className="inline-flex items-center gap-2">
5864
<div className={cn("inline-flex", styles.icon)}>{getIcon()}</div>
5965
<p className={cn("mt-0 mb-0 font-semibold text-sm leading-6 sm:text-base md:text-lg", styles.title)}>

0 commit comments

Comments
 (0)