Skip to content

Commit 076b415

Browse files
committed
mobile fixes
1 parent f68a1bb commit 076b415

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

apps/dashboard/app/(main)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function MainLayout({
99
<div className="h-screen overflow-hidden text-foreground">
1010
<Sidebar />
1111
<div className="relative h-screen pl-0 md:pl-76 lg:pl-84">
12-
<div className="h-screen overflow-y-auto overflow-x-hidden pt-16 md:pt-0">
12+
<div className="h-screen overflow-y-auto overflow-x-hidden pt-12 md:pt-0">
1313
{children}
1414
</div>
1515
</div>

apps/dashboard/app/(main)/websites/[id]/_components/tabs/overview-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ export function WebsiteOverviewTab({
961961
minHeight={350}
962962
onAddFilter={onAddFilter}
963963
tabs={pagesTabs as any}
964-
title="Pages"
964+
title="Pages"
965965
/>
966966
</div>
967967

apps/dashboard/app/(main)/websites/[id]/map/page.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ const MapComponent = dynamic(
3333
}
3434
);
3535

36-
interface CountryData {
36+
type CountryData = {
3737
country: string;
3838
country_code?: string;
3939
visitors: number;
4040
pageviews: number;
41-
}
41+
};
4242

43-
interface CountryRowProps {
43+
type CountryRowProps = {
4444
country: CountryData;
4545
totalVisitors: number;
4646
onCountrySelect: (countryCode: string) => void;
47-
}
47+
};
4848

4949
function CountryRow({
5050
country,
@@ -66,7 +66,7 @@ function CountryRow({
6666

6767
return (
6868
<button
69-
className="flex w-full items-center gap-2.5 rounded px-2.5 py-2 text-left transition-colors hover:bg-accent"
69+
className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left transition-colors hover:bg-accent sm:gap-2.5 sm:px-2.5 sm:py-2"
7070
onClick={() =>
7171
onCountrySelect(
7272
country.country_code?.toUpperCase() || country.country.toUpperCase()
@@ -80,10 +80,11 @@ function CountryRow({
8080
type="button"
8181
>
8282
<CountryFlag
83+
className="sm:size-4"
8384
country={
8485
country.country_code?.toUpperCase() || country.country.toUpperCase()
8586
}
86-
size={16}
87+
size={14}
8788
/>
8889
<div className="min-w-0 flex-1">
8990
<p className="truncate font-medium text-xs">{country.country}</p>
@@ -171,30 +172,33 @@ function WebsiteMapPage() {
171172
selectedCountry={selectedCountry}
172173
/>
173174

174-
<div className="absolute top-3 right-3 z-20">
175-
<Card className="w-60 gap-0 border bg-card/95 py-0 shadow-lg backdrop-blur-sm">
176-
<CardHeader className="border-b bg-accent px-3 py-2.5">
177-
<CardTitle className="flex items-center gap-2 font-semibold text-sm">
178-
<GlobeIcon className="size-4 text-primary" weight="duotone" />
175+
<div className="absolute right-3 bottom-3 left-3 z-20 sm:top-3 sm:right-3 sm:bottom-auto sm:left-auto sm:w-60">
176+
<Card className="w-full gap-0 border bg-card/95 py-0 shadow-lg backdrop-blur-sm">
177+
<CardHeader className="border-b bg-accent px-2.5 py-2 sm:px-3 sm:py-2.5">
178+
<CardTitle className="flex items-center gap-2 font-semibold text-xs sm:text-sm">
179+
<GlobeIcon
180+
className="size-3.5 text-primary sm:size-4"
181+
weight="duotone"
182+
/>
179183
Top Countries
180184
</CardTitle>
181185
</CardHeader>
182186
<CardContent className="p-0">
183187
{isLoading ? (
184-
<div className="space-y-1 p-3">
188+
<div className="space-y-1 p-2 sm:p-3">
185189
{Array.from({ length: 5 }).map((_, i) => (
186190
<div
187-
className="flex items-center gap-2.5 py-1.5"
191+
className="flex items-center gap-2 py-1 sm:gap-2.5 sm:py-1.5"
188192
key={`country-skeleton-${i + 1}`}
189193
>
190-
<Skeleton className="size-4 rounded" />
194+
<Skeleton className="size-3.5 rounded sm:size-4" />
191195
<Skeleton className="h-3 flex-1" />
192196
<Skeleton className="h-3 w-8" />
193197
</div>
194198
))}
195199
</div>
196200
) : topCountries.length > 0 ? (
197-
<div className="space-y-0.5 p-1.5">
201+
<div className="max-h-[40vh] space-y-0.5 overflow-y-auto p-1 sm:max-h-none sm:p-1.5">
198202
{topCountries.map((country) => (
199203
<CountryRow
200204
country={country}
@@ -205,9 +209,9 @@ function WebsiteMapPage() {
205209
))}
206210
</div>
207211
) : (
208-
<div className="flex flex-col items-center justify-center p-6 text-center">
212+
<div className="flex flex-col items-center justify-center p-4 text-center sm:p-6">
209213
<GlobeIcon
210-
className="size-8 text-muted-foreground/30"
214+
className="size-6 text-muted-foreground/30 sm:size-8"
211215
weight="duotone"
212216
/>
213217
<p className="mt-2 text-muted-foreground text-xs">
@@ -217,9 +221,9 @@ function WebsiteMapPage() {
217221
)}
218222

219223
{topCountries.length > 0 && (
220-
<div className="flex items-center justify-between border-t bg-accent px-3 py-2">
224+
<div className="flex items-center justify-between border-t bg-accent px-2.5 py-1.5 sm:px-3 sm:py-2">
221225
<span className="text-muted-foreground text-xs">Total</span>
222-
<span className="font-semibold text-sm tabular-nums">
226+
<span className="font-semibold text-xs tabular-nums sm:text-sm">
223227
{totalVisitors.toLocaleString()}
224228
</span>
225229
</div>

apps/dashboard/components/layout/navigation/mobile-category-selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function MobileCategorySelector({
8383
<CaretDownIcon className="size-4" />
8484
</Button>
8585
</DropdownMenuTrigger>
86-
<DropdownMenuContent className="w-full min-w-(--radix-dropdown-menu-trigger-width)">
86+
<DropdownMenuContent className="z-120 w-full min-w-(--radix-dropdown-menu-trigger-width)">
8787
{categories.map((category) => {
8888
const Icon = category.icon;
8989
const isActive = activeCategory === category.id;

apps/dashboard/components/layout/sidebar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function Sidebar() {
159159
return (
160160
<>
161161
{/* Mobile Header */}
162-
<header className="fixed top-0 right-0 left-0 z-50 h-12 w-full border-b bg-background md:hidden">
162+
<header className="fixed top-0 right-0 left-0 z-40 h-12 w-full border-b bg-background md:hidden">
163163
<div className="flex h-full items-center justify-between px-4">
164164
<div className="flex items-center gap-3">
165165
<Button
@@ -204,7 +204,7 @@ export function Sidebar() {
204204

205205
{isMobileOpen && (
206206
<button
207-
className="fixed inset-0 z-30 bg-black/20 md:hidden"
207+
className="fixed inset-0 z-[90] bg-black/20 md:hidden"
208208
onClick={closeSidebar}
209209
onKeyDown={(e) => {
210210
if (e.key === "Escape") {
@@ -219,7 +219,7 @@ export function Sidebar() {
219219
<nav
220220
aria-hidden={!isMobileOpen}
221221
className={cn(
222-
"fixed inset-y-0 z-40 w-56 bg-sidebar sm:w-60 md:w-64 lg:w-72",
222+
"fixed inset-y-0 z-[100] w-56 bg-sidebar sm:w-60 md:w-64 lg:w-72",
223223
"border-r transition-transform duration-200 ease-out",
224224
"left-0 md:left-12",
225225
"pt-12 md:pt-0",
@@ -230,14 +230,14 @@ export function Sidebar() {
230230
>
231231
<Button
232232
aria-label="Close sidebar"
233-
className="absolute top-3 right-3 z-50 h-8 w-8 p-0 md:hidden"
233+
className="absolute top-3 right-3 z-110 h-8 w-8 p-0 md:hidden"
234234
data-track="sidebar-close"
235235
onClick={closeSidebar}
236236
size="sm"
237237
type="button"
238238
variant="ghost"
239239
>
240-
<XIcon className="h-4 w-4" size={32} weight="duotone" />
240+
<XIcon className="h-4 w-4" size={32} />
241241
<span className="sr-only">Close sidebar</span>
242242
</Button>
243243

0 commit comments

Comments
 (0)