Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/wrapped/components/wrapped-experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function WrappedLogin({

export function WrappedExperience({ mode }: { mode: "user" | "global" }) {
const { checkPermission, user } = useContext(AppContext);
const canViewWrapped = checkPermission(PermissionAction.VIEW_WRAPPED);
const canViewWrapped =
checkPermission(PermissionAction.VIEW_WRAPPED) || mode === "global";

// Theme settings: defaults < easter-egg (temporary React state).
const [easterSettings, setEasterSettings] =
Expand Down Expand Up @@ -196,7 +197,7 @@ export function WrappedExperience({ mode }: { mode: "user" | "global" }) {
return (
<WrappedLogin
isGuest={user?.account_type === ACCOUNT_TYPE.GUEST}
isGlobal={mode === "global"}
isGlobal={false}
/>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/wrapped/global/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { Metadata } from "next";
import { WrappedExperience } from "../components/wrapped-experience";

export const metadata: Metadata = {
title: "Wrapped cały Testownik",
title: "Wrapped - cały Testownik",
description: "Podsumowanie semestru całego Testownika w liczbach.",
openGraph: {
title: "Testownik Wrapped cały Testownik",
title: "Testownik Wrapped - cały Testownik",
description: "Podsumowanie semestru całego Testownika w liczbach.",
type: "website",
locale: "pl_PL",
Expand Down
4 changes: 2 additions & 2 deletions src/app/wrapped/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { WrappedPageClient } from "./client";

export const metadata: Metadata = {
title: "Wrapped",
description: "Twój semestr w Testowniku podsumowanie w liczbach.",
description: "Twój semestr w Testowniku - podsumowanie w liczbach.",
openGraph: {
title: "Testownik Wrapped",
description: "Twój semestr w Testowniku podsumowanie w liczbach.",
description: "Twój semestr w Testowniku - podsumowanie w liczbach.",
type: "website",
locale: "pl_PL",
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/wrapped/share-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export async function generateShareImage(
/\/$/,
"",
);
const link = `${host}${wrappedPath(data)}`;
const link = `${host}/wrapped`;
context.font = `700 38px ${sans}`;
const pillW = context.measureText(link).width + 96;
const pillH = 92;
Expand Down Expand Up @@ -620,7 +620,7 @@ export async function shareWrapped(
}
downloadBlob(blob, "testownik-wrapped.png");
void copyLink(textWithLink);
toast.success("Zapisano obrazek link do Wrapped skopiowany!");
toast.success("Zapisano obrazek - link do Wrapped skopiowany!");
return;
}

Expand Down
60 changes: 42 additions & 18 deletions src/app/wrapped/slides/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Fast-refresh's "only export components" rule doesn't apply to this pattern. */
/* eslint-disable react-refresh/only-export-components */
import formbricks from "@formbricks/js";
import Link from "next/link";
import type { CSSProperties, ComponentType } from "react";
import { SiGithub } from "react-icons/si";

Expand Down Expand Up @@ -1402,24 +1403,47 @@ function OutroSlide({ data, onShare, onRestart }: SlideProps) {
>
Udostępnij
</button>
<button
type="button"
onClick={onRestart}
style={{
flex: 1,
height: "clamp(38px, 5.4dvh, 46px)",
borderRadius: "12px",
background: "transparent",
border: "1.5px solid currentColor",
color: "currentColor",
fontFamily: FM,
fontSize: "clamp(13px, 1.9dvh, 15px)",
fontWeight: 600,
cursor: "pointer",
}}
>
Od nowa
</button>
{global ? (
<Link
href="/wrapped"
style={{
flex: 1,
height: "clamp(38px, 5.4dvh, 46px)",
borderRadius: "12px",
background: "transparent",
border: "1.5px solid currentColor",
color: "currentColor",
display: "flex",
alignItems: "center",
justifyContent: "center",
fontFamily: FM,
fontSize: "clamp(13px, 1.9dvh, 15px)",
fontWeight: 600,
textDecoration: "none",
}}
>
Moje Wrapped
</Link>
) : (
<button
type="button"
onClick={onRestart}
style={{
flex: 1,
height: "clamp(38px, 5.4dvh, 46px)",
borderRadius: "12px",
background: "transparent",
border: "1.5px solid currentColor",
color: "currentColor",
fontFamily: FM,
fontSize: "clamp(13px, 1.9dvh, 15px)",
fontWeight: 600,
cursor: "pointer",
}}
>
Od nowa
</button>
)}
</div>
<div
style={{
Expand Down
Loading