Skip to content
Draft
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 next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ function contentSecurityPolicyReportOnly() {
// Widget in Global/Layout renders. Currently unreachable (its Modal is
// never opened), so it produces no violations today; allow-listed because
// re-arming it is a one-line change and the failure would be a blank
// iframe under enforcement.
"frame-src 'self' https://*.crisp.chat https://*.sumsub.com https://widget.manteca.dev https://mpago.la https://*.bridge.xyz https://form.typeform.com",
// iframe under enforcement. The creator contest stays on its own Vercel
// project and is framed by /creator-contest.
"frame-src 'self' https://*.crisp.chat https://*.sumsub.com https://widget.manteca.dev https://mpago.la https://*.bridge.xyz https://form.typeform.com https://peanut-contest.vercel.app",
"worker-src 'self' blob:",
"object-src 'none'",
"base-uri 'self'",
Expand Down
17 changes: 17 additions & 0 deletions src/app/creator-contest/__tests__/page.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { render, screen } from '@testing-library/react'
import CreatorContestPage from '../page'

describe('CreatorContestPage', () => {
it('embeds the contest with the required iframe permissions', () => {
render(<CreatorContestPage />)

const iframe = screen.getByTitle('Peanut Creator Contest')
expect(iframe).toHaveAttribute('src', 'https://peanut-contest.vercel.app/')
expect(iframe).toHaveAttribute('allow', 'storage-access *')
expect(iframe).toHaveAttribute(
'sandbox',
'allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-storage-access-by-user-activation'
)
expect(iframe).toHaveAttribute('referrerpolicy', 'strict-origin-when-cross-origin')
})
})
22 changes: 22 additions & 0 deletions src/app/creator-contest/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { type Metadata } from 'next'

export const metadata: Metadata = {
title: 'Peanut Creator Contest',
description: 'The Peanut content contest for creators in Brazil.',
robots: { index: false, follow: false },
}

export default function CreatorContestPage() {
return (
<main className="h-[100dvh] w-full bg-white">
<iframe
src="https://peanut-contest.vercel.app/"
title="Peanut Creator Contest"
className="h-full w-full border-0"
allow="storage-access *"
sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-storage-access-by-user-activation"
referrerPolicy="strict-origin-when-cross-origin"
/>
</main>
)
}
1 change: 1 addition & 0 deletions src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const DEDICATED_ROUTES = [
'lp',
'exchange',
'shhhhh',
'creator-contest',

// Future SEO routes (pre-register so catch-all doesn't intercept)
'send-money-to',
Expand Down
Loading