diff --git a/src/roles/user/dashboard/services/dashboardService.jsx b/src/roles/user/dashboard/services/dashboardService.jsx index 89bac0d..379c7ae 100644 --- a/src/roles/user/dashboard/services/dashboardService.jsx +++ b/src/roles/user/dashboard/services/dashboardService.jsx @@ -1,14 +1,10 @@ -import axiosInstance from '../../../../utils/axiosInstance'; +import axiosInstance from '../../../../utils/axiosInstance' const fetchJourney = async () => { - try { - const response = await axiosInstance.get(`/topic/complete`); - return response.data; - } catch (error) { - throw error; - } -}; + const response = await axiosInstance.get(`/topic/complete`) + return response.data +} export default { - fetchJourney, -}; + fetchJourney, +} diff --git a/src/roles/user/dashboard/views/Dashboard.jsx b/src/roles/user/dashboard/views/Dashboard.jsx index 93b8e05..478883c 100644 --- a/src/roles/user/dashboard/views/Dashboard.jsx +++ b/src/roles/user/dashboard/views/Dashboard.jsx @@ -1,100 +1,170 @@ -import React from 'react'; -import { Container, Row, Col, Card, Button, ProgressBar } from 'react-bootstrap'; -import newBie from '../../../../assets/images/illustration/emptyJourney.png'; -import reading from '../../../../assets/images/illustration/reading.png'; -import listening from '../../../../assets/images/illustration/listening.png'; -import { Link, NavLink } from 'react-router-dom'; -import useDashboards from '../hooks/useDashboards'; -import { slugify } from '../../../../utils/Constant'; -import Skeleton from 'react-loading-skeleton'; +import { Container, Row, Col, Card, Button, ProgressBar } from 'react-bootstrap' +import newBie from '../../../../assets/images/illustration/emptyJourney.png' +import { Link, NavLink } from 'react-router-dom' +import useDashboards from '../hooks/useDashboards' +import { slugify } from '../../../../utils/Constant' +import Skeleton from 'react-loading-skeleton' function validName(fullName) { - const nameArray = fullName.split(" "); - const firstTwoWords = nameArray.slice(0, 2).join(" "); - - return firstTwoWords; + const nameArray = fullName.split(' ') + const firstTwoWords = nameArray.slice(0, 2).join(' ') + + return firstTwoWords } const Dashboard = () => { - const { username } = JSON.parse(localStorage.getItem('userData')); + const { username } = JSON.parse(localStorage.getItem('userData')) - const { journey, loading, error, thumbPath} = useDashboards(); - const noData = () =>{ return journey.lenght > 0 ? false : true }; + const { journey, loading, error, thumbPath } = useDashboards() + const noData = () => { + return journey.lenght == 0 + } - if (error) { - return
Let’s evolve together with adaptive learning tailored just for you.
-Begin your journey!
-{data.COMPLETED_TOPICS} / {data.TOTAL_TOPICS} Topics
-+ Let’s evolve together with adaptive learning tailored just for you. +
+Begin your journey!
++ {data.COMPLETED_TOPICS} / {data.TOTAL_TOPICS} Topics +
+