Lint
This commit is contained in:
parent
7ac2a6a663
commit
36b0b16059
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "next/core-web-vitals",
|
"extends": "next/core-web-vitals",
|
||||||
"rules": {
|
"rules": {
|
||||||
"semi": ["warn", "always"],
|
"semi": ["warn", "always", { "omitLastInOneLineBlock": true }],
|
||||||
"quotes": ["warn", "double"],
|
"quotes": ["warn", "double"],
|
||||||
"eqeqeq": "error"
|
"eqeqeq": "error"
|
||||||
}
|
}
|
||||||
|
@ -34,30 +34,30 @@ const ProjectModal: NextPage<ModalInput> = ({ project, visible, setVisible }) =>
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (project === "") setProjectData(projectEmpty)
|
} else if (project === "") setProjectData(projectEmpty);
|
||||||
}, [project])
|
}, [project, projectEmpty, projectNotFoundHtml, projectServerErrorHtml]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (projectData && containerRef.current && projectData !== "") {
|
if (projectData && containerRef.current && projectData !== "") {
|
||||||
containerRef.current.innerHTML = projectData;
|
containerRef.current.innerHTML = projectData;
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [projectData, visible])
|
}, [projectData, visible]);
|
||||||
|
|
||||||
const onEscClose = (e: React.KeyboardEvent) => {
|
const onEscClose = (e: React.KeyboardEvent) => {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
if (!visible) return <></>
|
if (!visible) return <></>;
|
||||||
|
|
||||||
return <div className={styles.modal} onKeyDown={onEscClose}>
|
return <div className={styles.modal} onKeyDown={onEscClose}>
|
||||||
<div ref={containerRef} className={styles.modalContainer}>
|
<div ref={containerRef} className={styles.modalContainer}>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
export default ProjectModal;
|
export default ProjectModal;
|
@ -19,7 +19,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse<string
|
|||||||
const project = req.query.projectName;
|
const project = req.query.projectName;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const path = resolve("./public", "projects", `${project}.adoc`)
|
const path = resolve("./public", "projects", `${project}.adoc`);
|
||||||
const data = readFileSync(path).toString();
|
const data = readFileSync(path).toString();
|
||||||
console.debug(`[API/get_project]\tRequest for ${project}`);
|
console.debug(`[API/get_project]\tRequest for ${project}`);
|
||||||
res.status(200).send(data);
|
res.status(200).send(data);
|
||||||
|
@ -19,7 +19,7 @@ const Home: NextPage = () => {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
return (<main onKeyDown={hideModalOnEsc}>
|
return (<main onKeyDown={hideModalOnEsc}>
|
||||||
<Head>
|
<Head>
|
||||||
|
Loading…
Reference in New Issue
Block a user