implementation of dynamic timeline in first page

This commit is contained in:
AmirHossein Mahmoodi
2023-12-11 16:43:33 +03:30
parent fc944c0d35
commit 96ebf94bfe

View File

@@ -4,6 +4,7 @@ import {useRequest} from "@witel/webapp-builder";
import TimelineManager from "@/core/components/timelines/timelineManager";
import moment from "jalali-moment";
import {Timeline} from "@mui/lab";
import {LinearProgress} from "@mui/material";
const TimeLineDetails = () => {
const t = useTranslations();
@@ -14,7 +15,6 @@ const TimeLineDetails = () => {
useEffect(() => {
setLoading(true)
request(process.env.NEXT_PUBLIC_CONFIG_APP_URL, 'get').then(res => {
setLoading(false)
let tempArr = []
for (const timeLine of res.data.time_lines.navgan_first_page) {
let temp = {}
@@ -33,6 +33,7 @@ const TimeLineDetails = () => {
tempArr.push(temp)
}
setTimeLineList(tempArr)
setLoading(false)
}).catch(() => {
setLoading(false)
})
@@ -41,7 +42,7 @@ const TimeLineDetails = () => {
return (
<>
{loading ? (
<>loading...</>
<LinearProgress/>
) : (
<Timeline position="alternate">
{timeLineList.map((timeLine, index) => (