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