Skip to content

Commit 1f283a6

Browse files
committed
refactor(app): use top bar instead of app header
1 parent 58b4648 commit 1f283a6

File tree

13 files changed

+83
-302
lines changed

13 files changed

+83
-302
lines changed

src/components/layout/AppFooter.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import { useState } from "react";
22
import { Link } from "react-router-dom";
33
import { Button } from "@/components/ui/button";
44
import { Separator } from "@/components/ui/separator";
5-
import { PrivacyPolicyModal } from "./legal/PrivacyPolicyModal";
65
import { Settings } from "lucide-react";
76
import { useCookieConsent } from "@/hooks/useCookieConsent";
87
import { CookiePreferencesDialog } from "./legal/CookiePreferencesDialog";
98

109
export function AppFooter() {
11-
const [showPrivacyModal, setShowPrivacyModal] = useState(false);
1210
const [showCookiePreferences, setShowCookiePreferences] = useState(false);
1311
const { revokeConsent } = useCookieConsent();
1412

@@ -33,12 +31,12 @@ export function AppFooter() {
3331
<div className="space-y-4">
3432
<h4 className="font-medium">Legal</h4>
3533
<div className="flex flex-col space-y-2 text-sm">
36-
<button
37-
onClick={() => setShowPrivacyModal(true)}
34+
<Link
35+
to="/privacy"
3836
className="text-left hover:text-primary transition-colors"
3937
>
4038
Privacy Policy
41-
</button>
39+
</Link>
4240
<Link
4341
to="/terms"
4442
className="hover:text-primary transition-colors"
@@ -86,21 +84,16 @@ export function AppFooter() {
8684
<p className="mt-2 sm:mt-0">
8785
Questions? Contact us at{" "}
8886
<a
89-
href="mailto:[email protected]"
87+
href="mailto:[email protected]"
9088
className="hover:text-primary transition-colors"
9189
>
92-
90+
9391
</a>
9492
</p>
9593
</div>
9694
</div>
9795
</footer>
9896

99-
<PrivacyPolicyModal
100-
open={showPrivacyModal}
101-
onOpenChange={setShowPrivacyModal}
102-
/>
103-
10497
<CookiePreferencesDialog
10598
open={showCookiePreferences}
10699
onOpenChange={setShowCookiePreferences}

src/components/layout/AppHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useRef, useCallback } from "react";
22
import { TooltipProvider } from "@/components/ui/tooltip";
33
import { useScrollVisibility } from "@/hooks/useScrollVisibility";
4-
import { TopBar } from "./AppHeader/TopBar";
4+
import { TopBar } from "./TopBar";
55
import { TitleSection } from "./AppHeader/TitleSection";
66

77
interface AppHeaderProps {
@@ -55,7 +55,7 @@ export function AppHeader({
5555
title={title}
5656
/>
5757

58-
<div className="pt-16 md:pt-20" ref={titleRef}>
58+
<div ref={titleRef}>
5959
<TitleSection
6060
title={title}
6161
logoUrl={logoUrl}

src/components/layout/AppHeader/TopBar.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/components/layout/TopBar.tsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { useIsMobile } from "@/hooks/use-mobile";
2+
import { AppBranding } from "./AppHeader/AppBranding";
3+
import { FestivalIndicator } from "./AppHeader/FestivalIndicator";
4+
import { UserActions } from "./AppHeader/UserActions";
5+
6+
interface TopBarProps {
7+
showBackButton?: boolean;
8+
backLabel?: string;
9+
showGroupsButton?: boolean;
10+
11+
// Festival context
12+
isTitleVisible?: boolean;
13+
logoUrl?: string | null;
14+
title?: string;
15+
}
16+
17+
export function TopBar({
18+
showBackButton = false,
19+
backLabel = "Back",
20+
showGroupsButton = false,
21+
22+
isTitleVisible = false,
23+
logoUrl,
24+
title,
25+
}: TopBarProps) {
26+
const isMobile = useIsMobile();
27+
28+
return (
29+
<>
30+
<div className="fixed top-0 left-0 right-0 z-50 backdrop-blur-md border-b border-purple-400/20 flex items-center px-4 py-3 md:py-4">
31+
<AppBranding isMobile={isMobile} />
32+
33+
<FestivalIndicator
34+
isTitleVisible={isTitleVisible}
35+
logoUrl={logoUrl}
36+
title={title}
37+
/>
38+
39+
<UserActions
40+
showBackButton={showBackButton}
41+
backLabel={backLabel}
42+
showGroupsButton={showGroupsButton}
43+
isMobile={isMobile}
44+
/>
45+
</div>
46+
<div className="h-16 md:h-20" /> {/* Spacer to offset fixed top bar */}
47+
</>
48+
);
49+
}

src/components/layout/legal/PrivacyPolicyModal.tsx

Lines changed: 0 additions & 220 deletions
This file was deleted.

src/pages/EditionView/EditionView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export default function EditionView() {
3030
<div className="container mx-auto px-4 py-4 md:py-8 pb-20 md:pb-8">
3131
<AppHeader
3232
title={festival.name}
33-
// subtitle={edition.name}
34-
// description="Festival voting platform"
3533
logoUrl={festival.logo_url}
3634
showGroupsButton
3735
/>

0 commit comments

Comments
 (0)