Skip to content
Merged
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
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const nextConfig = {
// Optimize for AWS deployment
output: 'standalone',

experimental: {
nextScriptWorkers: true,
},
experimental: {},
};

module.exports = nextConfig;
Expand Down
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"yaml": "^2.6.1"
},
"devDependencies": {
"@builder.io/partytown": "^0.10.3",
"@types/hast": "^3.0.4",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
Expand All @@ -70,4 +69,4 @@
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2"
}
}
}
6 changes: 3 additions & 3 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function InCTFJrWebApp({ Component, pageProps }) {
{/* Google Analytics */}
{gaId && (
<>
<Script src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`} strategy="worker" />
<Script id="google-analytics" strategy="worker">
<Script src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`} strategy="afterInteractive" />
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
Expand All @@ -57,7 +57,7 @@ export default function InCTFJrWebApp({ Component, pageProps }) {
)}

{/* InCTF SDK */}
<Script src="https://play.inctf.in/sdk.js" strategy="worker" />
<Script src="https://play.inctf.in/sdk.js" strategy="afterInteractive" />
</>
);
}
22 changes: 0 additions & 22 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,8 @@ class MyDocument extends Document {
rel="stylesheet"
/>

{/* Google Tag Manager */}
<script
dangerouslySetInnerHTML={{
__html: `
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-56DCPP26');
`,
}}
/>
</Head>
<body suppressHydrationWarning={true}>
{/* Google Tag Manager (noscript) - Must be right after opening <body> tag */}
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-56DCPP26"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
/>
</noscript>

<Main />
<NextScript />
</body>
Expand Down
12 changes: 1 addition & 11 deletions src/components/SiteView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ const SiteView = ({ meta, children }: AppView) => {
return (
<ConfigContext.Provider value={eventConfig}>
<SiteViewHeadTags meta={meta} />

{/* GTM noscript - Add this at the very beginning */}
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-56DCPP26"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
/>
</noscript>


<main>
{children}
</main>
Expand Down
38 changes: 2 additions & 36 deletions src/components/shared/Base.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import React, { useEffect } from 'react';
import Head from 'next/head';
import Script from 'next/script';

const seoTags = {
siteName: 'InCTF 2026',
tagLine: 'Indias First Ethical Hacking contest.',
description: 'Capture the Flag contest. Indias first hacking competition. Play CTFs, win prizes and get placed with our sponsors.',
tagLine: 'India\'s First Ethical Hacking contest.',
description: 'Capture the Flag contest. India\'s first hacking competition. Play CTFs, win prizes and get placed with our sponsors.',
};

const Base = ({ children, meta }) => {

const title = `${meta && meta.title ? `${meta.title} |` : ''} ${seoTags.siteName} - ${seoTags.tagLine}`;
const GTMId = 'GTM-56DCPP26';

useEffect(() => {
// Only run in browser
Expand All @@ -25,19 +23,6 @@ const Base = ({ children, meta }) => {
}, []);

return (<React.Fragment>
{/* Google Tag Manager */}
<Script
id="gtm-script"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${GTMId}');`,
}}
/>

<Head>
<title>{title}</title>
<meta charSet="utf-8" />
Expand All @@ -58,27 +43,8 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
<link href="/images/icons/icon-384x384.png" rel="icon" type="image/png" sizes="384x384" />
<link rel="apple-touch-icon" href="/images/icons/icon-512x512.png" />
<link rel="shortcut icon" href="/images/icons/icon-72x72.png" />

{/* { GoogleAnalyticsID && <React.Fragment>
<script rel="preconnect" async src={`https://www.googletagmanager.com/gtag/js?id=${GoogleAnalyticsID}`} />
<script
dangerouslySetInnerHTML={{
__html: `window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${GoogleAnalyticsID}');`,
}}
/>
</React.Fragment>} */}
</Head>

{/* Google Tag Manager (noscript) */}
<noscript>
<iframe
src={`https://www.googletagmanager.com/ns.html?id=${GTMId}`}
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
/>
</noscript>

<div className="app" suppressHydrationWarning>
{children}
{/*<SupportDesk />*/}
Expand Down