diff --git a/jsconfig.json b/jsconfig.json
deleted file mode 100644
index 3b9faef..0000000
--- a/jsconfig.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "compilerOptions": {
- "baseUrl": ".",
- "paths": {
- "@/components/*": ["./src/components/*"],
- "@/utils/*": ["./src/utils/*"],
- "@/public/*": ["./public/*"],
- "@/locales/*": ["./locales/*"],
- "@/app/*": ["./src/app/*"]
- }
- }
-}
diff --git a/next-env.d.ts b/next-env.d.ts
new file mode 100644
index 0000000..4f11a03
--- /dev/null
+++ b/next-env.d.ts
@@ -0,0 +1,5 @@
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/next.config.js b/next.config.js
index 2b08ebc..c7ab72f 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,4 +1,8 @@
-/** @type {import('next').NextConfig} */
+// @ts-check
+
+/**
+ * @type {import('next').NextConfig}
+ **/
const nextConfig = {
reactStrictMode: true,
@@ -8,28 +12,28 @@ const nextConfig = {
protocol: 'https',
hostname: 'github.com',
port: '',
- pathname: '/**'
+ pathname: '/**',
},
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
port: '',
- pathname: '/u/**'
+ pathname: '/u/**',
},
{
protocol: 'https',
hostname: 'github.githubassets.com',
port: '',
- pathname: '/images/**'
+ pathname: '/images/**',
},
{
protocol: 'https',
hostname: 'cdn.discordapp.com',
port: '',
- pathname: '/avatars/**'
- }
- ]
- }
+ pathname: '/avatars/**',
+ },
+ ],
+ },
};
export default nextConfig;
diff --git a/package-lock.json b/package-lock.json
index f43d126..187d54e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,6 +32,9 @@
"sharp": "^0.32.5"
},
"devDependencies": {
+ "@types/fs-extra": "^11.0.4",
+ "@types/lodash.merge": "^4.6.9",
+ "@types/react": "18.3.3",
"eslint-config-next": "^13.4.19"
}
},
@@ -1580,6 +1583,16 @@
"@types/ms": "*"
}
},
+ "node_modules/@types/fs-extra": {
+ "version": "11.0.4",
+ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz",
+ "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/jsonfile": "*",
+ "@types/node": "*"
+ }
+ },
"node_modules/@types/http-cache-semantics": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz",
@@ -1591,6 +1604,15 @@
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
"dev": true
},
+ "node_modules/@types/jsonfile": {
+ "version": "6.1.4",
+ "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz",
+ "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
"node_modules/@types/keyv": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
@@ -1599,6 +1621,21 @@
"@types/node": "*"
}
},
+ "node_modules/@types/lodash": {
+ "version": "4.17.5",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.5.tgz",
+ "integrity": "sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==",
+ "dev": true
+ },
+ "node_modules/@types/lodash.merge": {
+ "version": "4.6.9",
+ "resolved": "https://registry.npmjs.org/@types/lodash.merge/-/lodash.merge-4.6.9.tgz",
+ "integrity": "sha512-23sHDPmzd59kUgWyKGiOMO2Qb9YtqRO/x4IhkgNUiPQ1+5MUVqi6bCZeq9nBJ17msjIMbEIO5u+XW4Kz6aGUhQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/lodash": "*"
+ }
+ },
"node_modules/@types/ms": {
"version": "0.7.34",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz",
@@ -1612,11 +1649,27 @@
"undici-types": "~5.26.4"
}
},
+ "node_modules/@types/prop-types": {
+ "version": "15.7.12",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz",
+ "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==",
+ "dev": true
+ },
"node_modules/@types/qs": {
"version": "6.9.15",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz",
"integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg=="
},
+ "node_modules/@types/react": {
+ "version": "18.3.3",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz",
+ "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==",
+ "dev": true,
+ "dependencies": {
+ "@types/prop-types": "*",
+ "csstype": "^3.0.2"
+ }
+ },
"node_modules/@types/responselike": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz",
@@ -2437,6 +2490,12 @@
"node": ">= 8"
}
},
+ "node_modules/csstype": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
+ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
+ "dev": true
+ },
"node_modules/damerau-levenshtein": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
diff --git a/package.json b/package.json
index 4ad4420..c51e49d 100755
--- a/package.json
+++ b/package.json
@@ -34,6 +34,9 @@
"sharp": "^0.32.5"
},
"devDependencies": {
+ "@types/fs-extra": "^11.0.4",
+ "@types/lodash.merge": "^4.6.9",
+ "@types/react": "18.3.3",
"eslint-config-next": "^13.4.19"
},
"browserslist": [
diff --git a/src/app/layout.js b/src/app/layout.tsx
similarity index 94%
rename from src/app/layout.js
rename to src/app/layout.tsx
index 6ae71e0..195506d 100755
--- a/src/app/layout.js
+++ b/src/app/layout.tsx
@@ -11,7 +11,7 @@ const poppins = Poppins({
subsets: ['latin'], // this is the preloaded subset, all subsets will be available
});
-export default function RootLayout({ children }) {
+export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
@@ -19,7 +19,7 @@ export default function RootLayout({ children }) {
{children}
@@ -60,7 +60,6 @@ export const metadata = {
card: 'summary_large_image',
site: '@PretendoNetwork',
creator: '@PretendoNetwork',
- url: 'https://pretendo.network/',
images: ['https://pretendo.network/assets/images/opengraph/opengraph-image.png'],
},
robots: {
diff --git a/src/app/page.js b/src/app/page.tsx
similarity index 85%
rename from src/app/page.js
rename to src/app/page.tsx
index 0fefe51..04021be 100644
--- a/src/app/page.js
+++ b/src/app/page.tsx
@@ -11,7 +11,7 @@ import ShowcaseSection from '@/components/ShowcaseSection/ShowcaseSection';
import { getLocale } from '@/utils/locale';
-import ImageFix from '@/components/ImageFix/ImageFix';
+import Image, { StaticImageData } from 'next/image';
import styles from './page.module.css';
@@ -20,14 +20,26 @@ import networkImage from '@/public/assets/images/showcase/network.png';
import pcmouseImage from '@/public/assets/images/showcase/pcmouse.png';
import wiiuchatImage from '@/public/assets/images/showcase/wiiuchat.png';
-const showcaseImages = {
+interface ShowcaseImages {
+ [key: string]: StaticImageData;
+}
+
+const showcaseImages: ShowcaseImages = {
juxt: juxtImage,
network: networkImage,
pcmouse: pcmouseImage,
wiiuchat: wiiuchatImage,
};
-export default function Home(ctx) {
+interface TeamMemberObject {
+ special: boolean;
+ name: string;
+ caption: string;
+ picture: string;
+ github: string;
+}
+
+export default function Home() {
const { locale } = getLocale('TODO');
return (
@@ -42,7 +54,7 @@ export default function Home(ctx) {
Our project has many components. Here are some of them.
- {locale.showcase.map((el, i) => {
+ {locale.showcase.map((el: { title: string; caption: string; image: string }, i: number) => {
return (
- {locale.credits.text}
- {locale.credits.people.map((el, i) => {
+ {locale.credits.people.map((el: TeamMemberObject, i: number) => {
return (
);
@@ -108,7 +120,7 @@ export default function Home(ctx) {
let ar = locale.specialThanks.people;
ar = ar.slice(0, Math.round(ar.length / 2));
ar = ar.concat(ar).concat(ar);
- return ar.map((el, i) => {
+ return ar.map((el: TeamMemberObject, i: number) => {
return (
= i) - 1}
+ tabIndex={Math.round(ar.length / 4) >= i ? 0 : 1}
/>
);
});
@@ -130,7 +142,7 @@ export default function Home(ctx) {
let ar = locale.specialThanks.people;
ar = ar.slice(Math.round(ar.length / 2));
ar = ar.concat(ar).concat(ar);
- return ar.map((el, i) => {
+ return ar.map((el: TeamMemberObject, i: number) => {
return (
= i) - 1}
+ tabIndex={Math.round(ar.length / 4) >= i ? 0 : 1}
/>
);
});
diff --git a/src/components/Bandwidth/Bandwidth.js b/src/components/Bandwidth/Bandwidth.tsx
similarity index 96%
rename from src/components/Bandwidth/Bandwidth.js
rename to src/components/Bandwidth/Bandwidth.tsx
index 90759a8..800211f 100644
--- a/src/components/Bandwidth/Bandwidth.js
+++ b/src/components/Bandwidth/Bandwidth.tsx
@@ -3,6 +3,8 @@
import { useState } from 'react';
import classNames from 'classnames';
+import { CSSProperties, MouseEventHandler, AnimationEventHandler } from 'react';
+
import styles from './Bandwidth.module.css';
/**
@@ -20,10 +22,24 @@ import styles from './Bandwidth.module.css';
*
*/
-export default function Bandwidth(ctx) {
+interface VanillaBandwidthProps {
+ size?: number;
+ className?: string;
+ style?: CSSProperties;
+ onClick?: MouseEventHandler;
+ onAnimationEnd?: AnimationEventHandler;
+}
+
+interface BandwidthProps extends VanillaBandwidthProps {
+ lines?: Array;
+ alwaysShowBubble?: boolean;
+ alignBubble?: 'left' | 'center' | 'right';
+}
+
+export default function Bandwidth(ctx: BandwidthProps) {
const { lines = [], size = 192, alwaysShowBubble = false, alignBubble = 'center', className, style } = ctx;
- const [lineIndex, setLineIndex] = useState(-1 + alwaysShowBubble);
+ const [lineIndex, setLineIndex] = useState(-1 + +alwaysShowBubble);
const [jump, setJump] = useState(false || alwaysShowBubble);
const active = lineIndex > -1;
@@ -49,7 +65,7 @@ export default function Bandwidth(ctx) {
)}
updateLine()}
className={classNames(styles.bandwidth, { [styles.jump]: jump })}
onAnimationEnd={() => setJump(false)}
/>
@@ -70,12 +86,11 @@ export default function Bandwidth(ctx) {
*
*/
-export const VanillaBandwidth = (ctx) => {
+export const VanillaBandwidth = (ctx: VanillaBandwidthProps) => {
const { size = 192, className, style, onClick, onAnimationEnd } = ctx;
return (