Skip to content

Commit 365cd32

Browse files
committed
fix(social): add social page
1 parent 8fd92ca commit 365cd32

File tree

2 files changed

+48
-25
lines changed

2 files changed

+48
-25
lines changed

src/components/PageTitle/PageTitle.tsx

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@ import { Helmet } from "react-helmet-async";
33
const DEFAULT_TITLE = "UpLine";
44
const TITLE_SEPARATOR = " - ";
55

6-
/**
7-
* Utility function to build title from parts
8-
*/
9-
export function buildTitle(title?: string, prefix?: string): string {
10-
const parts = [DEFAULT_TITLE];
11-
12-
if (title) {
13-
parts.unshift(title);
14-
}
15-
16-
if (prefix) {
17-
parts.unshift(prefix);
18-
}
19-
20-
return parts.join(TITLE_SEPARATOR);
21-
}
22-
236
/**
247
* Component to set the page title and meta tags using Helmet
258
*/
@@ -31,7 +14,6 @@ interface PageTitleProps {
3114

3215
export function PageTitle({ title, prefix, description }: PageTitleProps) {
3316
const fullTitle = buildTitle(title, prefix);
34-
3517
return (
3618
<Helmet>
3719
<title>{fullTitle}</title>
@@ -43,3 +25,44 @@ export function PageTitle({ title, prefix, description }: PageTitleProps) {
4325
</Helmet>
4426
);
4527
}
28+
29+
/**
30+
* Get environment prefix based on current hostname
31+
*/
32+
function getEnvironmentPrefix(): string | undefined {
33+
if (typeof window === "undefined") return undefined;
34+
35+
const hostname = window.location.hostname;
36+
37+
if (hostname === "localhost" || hostname === "127.0.0.1") {
38+
return "LOCAL";
39+
}
40+
41+
if (!hostname.includes("getupline.com")) {
42+
return "DEV";
43+
}
44+
45+
return undefined;
46+
}
47+
48+
/**
49+
* Utility function to build title from parts
50+
*/
51+
function buildTitle(title?: string, prefix?: string): string {
52+
const parts = [DEFAULT_TITLE];
53+
54+
if (title) {
55+
parts.unshift(title);
56+
}
57+
58+
if (prefix) {
59+
parts.unshift(prefix);
60+
}
61+
62+
const envPrefix = getEnvironmentPrefix();
63+
if (envPrefix) {
64+
parts.unshift(envPrefix);
65+
}
66+
67+
return parts.join(TITLE_SEPARATOR);
68+
}

src/pages/EditionView/MainTabNavigation.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cn } from "@/lib/utils";
2-
import { Calendar, List, Info } from "lucide-react";
2+
import { Calendar, List, Info, MessageSquare } from "lucide-react";
33
import { NavLink } from "react-router-dom";
44
import { useFestivalEdition } from "@/contexts/FestivalEditionContext";
55

@@ -30,12 +30,12 @@ const TAB_CONFIG = {
3030
shortLabel: "Info",
3131
disabled: false,
3232
},
33-
// social: {
34-
// icon: MessageSquare,
35-
// label: "Social",
36-
// shortLabel: "Social",
37-
// disabled: true,
38-
// },
33+
social: {
34+
icon: MessageSquare,
35+
label: "Social",
36+
shortLabel: "Social",
37+
disabled: false,
38+
},
3939
} as const;
4040

4141
export function MainTabNavigation() {

0 commit comments

Comments
 (0)