Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Center collapsed navigation items and standardize sidebar row heights

Mike Cao668a03f2108c
diff --git a/src/app/(main)/SideNav.tsx b/src/app/(main)/SideNav.tsx
index c0ca1297b..a16970875 100644
--- a/src/app/(main)/SideNav.tsx
+++ b/src/app/(main)/SideNav.tsx
@@ -86,10 +86,15 @@ export function SideNav(props: any) {
<Row
alignItems="center"
justifyContent="space-between"
- minHeight="40px"
+ minHeight="9"
style={{ flexShrink: 0 }}
>
- <Row padding="3" alignItems="center" justifyContent="space-between" flexGrow="1">
+ <Row
+ padding="3"
+ alignItems="center"
+ justifyContent={isCollapsed ? 'center' : 'space-between'}
+ flexGrow="1"
+ >
{!isCollapsed && (
<IconLabel icon={<Logo />}>
<Text weight="bold">umami</Text>
@@ -113,10 +118,11 @@ export function SideNav(props: any) {
<Row
tabIndex={0}
alignItems="center"
+ justifyContent={isCollapsed ? 'center' : undefined}
hover={{ backgroundColor: 'surface-sunken' }}
backgroundColor={isSelected ? 'surface-sunken' : undefined}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel
icon={icon}
@@ -142,7 +148,12 @@ export function SideNav(props: any) {
</Column>
)}
</Column>
- <Row paddingTop="2" width="100%" style={{ flexShrink: 0 }}>
+ <Row
+ paddingTop="2"
+ width="100%"
+ justifyContent={isCollapsed ? 'center' : undefined}
+ style={{ flexShrink: 0 }}
+ >
<UserButton showText={!isCollapsed} />
</Row>
</Column>
diff --git a/src/app/(main)/admin/AdminNav.tsx b/src/app/(main)/admin/AdminNav.tsx
index d03391021..942e40f02 100644
--- a/src/app/(main)/admin/AdminNav.tsx
+++ b/src/app/(main)/admin/AdminNav.tsx
@@ -54,7 +54,7 @@ export function AdminNav({ onItemClick }: { onItemClick?: () => void }) {
alignItems="center"
hover={{ backgroundColor: 'surface-sunken' }}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel icon={<ArrowLeft />} label={t(labels.back)} padding />
</Row>
diff --git a/src/app/(main)/settings/SettingsNav.tsx b/src/app/(main)/settings/SettingsNav.tsx
index 3dd2d384e..115f75bbf 100644
--- a/src/app/(main)/settings/SettingsNav.tsx
+++ b/src/app/(main)/settings/SettingsNav.tsx
@@ -63,9 +63,10 @@ export function SettingsNav({
<Row
tabIndex={0}
alignItems="center"
+ justifyContent={isCollapsed ? 'center' : undefined}
hover={{ backgroundColor: 'surface-sunken' }}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel icon={<ArrowLeft />} label={isCollapsed ? '' : t(labels.back)} padding />
</Row>
@@ -94,10 +95,11 @@ export function SettingsNav({
<Row
tabIndex={0}
alignItems="center"
+ justifyContent={isCollapsed ? 'center' : undefined}
hover={{ backgroundColor: 'surface-sunken' }}
backgroundColor={isSelected ? 'surface-sunken' : undefined}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel
icon={icon}
diff --git a/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx b/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx
index bc12d74b1..bcb3b9d6f 100644
--- a/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx
+++ b/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx
@@ -25,9 +25,10 @@ export function WebsiteNav({
<Row
tabIndex={0}
alignItems="center"
+ justifyContent="center"
hover={{ backgroundColor: 'surface-sunken' }}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel icon={<ArrowLeft />} label="" padding />
</Row>
@@ -38,7 +39,7 @@ export function WebsiteNav({
alignItems="center"
hover={{ backgroundColor: 'surface-sunken' }}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel icon={<ArrowLeft />} label={t(labels.back)} padding />
</Row>
@@ -60,10 +61,11 @@ export function WebsiteNav({
<Row
tabIndex={0}
alignItems="center"
+ justifyContent="center"
hover={{ backgroundColor: 'surface-sunken' }}
backgroundColor={isSelected ? 'surface-sunken' : undefined}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel
icon={icon}
@@ -80,7 +82,7 @@ export function WebsiteNav({
hover={{ backgroundColor: 'surface-sunken' }}
backgroundColor={isSelected ? 'surface-sunken' : undefined}
borderRadius
- minHeight="40px"
+ minHeight="9"
>
<IconLabel
icon={icon}