Skip to content

Commit f4b76d9

Browse files
authored
Merge branch 'main' into timings
2 parents b5bba8f + 6e293cb commit f4b76d9

9 files changed

Lines changed: 113 additions & 133 deletions

File tree

apps/api/src/controllers/vote.Controller.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { submitVote } from '../services/vote.Service'
55

66
export const createVote = async (c: Context<AppEnv>) => {
77
const userId = c.get('userId')
8-
8+
99
let body: VoteRequest
1010
try {
1111
body = await c.req.json()
@@ -18,14 +18,14 @@ export const createVote = async (c: Context<AppEnv>) => {
1818
if (typeof stallId !== 'number' || typeof rating !== 'number') {
1919
return c.json({ success: false, message: 'stallId and rating must be numbers' }, 400)
2020
}
21-
21+
2222
if (rating < 0 || rating > 10) {
2323
return c.json({ success: false, message: 'rating must be between 0 and 10' }, 400)
2424
}
2525

2626
try {
2727
const progressCount = await submitVote(c.env, userId, body)
28-
28+
2929
const response: VoteResponse = {
3030
success: true,
3131
message: 'Vote submitted successfully',
@@ -37,9 +37,6 @@ export const createVote = async (c: Context<AppEnv>) => {
3737
if (e.message === 'Already voted') {
3838
return c.json({ success: false, message: 'Already voted' }, 400)
3939
}
40-
if (e.message === 'Voting is currently closed') {
41-
return c.json({ success: false, message: 'Voting is currently closed' }, 403)
42-
}
4340
return c.json({ success: false, message: 'Internal Server Error' }, 500)
4441
}
4542
}

apps/api/src/services/vote.Service.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export const submitVote = async (
3737
userId: string,
3838
vote: VoteRequest
3939
) => {
40-
if (!isVotingOpen()) {
41-
throw new Error('Voting is currently closed');
42-
}
43-
4440
const { stallId, rating } = vote
4541
const ormDb = getDb(env.DB)
4642

@@ -80,11 +76,11 @@ export const submitVote = async (
8076
.select({ stallId: ratings.stallId })
8177
.from(ratings)
8278
.where(eq(ratings.userId, userId));
83-
79+
8480
const stallIds = userRatings
8581
.map(r => r.stallId)
8682
.filter((id): id is number => id !== null);
87-
83+
8884
await refreshStallAggregates(env.DB, stallIds);
8985
} else {
9086
// Normal vote (could be qualified or not, but only this stall is affected)
Lines changed: 36 additions & 0 deletions
Loading

apps/web/src/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,6 @@ export default function App() {
363363
{currentScreen === 'completion' && (
364364
<CompletionScreen
365365
onClose={() => setCurrentScreen('progress')}
366-
onGoToProfile={() => setCurrentScreen('progress')}
367-
onViewLeaderboard={() => setCurrentScreen('progress')}
368366
/>
369367
)}
370368
</div>

apps/web/src/components/CompletionScreen.tsx

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ import { CheckCircle2, Star } from 'lucide-react';
33

44
interface CompletionScreenProps {
55
onClose: () => void;
6-
onGoToProfile: () => void;
7-
onViewLeaderboard: () => void;
86
}
97

108
export default function CompletionScreen({
11-
onClose,
12-
onGoToProfile,
13-
onViewLeaderboard
9+
onClose
1410
}: CompletionScreenProps) {
1511
return (
1612
<div
@@ -35,7 +31,7 @@ export default function CompletionScreen({
3531
<img
3632
src="/Fiza_logo.webp"
3733
alt="Fiza"
38-
className="h-60 sm:h-80 w-auto object-contain drop-shadow-[0_0_15px_rgba(255,255,255,0.1)] translate-x-2 -translate-y-24 sm:translate-x-4 sm:-translate-y-28"
34+
className="h-60 sm:h-80 w-auto object-contain drop-shadow-[0_0_15px_rgba(255,255,255,0.1)] translate-x-4 -translate-y-24 sm:translate-x-8 sm:-translate-y-28"
3935
/>
4036
</div>
4137

@@ -91,21 +87,6 @@ export default function CompletionScreen({
9187
</p>
9288
</div>
9389

94-
{/* Action Buttons */}
95-
<div className="flex flex-col sm:flex-row gap-4 w-full max-w-md shrink-0">
96-
<button
97-
onClick={onGoToProfile}
98-
className="px-6 py-3 bg-gradient-to-r from-[#8B5CF6] to-[#6D28D9] rounded-xl font-bold text-white hover:opacity-90 transition-opacity flex-1"
99-
>
100-
Go to Profile
101-
</button>
102-
<button
103-
onClick={onViewLeaderboard}
104-
className="px-6 py-3 bg-white/10 backdrop-blur-sm rounded-xl font-bold text-white hover:bg-white/20 transition-colors flex-1 border border-white/20"
105-
>
106-
View Leaderboard
107-
</button>
108-
</div>
10990

11091
{/* Close button */}
11192
<button
@@ -124,19 +105,17 @@ export default function CompletionScreen({
124105
Powered By
125106
</span>
126107
<a
127-
href="https://dk24.org/"
128-
target="_blank"
129-
rel="noopener noreferrer"
130-
className="flex items-center justify-center hover:opacity-80 transition-opacity"
131-
>
132-
<div className="w-20 h-20 shrink-0 overflow-hidden">
133-
<img
134-
src="/dk24.webp"
135-
alt="DK24"
136-
className="w-full h-full object-contain scale-125"
137-
/>
138-
</div>
139-
</a>
108+
href="https://dk24.org/"
109+
target="_blank"
110+
rel="noopener noreferrer"
111+
className="flex items-center justify-center gap-3 hover:opacity-80 transition-opacity"
112+
>
113+
<img
114+
src="/Consortium Logo.svg"
115+
alt="DK24"
116+
className="h-15 sm:h-15 w-auto object-contain"
117+
/>
118+
</a>
140119
</div>
141120

142121
{/* In Collaboration Section */}

apps/web/src/components/Footer.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ export default function Footer({
2828
href="https://dk24.org/"
2929
target="_blank"
3030
rel="noopener noreferrer"
31-
className="flex items-center justify-center cursor-pointer hover:opacity-80 transition"
31+
className="flex items-center justify-center gap-1.5 hover:opacity-80 transition-opacity mt-auto"
3232
>
33-
<div className="w-16 h-16 sm:w-20 sm:h-20 overflow-hidden">
34-
<img
35-
src="/dk24.webp"
36-
alt="DK24"
37-
className="w-full h-full object-contain"
38-
/>
39-
</div>
33+
<img
34+
src="/Consortium Logo.svg"
35+
alt="DK24"
36+
className="h-10 sm:h-12 w-auto object-contain"
37+
/>
4038
</a>
4139
</div>
4240

apps/web/src/components/LoginScreen.tsx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,20 @@ export default function LoginScreen({ onStart }: LoginScreenProps) {
1111
className="h-[100dvh] relative select-none overflow-hidden flex flex-col bg-cover bg-center bg-no-repeat"
1212
style={{ backgroundImage: "url('/bg.webp')" }}
1313
>
14-
{/* ── TOP LOGOS ── */}
15-
<div className="absolute -top-4 left-5 right-5 flex items-center justify-between z-20 pointer-events-none">
16-
<motion.div
17-
initial={{ opacity: 0, y: -20 }}
18-
animate={{ opacity: 1, y: 0 }}
19-
transition={{ duration: 0.7 }}
20-
className="w-24 sm:w-32 md:w-36 drop-shadow-lg pointer-events-auto"
21-
>
14+
<div className="absolute top-4 left-6 sm:left-8 pointer-events-none z-30">
2215
<img
2316
src="/Nitte_logo.webp"
2417
alt="Nitte"
25-
className="w-full h-auto object-contain"
18+
className="h-10 sm:h-12 w-auto object-contain"
2619
/>
27-
</motion.div>
20+
</div>
2821

29-
<motion.div
30-
initial={{ opacity: 0, y: -20 }}
31-
animate={{ opacity: 1, y: 0 }}
32-
transition={{ duration: 0.7 }}
33-
className="w-24 sm:w-32 md:w-36 drop-shadow-lg pointer-events-auto"
34-
>
22+
<div className="absolute top-0 right-0 pointer-events-none z-30 opacity-90">
3523
<img
3624
src="/Fiza_logo.webp"
3725
alt="Fiza"
38-
className="w-full h-auto object-contain"
39-
/>
40-
</motion.div>
41-
</div>
42-
26+
className="h-60 sm:h-80 w-auto object-contain drop-shadow-[0_0_15px_rgba(255,255,255,0.1)] translate-x-4 -translate-y-24 sm:translate-x-8 sm:-translate-y-28" />
27+
</div>
4328
<div className="relative z-10 h-full flex flex-col items-center justify-center px-6">
4429

4530
{/* ── LOGO ── */}

0 commit comments

Comments
 (0)