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"; ...@@ -16,7 +16,6 @@ import { tutorialTypeUserProgress } from "types/userProgress";
import { CheckCircleOutlined, CheckOutlined, ClockCircleOutlined, FileMarkdownFilled, LeftOutlined, PlayCircleOutlined, RightOutlined, TrophyOutlined, UserOutlined } from "@ant-design/icons"; import { CheckCircleOutlined, CheckOutlined, ClockCircleOutlined, FileMarkdownFilled, LeftOutlined, PlayCircleOutlined, RightOutlined, TrophyOutlined, UserOutlined } from "@ant-design/icons";
import { PopupTransition } from "components/@extended/Transitions"; import { PopupTransition } from "components/@extended/Transitions";
import ReportCard from "components/cards/statistics/ReportCard"; import ReportCard from "components/cards/statistics/ReportCard";
import { userProgress } from "data/userProgress";
import { itemResultProps, selectedCommonDataProps, selectedItemContentProps } from "./types/types"; import { itemResultProps, selectedCommonDataProps, selectedItemContentProps } from "./types/types";
import CircularWithPath from "components/@extended/progress/CircularWithPath"; import CircularWithPath from "components/@extended/progress/CircularWithPath";
...@@ -49,6 +48,7 @@ const Tutorial = () => { ...@@ -49,6 +48,7 @@ const Tutorial = () => {
const theme = useTheme(); const theme = useTheme();
const dispatch = useDispatch(); const dispatch = useDispatch();
const { marksCalculator, error, success, isLoading } = useSelector(state => state.marksCalculator); const { marksCalculator, error, success, isLoading } = useSelector(state => state.marksCalculator);
const { userProgress } = useSelector(state => state.userProgress);
const [data, setData] = useState<tutorialTypeUserProgress>() const [data, setData] = useState<tutorialTypeUserProgress>()
const [selectedItem, setSelectedItem] = useState<{ selectedCommonData: selectedCommonDataProps | null, backgroundColor: any | null }>({ const [selectedItem, setSelectedItem] = useState<{ selectedCommonData: selectedCommonDataProps | null, backgroundColor: any | null }>({
...@@ -70,11 +70,13 @@ const Tutorial = () => { ...@@ -70,11 +70,13 @@ const Tutorial = () => {
}) })
useEffect(() => { useEffect(() => {
const firstTutorial = userProgress?.curriculums?.[0]?.tutorials?.[0]; if (userProgress) {
if (firstTutorial) { const firstTutorial = userProgress?.curriculums?.[0]?.tutorials?.[0];
setData(firstTutorial); if (firstTutorial) {
setData(firstTutorial);
}
} }
}, []); }, [userProgress]);
const handleItemClick = (item: selectedCommonDataProps, backgroundColor: any) => { const handleItemClick = (item: selectedCommonDataProps, backgroundColor: any) => {
setSelectedItem({ 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