diff --git a/src/components/Home/index.tsx b/src/components/Home/index.tsx
index ddc0ff2..b28b90d 100644
--- a/src/components/Home/index.tsx
+++ b/src/components/Home/index.tsx
@@ -4,6 +4,7 @@ import { DiscordButton } from "../DiscordButton"
import { HomePartner } from "../HomePartner"
import { WavesBottom, WavesTop } from "../Waves"
import * as SC from "./styles"
+import { OutMode, MoveDirection } from "react-particles-js"
interface IMenuItemProps {
to: string
@@ -33,6 +34,7 @@ export const Home: FC = () => {
{
move: {
enable: true,
speed: 1.5,
- direction: "top",
+ direction: MoveDirection.top,
random: false,
straight: false,
- out_mode: "out",
+ out_mode: OutMode.out,
bounce: false,
attract: { enable: false },
},
@@ -67,7 +69,7 @@ export const Home: FC = () => {
- The Programmer's Hangout
+ The Programmer's Hangout
diff --git a/src/components/ResourcesList/index.tsx b/src/components/ResourcesList/index.tsx
index c4aa884..aeba34c 100644
--- a/src/components/ResourcesList/index.tsx
+++ b/src/components/ResourcesList/index.tsx
@@ -67,6 +67,8 @@ const Language = memo(
}
)
+Language.displayName = "Language"
+
function sortTree(tree: IFileOrFolder[]) {
return sort((a, b) => a.title.localeCompare(b.title), tree)
}
diff --git a/src/components/ResourcesSidebar/index.tsx b/src/components/ResourcesSidebar/index.tsx
index 3742d20..c4821fa 100644
--- a/src/components/ResourcesSidebar/index.tsx
+++ b/src/components/ResourcesSidebar/index.tsx
@@ -141,6 +141,8 @@ const FirstLevelFolder = memo(({ item }: { item: IFolder }) => {
)
})
+FirstLevelFolder.displayName = "FirstLevelFolder"
+
const ResourceList: FC<{
items: IFileOrFolder[]
setExpanded: React.Dispatch>
diff --git a/src/components/ResourcesSidebar/useMatchingPath.tsx b/src/components/ResourcesSidebar/useMatchingPath.tsx
index a0db98e..d0865b1 100644
--- a/src/components/ResourcesSidebar/useMatchingPath.tsx
+++ b/src/components/ResourcesSidebar/useMatchingPath.tsx
@@ -8,5 +8,5 @@ export default function useMatchingPath(path: string, callback: () => void) {
if (isMatchingPath(path)) {
callback()
}
- }, [])
+ }, [path, isMatchingPath, callback])
}
diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx
index 761c59b..6e41340 100644
--- a/src/components/Sidebar/index.tsx
+++ b/src/components/Sidebar/index.tsx
@@ -28,7 +28,7 @@ export const Sidebar: FC>> = (
The
- Programmer's
+ Programmer's
Hangout
diff --git a/src/components/Toc/index.tsx b/src/components/Toc/index.tsx
index fc56f07..a1c8dfb 100644
--- a/src/components/Toc/index.tsx
+++ b/src/components/Toc/index.tsx
@@ -11,7 +11,7 @@ interface ITocProps {
}
interface ITitle {
- prefix?: string
+ prefix: string | null
title: string
}
@@ -20,7 +20,7 @@ function extractTitle(title: string): ITitle {
const rest = maybePrefix ? title.replace(maybePrefix[0], "") : title
return {
- prefix: maybePrefix ? `${maybePrefix[0]} ` : undefined,
+ prefix: maybePrefix ? `${maybePrefix[0]} ` : null,
title: rest.trim(),
}
}
diff --git a/src/hooks/useLocalStorage.tsx b/src/hooks/useLocalStorage.tsx
index dd8cfa1..8cea92a 100644
--- a/src/hooks/useLocalStorage.tsx
+++ b/src/hooks/useLocalStorage.tsx
@@ -1,3 +1,4 @@
+/* globals window */
import { useEffect, useState } from "react"
export const useLocalStorage = (name: string, initialValue: string) => {
diff --git a/src/hooks/useLockBodyScroll.tsx b/src/hooks/useLockBodyScroll.tsx
index b11dd56..098556f 100644
--- a/src/hooks/useLockBodyScroll.tsx
+++ b/src/hooks/useLockBodyScroll.tsx
@@ -1,3 +1,4 @@
+/* globals document */
import { useState } from "react"
export const useLockBodyScroll = () => {
diff --git a/src/layouts/HomeLayout/index.tsx b/src/layouts/HomeLayout/index.tsx
index 9e27ee3..9280a3c 100644
--- a/src/layouts/HomeLayout/index.tsx
+++ b/src/layouts/HomeLayout/index.tsx
@@ -15,7 +15,7 @@ export const HomeLayout: FC = () => {
if (locked) {
unlock()
}
- }, [locked])
+ }, [locked, unlock])
return (
diff --git a/src/pages/archives/404.tsx b/src/pages/archives/404.tsx
index bea9bc2..6e86591 100644
--- a/src/pages/archives/404.tsx
+++ b/src/pages/archives/404.tsx
@@ -9,7 +9,10 @@ import { SEO } from "../../components/SEO"
import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { FourZeroFour } from "../../components/FourZeroFour"
-export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
+// TODO: there has to be a better type for this
+const FourZeroFourPage: React.FC<{ data: { allFile: FileConnection } }> = ({
+ data,
+}: ComponentQuery<{ allFile: FileConnection }>) => (
@@ -26,6 +29,8 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
)
+export default FourZeroFourPage
+
export const query = graphql`
query {
allFile(filter: { sourceInstanceName: { eq: "what-is-archive" } }) {
diff --git a/src/pages/archives/index.tsx b/src/pages/archives/index.tsx
index 9e3fefd..310fb22 100644
--- a/src/pages/archives/index.tsx
+++ b/src/pages/archives/index.tsx
@@ -17,7 +17,7 @@ function ArchivesPage() {
This regroups the archives of our occasional, temporary channels
that cover a piece of technology that might be unknown to part of
our users. You can find those on{" "}
- The Programmer's Hangout.
+ The Programmer's Hangout.
}
/>
diff --git a/src/pages/resources/404.tsx b/src/pages/resources/404.tsx
index cfda1f8..cf6fbe5 100644
--- a/src/pages/resources/404.tsx
+++ b/src/pages/resources/404.tsx
@@ -8,7 +8,10 @@ import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { SEO } from "../../components/SEO"
import { FourZeroFour } from "../../components/FourZeroFour"
-export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
+// TODO: there has to be a better type for this
+const FourZeroFourPage: React.FC<{ data: { allFile: FileConnection } }> = ({
+ data,
+}: ComponentQuery<{ allFile: FileConnection }>) => (
@@ -25,6 +28,8 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
)
+export default FourZeroFourPage
+
export const query = graphql`
query {
allFile(filter: { sourceInstanceName: { eq: "resources" } }) {
diff --git a/src/pages/resources/index.tsx b/src/pages/resources/index.tsx
index dc9413e..7badac6 100644
--- a/src/pages/resources/index.tsx
+++ b/src/pages/resources/index.tsx
@@ -18,7 +18,7 @@ function ResourcesPage() {
This is meant as a small knowledge base for commonly answered
questions on our Discord community,{" "}
- The Programmer's Hangout.
+ The Programmer's Hangout.
All of it is open source, and you can contribute to it on{" "}
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 5a92dad..3e94d0c 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -146,7 +146,7 @@ export function buildToc(headings: Mdx["headings"]): ITocItem[] {
return []
}
- const strip = (value: string) => value.replace(/^(\d*\-)(.*)/, "$2")
+ const strip = (value: string) => value.replace(/^(\d*-)(.*)/, "$2")
slugger.reset()
diff --git a/tsconfig.json b/tsconfig.json
index 3bcb642..493e832 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -4,7 +4,7 @@
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
- "lib": ["ES2019"], /* Specify library files to be included in the compilation. */
+ "lib": ["ES2019", "DOM"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
"jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */