Skip to content

Commit 23e1331

Browse files
authored
fix: reported bugs (#31)
* fix: reported bugs * fix: mobile view
1 parent 77e6a4d commit 23e1331

10 files changed

Lines changed: 244 additions & 147 deletions

File tree

app/api/user/register/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ export async function POST(request: Request) {
220220
const portfolio_link = formData.get("portfolio_link") as string;
221221
const ctf_profile = formData.get("ctf_profile") as string;
222222
const isLooking = formData.get("isLooking") === "true";
223+
const attendedZenith = formData.get("attended_zenith") === "true";
224+
const attendedPBCTF4 = formData.get("attended_pbctf4") === "true";
223225

224226
// Validation
225227
const errors: Record<string, string> = {};
@@ -442,6 +444,8 @@ export async function POST(request: Request) {
442444
portfolio_link: portfolio_link?.trim(),
443445
ctf_profile: ctf_profile?.trim(),
444446
isLooking: Boolean(isLooking),
447+
attendedZenith: Boolean(attendedZenith),
448+
attendedPBCTF4: Boolean(attendedPBCTF4),
445449
role: "user",
446450
teamCode: undefined,
447451
authProvider: isGoogle ? "google" : "password",

app/dashboard/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default function DashboardLayout({
139139
<main className="relative flex-1 w-full">
140140
<DotPattern />
141141

142-
<div className="relative z-10 mx-auto w-full max-w-[1100px] px-4 sm:px-6 md:px-8 py-8 sm:py-10 md:py-12">
142+
<div className="relative mx-auto w-full max-w-[1100px] px-4 sm:px-6 md:px-8 py-8 sm:py-10 md:py-12">
143143
<div className="flex flex-col gap-6 md:gap-8">
144144
{alert && (
145145
<StickyAlert

app/dashboard/resume/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ export default function ResumeViewPage() {
1515
const [iframeLoading, setIframeLoading] = useState(true);
1616
const [iframeError, setIframeError] = useState(false);
1717

18+
const handleBack = () => {
19+
if (window.history.length <= 1) {
20+
window.close();
21+
setTimeout(() => router.push("/dashboard"), 100);
22+
} else {
23+
router.back();
24+
}
25+
};
26+
1827
const proxiedUrl = rawUrl
1928
? `/api/resume/view?url=${encodeURIComponent(rawUrl)}`
2029
: "";
@@ -30,7 +39,7 @@ export default function ResumeViewPage() {
3039
The resume viewer needs a resume URL passed as the{" "}
3140
<code className="font-mono text-brand">?url=</code> query parameter.
3241
</p>
33-
<Button onClick={() => router.back()} variant="secondary">
42+
<Button onClick={handleBack} variant="secondary">
3443
<ArrowLeft className="w-3.5 h-3.5" />
3544
Go back
3645
</Button>
@@ -51,7 +60,7 @@ export default function ResumeViewPage() {
5160
</h1>
5261
</div>
5362
<div className="flex items-center gap-2">
54-
<Button onClick={() => router.back()} variant="secondary" size="sm">
63+
<Button onClick={handleBack} variant="secondary" size="sm">
5564
<ArrowLeft className="w-3.5 h-3.5" />
5665
Back
5766
</Button>

components/landing/MissionBrief/MissionBrief.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function FlappyBird({ onExit }) {
4343
function getPipeInterval() { return Math.max(120, BASE_PIPE_INTERVAL - Math.min(score, 25) * 1.5); }
4444

4545
// --- Frame-rate cap: run logic at 70 fps ---
46-
const TARGET_FPS = 70;
46+
const TARGET_FPS = 60;
4747
const FRAME_MS = 1000 / TARGET_FPS;
4848
let lastTime = 0;
4949

components/landing/Prizes/Prizes.jsx

Lines changed: 7 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,26 @@ const TIERS = [
1515
{
1616
id: 'prize-second',
1717
rankNumber: '02',
18-
amount: 15000,
1918
label: 'SECOND PLACE',
2019
modifier: 'second',
2120
color: '#A0E0B0'
2221
},
2322
{
2423
id: 'prize-first',
2524
rankNumber: '01',
26-
amount: 25000,
2725
label: 'FIRST PLACE',
2826
modifier: 'first',
2927
color: 'var(--primary)'
3028
},
3129
{
3230
id: 'prize-third',
3331
rankNumber: '03',
34-
amount: 5000,
3532
label: 'THIRD PLACE',
3633
modifier: 'third',
3734
color: '#A0E0B0'
3835
},
3936
];
4037

41-
/* Total prize pool */
42-
const TOTAL_POOL = TIERS.reduce((sum, t) => sum + t.amount, 0);
43-
44-
/* ---------------------------------------------------------------
45-
Helper: format with ₹ and Indian locale
46-
--------------------------------------------------------------- */
47-
function formatINR(value) {
48-
return '₹' + Math.round(value).toLocaleString('en-IN');
49-
}
50-
5138
/* ---------------------------------------------------------------
5239
Decorative Barcode Element
5340
--------------------------------------------------------------- */
@@ -63,7 +50,7 @@ function Barcode() {
6350
/* ---------------------------------------------------------------
6451
Interactive Prize Card Component (Data Chip)
6552
--------------------------------------------------------------- */
66-
const PrizeCard = ({ tier, registerRef }) => {
53+
const PrizeCard = ({ tier }) => {
6754
const x = useMotionValue(0);
6855
const y = useMotionValue(0);
6956
const [isHovered, setIsHovered] = useState(false);
@@ -136,10 +123,10 @@ const PrizeCard = ({ tier, registerRef }) => {
136123
{/* Main Amount */}
137124
<div className="prizes__amount-wrapper">
138125
<p
139-
className="prizes__amount"
140-
ref={(el) => registerRef(tier.id, el)}
126+
className="prizes__amount prize-blur"
127+
style={{ filter: "blur(8px)", userSelect: "none", opacity: 0.8 }}
141128
>
142-
0
129+
??,???
143130
</p>
144131
<p className="prizes__label"><span className="prizes__prompt">&gt;</span> {tier.label}</p>
145132
</div>
@@ -157,12 +144,6 @@ const PrizeCard = ({ tier, registerRef }) => {
157144
--------------------------------------------------------------- */
158145
export default function Prizes() {
159146
const sectionRef = useRef(null);
160-
const amountRefs = useRef({});
161-
const totalRef = useRef(null);
162-
163-
const registerRef = (id, el) => {
164-
amountRefs.current[id] = el;
165-
};
166147

167148
useGSAP(() => {
168149
const ctx = sectionRef.current;
@@ -183,45 +164,6 @@ export default function Prizes() {
183164
},
184165
});
185166

186-
/* --- Count-up animation for cards --- */
187-
TIERS.forEach((tier) => {
188-
const el = amountRefs.current[tier.id];
189-
if (!el) return;
190-
191-
const proxy = { val: 0 };
192-
gsap.to(proxy, {
193-
val: tier.amount,
194-
duration: 2.5,
195-
ease: 'power2.out',
196-
delay: tier.modifier === 'first' ? 0.2 : 0.5,
197-
scrollTrigger: {
198-
trigger: ctx,
199-
start: 'top 75%',
200-
},
201-
onUpdate() {
202-
el.textContent = formatINR(proxy.val);
203-
},
204-
});
205-
});
206-
207-
/* --- Count-up for total pool --- */
208-
if (totalRef.current) {
209-
const totalProxy = { val: 0 };
210-
gsap.to(totalProxy, {
211-
val: TOTAL_POOL,
212-
duration: 3,
213-
ease: 'power2.out',
214-
delay: 0.1,
215-
scrollTrigger: {
216-
trigger: ctx,
217-
start: 'top 75%',
218-
},
219-
onUpdate() {
220-
totalRef.current.textContent = Math.round(totalProxy.val).toLocaleString('en-IN');
221-
},
222-
});
223-
}
224-
225167
}, { scope: sectionRef });
226168

227169
return (
@@ -235,17 +177,17 @@ export default function Prizes() {
235177
{/* Total Prize Pool */}
236178
<div className="prizes__total">
237179
<div className="prizes__total-label">Total Prize Pool</div>
238-
<div className="prizes__total-amount">
180+
<div className="prizes__total-amount prize-blur" style={{ filter: "blur(8px)", userSelect: "none", opacity: 0.8 }}>
239181
<span className="prizes__total-currency"></span>
240-
<span ref={totalRef}>0</span>
182+
<span>??,???</span>
241183
</div>
242184
<div className="prizes__total-divider" />
243185
</div>
244186

245187
{/* Tiers */}
246188
<div className="prizes__tiers">
247189
{TIERS.map((tier) => (
248-
<PrizeCard key={tier.id} tier={tier} registerRef={registerRef} />
190+
<PrizeCard key={tier.id} tier={tier} />
249191
))}
250192
</div>
251193

components/registration/discover-container.tsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,22 +251,22 @@ export function DiscoverContainer() {
251251
// Teams looking for members -- only for non-leads who can see the list
252252
shouldFetchLists && !userIsLead
253253
? fetch(
254-
`${API_ENDPOINTS.lookingForMembers}${queryParams}${queryParams ? "&" : "?"}page=${teamsPage}&limit=${ITEMS_PER_PAGE}`,
255-
{ method: "GET", headers },
256-
)
254+
`${API_ENDPOINTS.lookingForMembers}${queryParams}${queryParams ? "&" : "?"}page=${teamsPage}&limit=${ITEMS_PER_PAGE}`,
255+
{ method: "GET", headers },
256+
)
257257
: Promise.resolve(null as any),
258258
// Operators looking for teams
259259
shouldFetchLists
260260
? fetch(
261-
`${API_ENDPOINTS.lookingForTeam}${queryParams}${queryParams ? "&" : "?"}page=${participantsPage}&limit=${ITEMS_PER_PAGE}`,
262-
{ method: "GET", headers },
263-
)
261+
`${API_ENDPOINTS.lookingForTeam}${queryParams}${queryParams ? "&" : "?"}page=${participantsPage}&limit=${ITEMS_PER_PAGE}`,
262+
{ method: "GET", headers },
263+
)
264264
: Promise.resolve(null as any),
265265
// Sent invites by this team -- only if user is the lead of their team
266266
isLeadLocal && user?.teamCode
267267
? fetch(`${API_ENDPOINTS.joinRequest}?teamCode=${user.teamCode}`, {
268-
headers,
269-
})
268+
headers,
269+
})
270270
: Promise.resolve(null as any),
271271
]);
272272
const [teamsSettled, participantsSettled, sentInvitesSettled] = phase2;
@@ -296,7 +296,7 @@ export function DiscoverContainer() {
296296
if (teamsData.data.pagination) {
297297
setTeamsPagination({
298298
totalPages: teamsData.data.pagination.totalPages || 1,
299-
total: teamsData.data.pagination.total || 0,
299+
total: teamsData.data.pagination.totalTeams || 0,
300300
});
301301
}
302302
} else {
@@ -339,7 +339,7 @@ export function DiscoverContainer() {
339339
if (participantsData.data.pagination) {
340340
setParticipantsPagination({
341341
totalPages: participantsData.data.pagination.totalPages || 1,
342-
total: participantsData.data.pagination.total || 0,
342+
total: participantsData.data.pagination.totalUsers || 0,
343343
});
344344
}
345345
} else {
@@ -720,7 +720,7 @@ export function DiscoverContainer() {
720720
<>
721721
{/* HERO. compact operator strip */}
722722
<div className="relative overflow-hidden">
723-
<div className="relative flex items-end justify-between gap-4 flex-wrap">
723+
<div className="relative flex items-end justify-between gap-4 flex-wrap">
724724
<div className="flex flex-col gap-1.5 min-w-0">
725725
<div className="flex items-center gap-2">
726726
<span className="inline-flex w-1.5 h-1.5 rounded-full bg-brand shadow-glow-sm anim-blink" />
@@ -752,14 +752,14 @@ export function DiscoverContainer() {
752752
</div>
753753
</div>
754754

755-
{userHasTeam && !isTeamLead ? (
755+
{userHasTeam && (!isTeamLead || (isTeamLead && teamCapacity && teamCapacity.current >= teamCapacity.max)) ? (
756756
<Card hudCorners>
757757
<div className="flex flex-col items-center justify-center px-6 py-12 text-center gap-4">
758758
<span className="inline-flex w-12 h-12 items-center justify-center rounded-md bg-brand-soft border border-brand/40">
759759
<Lock className="w-5 h-5 text-brand" />
760760
</span>
761761
<div className="font-mono text-[10.5px] uppercase tracking-[0.22em] text-brand">
762-
&gt; Already enlisted
762+
&gt; {isTeamLead ? "Team Full" : "Already enlisted"}
763763
</div>
764764
<h2 className="font-heading text-[22px] font-bold text-ink leading-tight">
765765
You ride with{" "}
@@ -768,7 +768,9 @@ export function DiscoverContainer() {
768768
</span>
769769
</h2>
770770
<p className="text-[13px] text-ink-secondary font-body max-w-[44ch] leading-relaxed">
771-
Leave the current squad if you want to scout new ones. Recruitment is locked to leads only.
771+
{isTeamLead
772+
? "Your squad has reached its maximum capacity. You must remove members if you want to recruit new ones."
773+
: "Leave the current squad if you want to scout new ones. Recruitment is locked to leads only."}
772774
</p>
773775
<Button
774776
onClick={() => router.push("/dashboard")}
@@ -833,7 +835,7 @@ export function DiscoverContainer() {
833835
<div className="px-3 pb-3 pt-1 text-[12px] text-ink-secondary font-body leading-relaxed">
834836
Going public exposes your{" "}
835837
<span className="text-ink">name, bio, organisation, profile picture, resume,
836-
and social links</span>{" "}
838+
and social links</span>{" "}
837839
to other operators. Strip phone numbers, addresses, and personal emails from your resume before publishing.
838840
</div>
839841
</details>
@@ -1218,7 +1220,7 @@ export function DiscoverContainer() {
12181220
}
12191221
disabled={
12201222
participantsPage >=
1221-
participantsPagination.totalPages || isLoading
1223+
participantsPagination.totalPages || isLoading
12221224
}
12231225
className="inline-flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-[0.22em] text-ink-secondary hover:text-brand disabled:opacity-30 disabled:hover:text-ink-secondary disabled:cursor-not-allowed transition-colors px-2 py-1.5 rounded"
12241226
>

0 commit comments

Comments
 (0)