mirror of
https://github.com/IgnatZakalinsky/home-works.git
synced 2025-12-16 20:39:24 +00:00
add loading
This commit is contained in:
@@ -20,4 +20,8 @@
|
|||||||
|
|
||||||
.rowHeader {
|
.rowHeader {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,11 +36,13 @@ const HW15 = () => {
|
|||||||
const [sort, setSort] = useState('')
|
const [sort, setSort] = useState('')
|
||||||
const [page, setPage] = useState(1)
|
const [page, setPage] = useState(1)
|
||||||
const [count, setCount] = useState(4)
|
const [count, setCount] = useState(4)
|
||||||
|
const [idLoading, setLoading] = useState(false)
|
||||||
const [totalCount, setTotalCount] = useState(100)
|
const [totalCount, setTotalCount] = useState(100)
|
||||||
const [searchParams, setSearchParams] = useSearchParams()
|
const [searchParams, setSearchParams] = useSearchParams()
|
||||||
const [techs, setTechs] = useState<TechType[]>([])
|
const [techs, setTechs] = useState<TechType[]>([])
|
||||||
|
|
||||||
const sendQuery = (params: any) => {
|
const sendQuery = (params: any) => {
|
||||||
|
setLoading(true)
|
||||||
getTechs(params)
|
getTechs(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// делает студент
|
// делает студент
|
||||||
@@ -50,6 +52,7 @@ const HW15 = () => {
|
|||||||
setTotalCount(res.data.totalCount)
|
setTotalCount(res.data.totalCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setLoading(false)
|
||||||
//
|
//
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -109,6 +112,8 @@ const HW15 = () => {
|
|||||||
<div className={s2.hwTitle}>Homework #15</div>
|
<div className={s2.hwTitle}>Homework #15</div>
|
||||||
|
|
||||||
<div className={s2.hw}>
|
<div className={s2.hw}>
|
||||||
|
{idLoading && <div id={'hw15-loading'} className={s.loading}>Loading...</div>}
|
||||||
|
|
||||||
<SuperPagination
|
<SuperPagination
|
||||||
page={page}
|
page={page}
|
||||||
itemsCountForPage={count}
|
itemsCountForPage={count}
|
||||||
|
|||||||
Reference in New Issue
Block a user