-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into duosi/fix/mainPageLogo
- Loading branch information
Showing
10 changed files
with
120 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { type ApiData } from "@vercel/flags" | ||
import { NextResponse } from "next/server" | ||
import { verifyAccess, type ApiData } from "@vercel/flags" | ||
import { NextRequest, NextResponse } from "next/server" | ||
import { FEATURE_FLAG_DEFINITIONS } from "../../../../feature_flags" | ||
|
||
export async function GET() { | ||
export async function GET(request: NextRequest) { | ||
const access = await verifyAccess(request.headers.get("Authorization")) | ||
if (!access) return NextResponse.json(null, { status: 401 }) | ||
|
||
const apiData = { | ||
definitions: FEATURE_FLAG_DEFINITIONS | ||
} | ||
|
||
return NextResponse.json<ApiData>(apiData) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { InstagramIcon, LinkedinIcon, Music2Icon } from "lucide-react" | ||
|
||
export function Footer() { | ||
return ( | ||
/* IF WIDTH < 768, SET TO VERTICAL, OTHERWISE KEEP HORIZONTAL */ | ||
<div className="w-100 flex flex-col items-center justify-center md:flex-row md:items-start"> | ||
<hr className="static mt-2 h-1 w-2/3 rounded border-0 bg-slate-500 bg-opacity-30 md:absolute" /> | ||
<div className="m-5 mb-3 mt-7 w-1/4 place-items-center text-center md:place-items-start md:text-start"> | ||
<p> | ||
<b>Follow us on:</b> | ||
</p> | ||
<a | ||
href="https://www.linkedin.com/company/armada" | ||
className="flex space-x-1"> | ||
<LinkedinIcon size="20" /> | ||
<p className="mb-0">LinkedIn</p> | ||
</a> | ||
<a | ||
href="https://www.instagram.com/thsarmada/" | ||
className="flex space-x-1"> | ||
<InstagramIcon size="20" /> | ||
<p>Instagram</p> | ||
</a> | ||
<a href="https://www.tiktok.com/@ths.armada" className="flex space-x-1"> | ||
<Music2Icon size="20" /> | ||
<p>TikTok</p> | ||
</a> | ||
</div> | ||
|
||
<div className="m-5 mb-3 mt-7 w-1/4 place-items-center text-center md:place-items-start md:text-left"> | ||
<p> | ||
<b>STUDENTS</b> | ||
</p> | ||
<a href="/student/exhibitors">Exhibitors</a> | ||
<br /> | ||
<a href="/student/recruitment">Recruitment</a> | ||
<br /> | ||
<a href="/student/events">Events</a> | ||
</div> | ||
<div className="m-5 mb-3 mt-7 w-1/4 place-items-center text-center md:place-items-start md:text-left"> | ||
<p> | ||
<b>EXHIBITORS</b> | ||
</p> | ||
<a href="https://register.armada.nu/register">Registration</a> | ||
<br /> | ||
<a href="/exhibitor/packages">Packages</a> | ||
<br /> | ||
<a href="/exhibitor">Why Armada</a> | ||
<br /> | ||
<a href="/exhibitor/timeline">Timeline</a> | ||
</div> | ||
|
||
<div className="m-5 mb-3 mt-7 w-1/4 place-items-center text-center md:place-items-start md:text-left"> | ||
<p> | ||
<b>ARMADA</b> | ||
</p> | ||
<p> | ||
<i>Drottning Kristinas väg 15</i> | ||
</p> | ||
<p> | ||
<i>114 28, Stockholm</i> | ||
</p> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
import featureFlags from "@/feature_flags" | ||
import featureFlags, { FEATURE_FLAGS } from "@/feature_flags" | ||
import { decrypt, FlagOverridesType } from "@vercel/flags" | ||
import { cookies } from "next/headers" | ||
|
||
export function feature(feature: keyof typeof featureFlags) { | ||
const cookie = cookies() | ||
|
||
const result = cookie.get("vercel-flag-overrides") | ||
if (result != null) { | ||
return parseCookie(feature, result.value) | ||
export async function features() { | ||
const overrideCookie = cookies().get("vercel-flag-overrides")?.value | ||
const overrides = overrideCookie | ||
? await decrypt<FlagOverridesType>(overrideCookie) | ||
: {} | ||
return { | ||
...FEATURE_FLAGS, | ||
...overrides | ||
} | ||
return false | ||
} | ||
|
||
function parseCookie( | ||
feature: keyof typeof featureFlags, | ||
rawOverrides: string | undefined | ||
) { | ||
const overrides = | ||
rawOverrides == null | ||
? {} | ||
: (JSON.parse(rawOverrides) as Record<string, boolean>) | ||
|
||
if (overrides[feature] != null) { | ||
return overrides[feature] | ||
} else if (featureFlags[feature] != null) { | ||
return featureFlags[feature] | ||
} | ||
return false | ||
export async function feature(feature: keyof typeof featureFlags) { | ||
return (await features())[feature] ?? false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { features } from "@/components/shared/feature" | ||
import FEATURE_FLAGS from "@/feature_flags" | ||
import { useQuery } from "@tanstack/react-query" | ||
|
||
export function useFeature(feature?: keyof typeof FEATURE_FLAGS) { | ||
const { data, isLoading } = useQuery({ | ||
queryKey: ["feature-flags"], | ||
queryFn: async () => await features() | ||
}) | ||
|
||
return { | ||
isLoading, | ||
enabled: feature ? data?.[feature] : null, | ||
flags: data | ||
} | ||
} |