Skip to content

Commit c49e60d

Browse files
committed
Merge remote-tracking branch 'origin' into worktree-1
2 parents 0060bd3 + 4cf0239 commit c49e60d

543 files changed

Lines changed: 46966 additions & 17606 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ web_modules/
8686
.env.production.local
8787
.env.local
8888

89+
# Local working notes / planning docs (never commit)
90+
tasks/
91+
8992
# parcel-bundler cache (https://parceljs.org/)
9093
# .cache handled above
9194
.parcel-cache
@@ -138,7 +141,9 @@ dist
138141

139142
pnpm-lock.yaml
140143
package-lock.json
141-
!next-env.d.ts
144+
# Auto-generated by Next.js; path differs between `next dev` and `next build`
145+
# so we don't track it. Each environment regenerates it locally.
146+
next-env.d.ts
142147
.source
143148
.vercel
144149
.env*.local

app/(home)/build-games/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import BuildGamesPartners from "@/components/build-games/BuildGamesPartners";
99
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/components/ui/accordion";
1010
import type { Metadata } from "next";
1111

12+
export const dynamic = "force-dynamic";
13+
1214
export const metadata: Metadata = {
1315
title: "Build Games 2026 | $1,000,000 Builder Competition on Avalanche",
1416
description: "Join Build Games 2026, a $1,000,000 builder competition on Avalanche. Build innovative projects, compete for prizes, and become part of the Avalanche ecosystem.",
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,5 @@
1-
import type { Metadata } from "next";
2-
import { headers } from "next/headers";
31
import { redirect } from "next/navigation";
4-
import { getAuthSession } from "@/lib/auth/authSession";
5-
import { canAccessBuilderInsights } from "@/lib/auth/permissions";
6-
import { buildReferralUrl } from "@/server/services/referrals";
7-
import {
8-
getBuilderInsightsData,
9-
getBuilderInsightsReferralLinks,
10-
} from "@/server/services/builderInsights";
11-
import { BuilderInsightsDashboard } from "@/components/builder-insights/BuilderInsightsDashboard";
122

13-
export const metadata: Metadata = {
14-
title: "Builder Insights",
15-
description: "Internal Builder Hub account, referral, and event participation analytics.",
16-
};
17-
18-
async function getRequestOrigin(): Promise<string> {
19-
const headersList = await headers();
20-
const host = headersList.get("host");
21-
if (!host) return "https://build.avax.network";
22-
23-
const protocol = headersList.get("x-forwarded-proto") ?? "https";
24-
return `${protocol}://${host}`;
25-
}
26-
27-
export default async function BuilderInsightsPage() {
28-
const session = await getAuthSession();
29-
30-
if (!session?.user?.id || !canAccessBuilderInsights(session.user.custom_attributes)) {
31-
redirect("/");
32-
}
33-
34-
const [data, referralLinks, origin] = await Promise.all([
35-
getBuilderInsightsData(session.user.id),
36-
getBuilderInsightsReferralLinks(session.user.id),
37-
getRequestOrigin(),
38-
]);
39-
40-
return (
41-
<BuilderInsightsDashboard
42-
data={data}
43-
referralLinks={referralLinks.map((link) => ({
44-
id: link.id,
45-
code: link.code,
46-
target_type: link.target_type,
47-
target_id: link.target_id,
48-
destination_url: link.destination_url,
49-
created_at: link.created_at.toISOString(),
50-
shareUrl: buildReferralUrl(origin, link.destination_url, link.code),
51-
}))}
52-
/>
53-
);
3+
export default function BuilderInsightsPage() {
4+
redirect("/profile?tab=insights");
545
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { notFound, redirect } from 'next/navigation';
2+
import type { Metadata } from 'next';
3+
import { createMetadata } from '@/utils/metadata';
4+
import { getAuthSession } from '@/lib/auth/authSession';
5+
import { prisma } from '@/prisma/prisma';
6+
import { getListingForEdit } from '@/server/services/ecosystemCareers/queries';
7+
import { SubmitListingForm } from '@/components/ecosystem-careers/SubmitListingForm';
8+
import '@/components/profile/shell/styles.css';
9+
10+
export const metadata: Metadata = createMetadata({
11+
title: 'Edit listing · Ecosystem Careers',
12+
});
13+
14+
interface Params {
15+
params: Promise<{ id: string }>;
16+
}
17+
18+
export default async function EditListingPage({ params }: Params) {
19+
const { id } = await params;
20+
const session = await getAuthSession();
21+
if (!session?.user?.id) {
22+
redirect(`/login?callbackUrl=/ecosystem-careers/${id}/edit`);
23+
}
24+
25+
const listing = await getListingForEdit(id, session.user.id);
26+
if (!listing || !listing.projectId) notFound();
27+
28+
const project = await prisma.project.findUnique({
29+
where: { id: listing.projectId },
30+
select: { id: true, project_name: true, logo_url: true },
31+
});
32+
if (!project) notFound();
33+
34+
return (
35+
<div className="profile">
36+
<main className="pr-page" style={{ maxWidth: 720, margin: '0 auto', padding: '32px 16px 96px' }}>
37+
<header className="pr-page-head">
38+
<div>
39+
<h1 className="pr-ttl">Edit listing</h1>
40+
<p className="pr-sub">
41+
Updating &ldquo;{listing.title}&rdquo; for {project.project_name}.
42+
</p>
43+
</div>
44+
</header>
45+
<SubmitListingForm
46+
projects={[project]}
47+
listingId={listing.id}
48+
initialValues={{
49+
project_id: project.id,
50+
title: listing.title,
51+
short_description: listing.shortDescription,
52+
description: listing.description ?? '',
53+
location: listing.location ?? '',
54+
remote_type:
55+
(listing.remoteType as 'remote' | 'onsite' | 'hybrid' | null) ?? '',
56+
employment_type:
57+
(listing.employmentType as 'full_time' | 'contract' | 'part_time' | null) ?? '',
58+
seniority: extractYears(listing.seniority),
59+
tags: listing.tags.join(', '),
60+
apply_url: listing.applyUrl,
61+
}}
62+
/>
63+
</main>
64+
</div>
65+
);
66+
}
67+
68+
function extractYears(stored: string | null): string {
69+
if (!stored) return '';
70+
const m = stored.match(/^(\d{1,2})\+\s*years?$/i);
71+
return m ? m[1] : '';
72+
}

0 commit comments

Comments
 (0)