mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:59:45 +00:00
Сверстал страницы лабораторий
This commit is contained in:
1 parent
2c197ed1a0
commit
7b9db4aa57
3 files changed
+39
-3
No files matched your search
@@ -1,10 +1,16 @@
|
|||||||
import { PageHeader } from "../components";
|
import { PageHeader, PageContent } from "../components";
|
||||||
|
import { LabList } from "../../components"
|
||||||
|
|
||||||
function Labs() {
|
function Labs() {
|
||||||
return (
|
return (
|
||||||
<PageHeader>
|
<>
|
||||||
|
<PageHeader className="header">
|
||||||
|
<h1>Лаборатории</h1>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
<PageContent className="content">
|
||||||
|
<LabList />
|
||||||
|
</PageContent>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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