mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:09:46 +00:00
Сверстал страницы лабораторий
This commit is contained in:
1 parent
2c197ed1a0
commit
7b9db4aa57
3 files changed
+40
-4
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import { PagePost } from "../../components";
|
||||
import { getLabByID } from "../../../api";
|
||||
|
||||
function Lab() {
|
||||
const [lab, setLab] = useState();
|
||||
|
||||
const params = useParams();
|
||||
const labID = params.id;
|
||||
|
||||
useEffect(() => {
|
||||
const loadData = async () => {
|
||||
const newLab = await getLabByID(labID);
|
||||
setLab(newLab);
|
||||
console.log('newLab', newLab);
|
||||
};
|
||||
loadData();
|
||||
}, [labID]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{lab && <PagePost post={lab} isLab={true} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Lab;
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Lab } from "./Lab";
|
||||
Reference in new issue
Block a user