+
{nextPageSelector}
diff --git a/components/Terminal/REPL/REPLHistory.tsx b/components/Terminal/REPL/REPLHistory.tsx
index a559d61..a599197 100644
--- a/components/Terminal/REPL/REPLHistory.tsx
+++ b/components/Terminal/REPL/REPLHistory.tsx
@@ -1,7 +1,7 @@
import { NextPage } from "next";
import Link from "next/link";
import type { BaseSyntheticEvent, MutableRefObject } from "react";
-import styles from "../../../styles/REPL/REPLHistory.module.css";
+import styles from "../../../styles/Terminal/REPL/REPLHistory.module.css";
interface REPLHistoryParams {
history: string[];
diff --git a/components/Terminal/REPL/REPLInput.tsx b/components/Terminal/REPL/REPLInput.tsx
index e0865a0..8667830 100644
--- a/components/Terminal/REPL/REPLInput.tsx
+++ b/components/Terminal/REPL/REPLInput.tsx
@@ -1,7 +1,7 @@
import type { NextPage } from "next";
import { MutableRefObject, useState, createRef, useEffect } from "react";
import { CommandInterface } from "../../../lib/commands";
-import styles from "../../../styles/REPL/REPLInput.module.css";
+import styles from "../../../styles/Terminal/REPL/REPLInput.module.css";
import { useCommands } from "../../../lib/commands/ContextProvider";
import { useModalFunctions } from "../contexts/ModalFunctions";
diff --git a/components/Terminal/REPL/index.tsx b/components/Terminal/REPL/index.tsx
index 0516c22..cb62ebd 100644
--- a/components/Terminal/REPL/index.tsx
+++ b/components/Terminal/REPL/index.tsx
@@ -1,9 +1,9 @@
import { MutableRefObject, useEffect, useRef, useState } from "react";
import REPLInput from "./REPLInput";
import REPLHistory from "./REPLHistory";
-import styles from "../../../styles/REPL/REPLComplete.module.css";
+import styles from "../../../styles/Terminal/REPL/REPLComplete.module.css";
import type { NextPage } from "next";
-import { useCommands } from "../../../lib/commands/ContextProvider";
+// import { useCommands } from "../../../lib/commands/ContextProvider";
interface IREPLProps {
inputRef: MutableRefObject
;
diff --git a/components/Terminal/contexts/ModalFunctions.tsx b/components/Terminal/contexts/ModalFunctions.tsx
index bddcbb0..54cdbdd 100644
--- a/components/Terminal/contexts/ModalFunctions.tsx
+++ b/components/Terminal/contexts/ModalFunctions.tsx
@@ -1,6 +1,6 @@
import { createContext, useContext } from "react";
import type { PropsWithChildren } from "react";
-import type { Project, Diary } from "../../lib/content/types";
+import type { Project, Diary } from "../../../lib/content/types";
interface ModalFunctions {
setVisible?: CallableFunction;
diff --git a/lib/commands/definitions.ts b/lib/commands/definitions.ts
index 3c32698..10eb1d7 100644
--- a/lib/commands/definitions.ts
+++ b/lib/commands/definitions.ts
@@ -3,7 +3,7 @@ import type { Command, Flag } from "./types";
import Color from "color";
import { getColors, setColors } from "../colors";
import Rainbow from "../colors";
-import styles from "../../styles/Random.module.scss";
+import styles from "../../styles/Terminal/Random.module.scss";
function getCommandByName(name: string): Command | undefined {
return commandList.find(cmd => cmd.name === name);
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 5788baf..cf09ab4 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,7 +1,7 @@
import type { AppProps } from "next/app";
import Head from "next/head";
import "../styles/globals.css";
-import "../styles/customAsciidoc.scss";
+//import "../styles/customAsciidoc.scss";
import { CommandsProvider } from "../lib/commands/ContextProvider";
import { ModalFunctionProvider } from "../components/Terminal/contexts/ModalFunctions";
diff --git a/pages/index.tsx b/pages/index.tsx
index ecb969b..8beb67c 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -9,6 +9,12 @@ import Spinner from "../components/Spinner";
const Blog: NextPage<{}> = () => {
const { data: projectList, error } = useSWR("/content/list.json", (...args) => fetch(...args).then(res => res.json()));
+ const generateCards = (type: string) => {
+ if (error) return Error on fetching projects.
;
+ if (!projectList) return ;
+ else return {(projectList as ContentList).filter(p => p.type === type).map(p =>
)}
;
+ };
+
return <>
c0ntroller.de
@@ -18,11 +24,11 @@ const Blog: NextPage<{}> = () => {
Miaumiau Lorem ipsum
Projects
{
- projectList ? (projectList as ContentList).filter(p => p.type === "project").map(p => ) :
+ generateCards("project")
}
Diaries
{
- projectList ? (projectList as ContentList).filter(p => p.type === "diary").map(p => ) :
+ generateCards("diary")
}
>;
diff --git a/pages/terminal.tsx b/pages/terminal.tsx
index dd62295..d6f10b9 100644
--- a/pages/terminal.tsx
+++ b/pages/terminal.tsx
@@ -6,7 +6,7 @@ import { useCommands } from "../lib/commands/ContextProvider";
import { useModalFunctions } from "../components/Terminal/contexts/ModalFunctions";
import ProjectModal from "../components/Terminal/ProjectModal";
import REPL from "../components/Terminal/REPL";
-import styles from "../styles/Home.module.css";
+import styles from "../styles/Terminal/Terminal.module.css";
import type { ContentList } from "../lib/content/types";
import { useRouter } from "next/router";
import Rainbow from "../lib/colors";
diff --git a/styles/ProjectModal.module.css b/styles/Terminal/ProjectModal.module.css
similarity index 100%
rename from styles/ProjectModal.module.css
rename to styles/Terminal/ProjectModal.module.css
diff --git a/styles/REPL/REPLComplete.module.css b/styles/Terminal/REPL/REPLComplete.module.css
similarity index 100%
rename from styles/REPL/REPLComplete.module.css
rename to styles/Terminal/REPL/REPLComplete.module.css
diff --git a/styles/REPL/REPLHistory.module.css b/styles/Terminal/REPL/REPLHistory.module.css
similarity index 100%
rename from styles/REPL/REPLHistory.module.css
rename to styles/Terminal/REPL/REPLHistory.module.css
diff --git a/styles/REPL/REPLInput.module.css b/styles/Terminal/REPL/REPLInput.module.css
similarity index 100%
rename from styles/REPL/REPLInput.module.css
rename to styles/Terminal/REPL/REPLInput.module.css
diff --git a/styles/Random.module.scss b/styles/Terminal/Random.module.scss
similarity index 100%
rename from styles/Random.module.scss
rename to styles/Terminal/Random.module.scss
diff --git a/styles/Home.module.css b/styles/Terminal/Terminal.module.css
similarity index 96%
rename from styles/Home.module.css
rename to styles/Terminal/Terminal.module.css
index e83e428..1bbb40c 100644
--- a/styles/Home.module.css
+++ b/styles/Terminal/Terminal.module.css
@@ -4,6 +4,8 @@
height: 100vh;
margin: 0;
padding: 2px 10px 10px 10px;
+ color: var(--repl-color);
+ background: #000;
}
.header {
diff --git a/styles/asciidocBootSlate.css b/styles/Terminal/asciidocBootSlate.css
similarity index 100%
rename from styles/asciidocBootSlate.css
rename to styles/Terminal/asciidocBootSlate.css
diff --git a/styles/customAsciidoc.scss b/styles/Terminal/customAsciidoc.module.scss
similarity index 100%
rename from styles/customAsciidoc.scss
rename to styles/Terminal/customAsciidoc.module.scss
diff --git a/styles/globals.css b/styles/globals.css
index 09e9bc6..431bc96 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -16,6 +16,4 @@
body {
margin: 0;
padding: 0;
- color: var(--repl-color);
- background: #000;
}