Remove unused imports, packages and add lang
This commit is contained in:
parent
c8d0d1e959
commit
85acc1bdac
@ -3,7 +3,7 @@ import { MutableRefObject, useState, createRef, useEffect } from "react";
|
||||
import { CommandInterface } from "../../../lib/commands";
|
||||
import styles from "../../../styles/Terminal/REPL/REPLInput.module.css";
|
||||
import { useCommands } from "../../../lib/commands/ContextProvider";
|
||||
import { useModalFunctions } from "../contexts/ModalFunctions";
|
||||
//import { useModalFunctions } from "../contexts/ModalFunctions";
|
||||
|
||||
interface REPLInputParams {
|
||||
historyCallback: CallableFunction;
|
||||
@ -20,7 +20,7 @@ const REPLInput: NextPage<REPLInputParams> = ({historyCallback, historyClear, in
|
||||
const [cmdHistory, setCmdHistory] = useState<string[]>([]);
|
||||
const [usrInputTmp, setUsrInputTmp] = useState<string>("");
|
||||
const {cmdContext: cmdIf, updateCallbacks} = useCommands();
|
||||
const { modalFunctions } = useModalFunctions();
|
||||
//const { modalFunctions } = useModalFunctions();
|
||||
|
||||
updateCallbacks({ getCmdHistory: () => cmdHistory });
|
||||
|
||||
|
@ -3,7 +3,6 @@ import REPLInput from "./REPLInput";
|
||||
import REPLHistory from "./REPLHistory";
|
||||
import styles from "../../../styles/Terminal/REPL/REPLComplete.module.css";
|
||||
import type { NextPage } from "next";
|
||||
// import { useCommands } from "../../../lib/commands/ContextProvider";
|
||||
|
||||
interface IREPLProps {
|
||||
inputRef: MutableRefObject<HTMLInputElement|null>;
|
||||
|
@ -9,15 +9,15 @@ function getCommandByName(name: string): Command | undefined {
|
||||
return commandList.find(cmd => cmd.name === name);
|
||||
}
|
||||
|
||||
function illegalUse(raw: string, cmd: Command): string[] {
|
||||
/*function illegalUse(raw: string, cmd: Command): string[] {
|
||||
return [
|
||||
"Syntax error!",
|
||||
`Cannot parse "${raw}"`,
|
||||
""
|
||||
].concat(printSyntax(cmd));
|
||||
}
|
||||
}*/
|
||||
|
||||
function checkFlags(flags: string[], cmd: Command): boolean {
|
||||
/*function checkFlags(flags: string[], cmd: Command): boolean {
|
||||
if (!flags || flags.length === 0) return true;
|
||||
if (!cmd.flags) return false;
|
||||
|
||||
@ -27,9 +27,9 @@ function checkFlags(flags: string[], cmd: Command): boolean {
|
||||
if (!flagObj) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
function checkSubcmd(subcmds: string[], cmd: Command): boolean {
|
||||
/*function checkSubcmd(subcmds: string[], cmd: Command): boolean {
|
||||
if (!subcmds || subcmds.length === 0) return true;
|
||||
if (!cmd.subcommands) return false;
|
||||
|
||||
@ -38,7 +38,7 @@ function checkSubcmd(subcmds: string[], cmd: Command): boolean {
|
||||
if (!flagObj) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
function checkFlagInclude(flagsProvided: string[], flag: Flag): boolean {
|
||||
if (!flag) return false;
|
||||
|
@ -3,5 +3,9 @@ module.exports = {
|
||||
reactStrictMode: true,
|
||||
images: {
|
||||
domains: ["openai-labs-public-images-prod.azureedge.net"]
|
||||
},
|
||||
i18n: {
|
||||
locales: ["en"],
|
||||
defaultLocale: "en",
|
||||
}
|
||||
};
|
17
package-lock.json
generated
17
package-lock.json
generated
@ -13,8 +13,7 @@
|
||||
"node-fetch": "^3.2.0",
|
||||
"phosphor-react": "^1.3.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"swr": "^1.1.2"
|
||||
"react-dom": "17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color": "^3.0.3",
|
||||
@ -3351,14 +3350,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/swr": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/swr/-/swr-1.2.2.tgz",
|
||||
"integrity": "sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.11.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/table": {
|
||||
"version": "6.8.0",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz",
|
||||
@ -5973,12 +5964,6 @@
|
||||
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
||||
"dev": true
|
||||
},
|
||||
"swr": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/swr/-/swr-1.2.2.tgz",
|
||||
"integrity": "sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==",
|
||||
"requires": {}
|
||||
},
|
||||
"table": {
|
||||
"version": "6.8.0",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz",
|
||||
|
@ -15,8 +15,7 @@
|
||||
"node-fetch": "^3.2.0",
|
||||
"phosphor-react": "^1.3.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"swr": "^1.1.2"
|
||||
"react-dom": "17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color": "^3.0.3",
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type { AppProps } from "next/app";
|
||||
import Head from "next/head";
|
||||
import "../styles/globals.css";
|
||||
//import "../styles/customAsciidoc.scss";
|
||||
import { CommandsProvider } from "../lib/commands/ContextProvider";
|
||||
import { ModalFunctionProvider } from "../components/Terminal/contexts/ModalFunctions";
|
||||
|
||||
|
@ -1,19 +1,13 @@
|
||||
import type { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import useSWR from "swr";
|
||||
import type { ContentList } from "../lib/content/types";
|
||||
import Navigation from "../components/Blog/Navigation";
|
||||
import ProjectCard from "../components/Blog/Card";
|
||||
import Spinner from "../components/Spinner";
|
||||
import styles from "../styles/Blog/Front.module.scss";
|
||||
|
||||
const Blog: NextPage<{ content: ContentList }> = ({content}) => {
|
||||
//const { data: projectList, error } = useSWR("/content/list.json", (...args) => fetch(...args).then(res => res.json()));
|
||||
|
||||
const generateCards = (type: string) => {
|
||||
//if (error) return <div>Error on fetching projects.</div>;
|
||||
//if (!projectList) return <Spinner size={200} color={"#ff0000"} />;
|
||||
/*else*/ return <div className={styles.contentList}>{content.filter(p => p.type === type).map(p => <ProjectCard key={p.name} title={p.title} description={p.desc.join(" ")} />)}</div>;
|
||||
return <div className={styles.contentList}>{content.filter(p => p.type === type).map(p => <ProjectCard key={p.name} title={p.title} description={p.desc.join(" ")} />)}</div>;
|
||||
};
|
||||
|
||||
return <>
|
||||
|
Loading…
Reference in New Issue
Block a user