Skip to content

Commit a9fd3d8

Browse files
committed
MobileFreindly
1 parent be7bdf9 commit a9fd3d8

File tree

2 files changed

+66
-4
lines changed

2 files changed

+66
-4
lines changed

src/Component/BottomTabBar.razor

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@inject NavigationManager nav
2+
3+
<nav class="fixed bottom-0 left-0 right-0 z-50 bg-white/95 backdrop-blur-md border-t border-gray-200 shadow-lg">
4+
<div class="max-w-7xl mx-auto">
5+
<div class="grid grid-cols-4">
6+
<button @onclick="GoToHomePage"
7+
class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/") || IsActive("/playmedia/") ? "text-red-600" : "text-gray-600")">
8+
<span class="text-lg">🎬</span>
9+
<span>Episodes</span>
10+
</button>
11+
<button @onclick="GoToStickers"
12+
class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/stickers") ? "text-red-600" : "text-gray-600")">
13+
<span class="text-lg">🎭</span>
14+
<span>Stickers</span>
15+
</button>
16+
<button @onclick="GoToSearch"
17+
class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/Search") ? "text-red-600" : "text-gray-600")">
18+
<span class="text-lg">🔍</span>
19+
<span>Search</span>
20+
</button>
21+
<button @onclick="GoToQuiz"
22+
class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/quiz") ? "text-red-600" : "text-gray-600")">
23+
<span class="text-lg">🧠</span>
24+
<span>Quiz</span>
25+
</button>
26+
</div>
27+
</div>
28+
</nav>
29+
30+
@code {
31+
private bool IsActive(string path)
32+
{
33+
var uri = nav.Uri;
34+
if (string.IsNullOrWhiteSpace(uri)) return false;
35+
// Normalize trailing slashes for comparison
36+
uri = uri.TrimEnd('/');
37+
path = path.TrimEnd('/');
38+
return uri.EndsWith(path, StringComparison.OrdinalIgnoreCase);
39+
}
40+
41+
void GoToHomePage()
42+
{
43+
nav.NavigateTo("/");
44+
}
45+
46+
void GoToStickers()
47+
{
48+
nav.NavigateTo("/stickers");
49+
}
50+
51+
void GoToSearch()
52+
{
53+
nav.NavigateTo("/Search");
54+
}
55+
56+
void GoToQuiz()
57+
{
58+
nav.NavigateTo("/quiz");
59+
}
60+
}
61+
62+

src/Layout/MobileLayout.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
<ErrorBoundary>
55
<ChildContent>
6-
<div class="min-h-screen cartoon-bg flex flex-col">
6+
<div class="min-h-screen cartoon-bg flex flex-col pb-14">
77
<!-- Mobile App Bar -->
88
<MobileAppBar />
99
<main class="pt-16 flex-1">
1010
@ChildContent
1111
</main>
12-
<MobileFooter />
12+
<BottomTabBar />
1313
</div>
1414
</ChildContent>
1515
<ErrorContent>
16-
<div class="min-h-screen cartoon-bg flex flex-col">
16+
<div class="min-h-screen cartoon-bg flex flex-col pb-14">
1717
<MobileAppBar />
1818
<main class="pt-16 flex-1">
1919
@ChildContent
2020
</main>
21-
<MobileFooter />
21+
<BottomTabBar />
2222
</div>
2323
</ErrorContent>
2424
</ErrorBoundary>

0 commit comments

Comments
 (0)