From ae84b92c04545398b201765d5e42d73d6c678fda Mon Sep 17 00:00:00 2001 From: kj1352 Date: Thu, 28 Oct 2021 19:16:25 +0530 Subject: [PATCH] Active shelves integrated + Pull shared module --- src/components/home/Home.tsx | 20 ++++++++++---------- src/shared | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/home/Home.tsx b/src/components/home/Home.tsx index 68244dd..32f1104 100644 --- a/src/components/home/Home.tsx +++ b/src/components/home/Home.tsx @@ -15,9 +15,9 @@ import { CircularProgressbar } from 'react-circular-progressbar'; import { NavLink } from "react-router-dom"; import { AddCategory } from "../add-category/AddCategory"; import { useHistory } from "react-router-dom"; -import { userProfileData } from "../../App"; import { MobileUser } from "../../shared/models/user"; import { getAllData } from "../../services/user"; +import { ReactComponent as InternBadge } from '../../assets/icons/intern-badge.svg'; export const Home: React.FC = () => { const [isAddCategoryPopupOpen, setAddCategoryPopupState] = useState(false); @@ -58,7 +58,7 @@ export const Home: React.FC = () => { } /> {/* eslint-disable-next-line */} profile-image - {userProfileData.medal.icon} +

{userProfile?.name}

@@ -78,7 +78,7 @@ export const Home: React.FC = () => { - {/*
+

@@ -117,7 +117,7 @@ export const Home: React.FC = () => {

- */} +
@@ -130,13 +130,13 @@ export const Home: React.FC = () => {
    - {userProfileData.categories.map((category, categoryIndex) => { - return category.shelves.map((shelf, shelfIndex) => { + {userProfile && userProfile.categories.map((category, categoryIndex) => { + return category?.shelves?.map((shelf, shelfIndex) => { return
  • { - history.push('/shelf-details/category_id=' + categoryIndex + '&&shelf_id=' + shelfIndex); + history.push('/shelf-details/category_id=' + category._id + '&&shelf_id=' + shelf._id); }}>
    - 0 ? (shelf.revisedWords.length * 100 / shelf.words.length) : 0} strokeWidth={7} + { } } /> - {shelf.words.length > 0 ? (shelf.revisedWords.length * 100 / shelf.words.length) : 0}% + 50%
    {shelf.name}
    -

    {shelf.words.length} words

    + { shelf.words &&

    {shelf.words.length} words

    }

    {category.name}

  • }) diff --git a/src/shared b/src/shared index d222fdf..a3da6aa 160000 --- a/src/shared +++ b/src/shared @@ -1 +1 @@ -Subproject commit d222fdf4c43980569323c9d50371c2d9be6b03b0 +Subproject commit a3da6aa10843c3f2ecdd324879561c6bbdf257d0