Skip to content

Commit ade2f1d

Browse files
committed
Merge branch 'master' into feature/improve-toast-ux
2 parents cf1b50f + a46e5b1 commit ade2f1d

File tree

9 files changed

+3187
-18339
lines changed

9 files changed

+3187
-18339
lines changed

app/globals.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,47 @@ body {
106106
}
107107
}
108108

109+
@layer utilities {
110+
/* Hide scrollbar but keep functionality */
111+
.scrollbar-hide {
112+
-ms-overflow-style: none; /* IE and Edge */
113+
scrollbar-width: none; /* Firefox */
114+
}
115+
.scrollbar-hide::-webkit-scrollbar {
116+
display: none; /* Chrome, Safari and Opera */
117+
}
118+
119+
/* Thin, subtle scrollbar */
120+
.scrollbar-subtle {
121+
scrollbar-width: thin;
122+
scrollbar-color: rgba(156, 163, 175, 0.3) transparent; /* gray-400 with opacity */
123+
}
124+
.scrollbar-subtle::-webkit-scrollbar {
125+
width: 6px;
126+
}
127+
.scrollbar-subtle::-webkit-scrollbar-track {
128+
background: transparent;
129+
}
130+
.scrollbar-subtle::-webkit-scrollbar-thumb {
131+
background-color: rgba(156, 163, 175, 0.3); /* gray-400 with opacity */
132+
border-radius: 3px;
133+
}
134+
.scrollbar-subtle::-webkit-scrollbar-thumb:hover {
135+
background-color: rgba(156, 163, 175, 0.5); /* gray-400 with more opacity on hover */
136+
}
137+
138+
/* Dark mode subtle scrollbar */
139+
.dark .scrollbar-subtle {
140+
scrollbar-color: rgba(100, 116, 139, 0.3) transparent; /* slate-500 with opacity */
141+
}
142+
.dark .scrollbar-subtle::-webkit-scrollbar-thumb {
143+
background-color: rgba(100, 116, 139, 0.3); /* slate-500 with opacity */
144+
}
145+
.dark .scrollbar-subtle::-webkit-scrollbar-thumb:hover {
146+
background-color: rgba(100, 116, 139, 0.5); /* slate-500 with more opacity on hover */
147+
}
148+
}
149+
109150

110151

111152

app/wrapped/page.tsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { auth } from "@/auth";
2+
import { redirect } from "next/navigation";
3+
import { Metadata } from "next";
4+
import { config } from "@/config/environment";
5+
import { WrappedSlideshow } from "@/components/wrapped/wrapped-slideshow";
6+
import { getWrappedData } from "@/services/wrapped";
7+
8+
export async function generateMetadata(): Promise<Metadata> {
9+
return {
10+
title: `Wrapped ${new Date().getFullYear()} | ${config.brandName}`,
11+
};
12+
}
13+
14+
export default async function WrappedPage() {
15+
const session: any = await auth();
16+
if (!session || !session.user) redirect("/login");
17+
18+
// Only allow access for specific email
19+
const allowedEmail = "hernandeztomas584@gmail.com";
20+
if (session.user.email !== allowedEmail) {
21+
redirect("/");
22+
}
23+
24+
const currentYear = new Date().getFullYear();
25+
26+
const wrappedData = await getWrappedData(currentYear);
27+
28+
// Only use hardcoded goals for specific user (6786fc3d59e0d0be0d34416c)
29+
// For other users, use most completed tasks
30+
const specificUserId = "6786fc3d59e0d0be0d34416c";
31+
const isSpecificUser = wrappedData.userId === specificUserId;
32+
33+
const goalsAchieved = isSpecificUser ? [
34+
"Certificado de A2 en Alemán",
35+
"Di una conferencia de Informática",
36+
"Estabilidad mental mayor",
37+
"Darme más tiempo a divulgar y pensar",
38+
"Llegué a 120kg en press banca",
39+
"Certificado en Deep Learning",
40+
"Surfee un montón",
41+
"Vi a Stone Temple Pilots",
42+
"Cambié mi PC entera",
43+
"Empecé Kyzen",
44+
"Aprendí CI/CD y profundice Docker. Aplicándolo en el mundo laboral",
45+
"Leí un montón, y me ayudó mucho para abrirme hacia otras personas y poder escucharlas mejor",
46+
"Empecé a Invertir",
47+
] : wrappedData.mostCompletedTasks.map(task => task.name);
48+
49+
// Generate AI summary based on actual data
50+
const aiSummary = `En ${currentYear}, demostraste una dedicación excepcional. Transformaste la constancia en resultados: tu racha de ${wrappedData.stats.longestStreak} días y ${wrappedData.stats.tasksCompleted} tareas completadas no son solo números, son prueba de tu compromiso. ${wrappedData.stats.mostConsistentHabit !== "Ninguno" ? `"${wrappedData.stats.mostConsistentHabit}" se convirtió en tu ancla,` : "Construiste hábitos sólidos,"} y cuando conectaste con ${wrappedData.stats.friendsConnected} personas en la plataforma, llevaste tu crecimiento al siguiente nivel. ${wrappedData.stats.moodImprovement > 0 ? `Tu mood mejoró un ${wrappedData.stats.moodImprovement}%` : "Tu bienestar se mantuvo estable"} porque construiste sistemas que funcionan. Esto recién empieza.`;
51+
52+
const userData = {
53+
name: session.user.name || "Usuario",
54+
username: session.user.username ? `@${session.user.username}` : "@usuario",
55+
avatar: wrappedData.userImage || session.user.name?.charAt(0).toUpperCase() || "U",
56+
year: currentYear,
57+
stats: wrappedData.stats,
58+
habitsFormed: wrappedData.habitsFormed,
59+
goalsAchieved,
60+
aiSummary,
61+
isSpecificUser,
62+
mostCompletedTasks: wrappedData.mostCompletedTasks,
63+
};
64+
65+
return <WrappedSlideshow userData={userData} />;
66+
}
67+

components/accordion/calendar-accordion.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { AnimatePresence, motion } from "framer-motion";
4-
import { enUS, es } from "date-fns/locale";
54
import { useLocale, useTranslations } from "next-intl";
65

76
import { Button } from "../ui/button";
@@ -10,7 +9,6 @@ import { CalendarIcon } from "lucide-react";
109
import { PRIMARY_COLOR } from "@/lib/colors";
1110
import React from "react";
1211
import { cn } from "@/lib/utils";
13-
import { format } from "date-fns";
1412
import { formatDateLocalized } from "@/utils/date";
1513
import { useTheme } from "next-themes";
1614

components/settings-menu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function SettingsMenu({ onLogout}) {
3636
{ icon: Bug, label: t('reportBugs'), action: async () => router.push('/report-bugs') },
3737
{ icon: Lightbulb, label: t('suggestFeatures'), action: async () => router.push('/suggest-features') },
3838
{ icon: Settings, label: t('settings'), action: async () => router.push('/settings/general') },
39+
{ icon: Settings, label: 'Wrapped', action: async() => router.push('/wrapped')},
3940
{ icon: LogOut, label: t('logout'), action: async () => await onLogout() },
4041
];
4142

0 commit comments

Comments
 (0)