Commit 556bf2eb authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

Desc : update project
parent 69bfdd59
......@@ -16,7 +16,6 @@ import { tutorialTypeUserProgress } from "types/userProgress";
import { CheckCircleOutlined, CheckOutlined, ClockCircleOutlined, FileMarkdownFilled, LeftOutlined, PlayCircleOutlined, RightOutlined, TrophyOutlined, UserOutlined } from "@ant-design/icons";
import { PopupTransition } from "components/@extended/Transitions";
import ReportCard from "components/cards/statistics/ReportCard";
import { userProgress } from "data/userProgress";
import { itemResultProps, selectedCommonDataProps, selectedItemContentProps } from "./types/types";
import CircularWithPath from "components/@extended/progress/CircularWithPath";
......@@ -49,6 +48,7 @@ const Tutorial = () => {
const theme = useTheme();
const dispatch = useDispatch();
const { marksCalculator, error, success, isLoading } = useSelector(state => state.marksCalculator);
const { userProgress } = useSelector(state => state.userProgress);
const [data, setData] = useState<tutorialTypeUserProgress>()
const [selectedItem, setSelectedItem] = useState<{ selectedCommonData: selectedCommonDataProps | null, backgroundColor: any | null }>({
......@@ -70,11 +70,13 @@ const Tutorial = () => {
})
useEffect(() => {
const firstTutorial = userProgress?.curriculums?.[0]?.tutorials?.[0];
if (firstTutorial) {
setData(firstTutorial);
if (userProgress) {
const firstTutorial = userProgress?.curriculums?.[0]?.tutorials?.[0];
if (firstTutorial) {
setData(firstTutorial);
}
}
}, []);
}, [userProgress]);
const handleItemClick = (item: selectedCommonDataProps, backgroundColor: any) => {
setSelectedItem({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment