diff --git a/src/components/shelf-details/ShelfDetails.tsx b/src/components/shelf-details/ShelfDetails.tsx
index 5fa62ff..0937084 100644
--- a/src/components/shelf-details/ShelfDetails.tsx
+++ b/src/components/shelf-details/ShelfDetails.tsx
@@ -112,7 +112,7 @@ export const ShelfDetails: React.FC = () => {
history.push('/word-details/category_id=' + category_id + '&&shelf_id=' + shelf_id + '&&word_id=' + word.word._id);
}}>
{ detail.description } "{ detail.sentence }" "{ example }" - { detail.context } { word.word.name } { word.word.pronounciation }
+ { word.word.name } { word.word.pronounciation?.text }
diff --git a/src/components/word-details/WordDetails.module.scss b/src/components/word-details/WordDetails.module.scss
index ca4d1ef..6c00380 100644
--- a/src/components/word-details/WordDetails.module.scss
+++ b/src/components/word-details/WordDetails.module.scss
@@ -24,18 +24,8 @@
h5 {
font-size: 1.5rem;
- }
-
- figure {
- display: block;
-
- img {
- display: block;
- width: 4rem;
- height: 4rem;
- border-radius: 50%;
- border: 1px solid var(--creamy-white);
- }
+ margin-right: auto;
+ width: calc(100% - 8rem);
}
}
@@ -146,6 +136,11 @@
&.sentence {
opacity: 0.7;
+
+ span {
+ font-style: italic;
+ font-size: 1.2rem;
+ }
}
}
diff --git a/src/components/word-details/WordDetails.tsx b/src/components/word-details/WordDetails.tsx
index 7cdb8a0..f9e2b80 100644
--- a/src/components/word-details/WordDetails.tsx
+++ b/src/components/word-details/WordDetails.tsx
@@ -1,25 +1,37 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
import styles from './WordDetails.module.scss';
-import { userProfileData } from "../../App";
import queryString from 'query-string';
import { useLocation } from "react-router-dom";
-import { IShelf } from "../../structure/shelf";
-import { IWord } from "../../structure/word";
+
import { ReactComponent as SpeakerIcon } from '../../assets/icons/speaker.svg';
import { ReactComponent as MoreIcon } from '../../assets/icons/more-alt.svg';
import { ReactComponent as ChevronLeft } from '../../assets/icons/chevron-left.svg';
import { ReactComponent as PlusIcon } from '../../assets/icons/plus.svg';
+import { MobileUser } from "../../shared/models/user";
+import { updateShelf } from "../../services/shelf";
+import { getAllData } from "../../services/user";
export const WordDetails: React.FC = () => {
const location = useLocation();
- const category_id: any = queryString.parse(location.pathname)['/word-details/category_id'];
- const shelf_id: any = queryString.parse(location.pathname)['shelf_id'];
- const word_id: any = queryString.parse(location.pathname)['word_id'];
- const shelf: IShelf = userProfileData.categories[category_id].shelves[shelf_id];
- const word: IWord = shelf.words[word_id];
+
+ const category_id = queryString.parse(location.pathname)['/word-details/category_id'] as string;
+ const shelf_id = queryString.parse(location.pathname)['shelf_id'] as string;
+ const word_id = queryString.parse(location.pathname)['word_id'] as string;
+
+ const userProfile: MobileUser = JSON.parse(localStorage.getItem('userProfile') || "");
+ const currentCategory = userProfile.categories.find(category => category._id === category_id);
+ let currentShelf = currentCategory?.shelves?.find(shelf => shelf._id === shelf_id);
+ const currentWord = currentShelf?.words?.find(word => word.word._id === word_id);
+
+ const [notes, setNotes] = useState { shelf.name }
-
-
-
{ currentShelf?.name }
{ word.name } { word.pronounciation }
+ { currentWord?.word.name } { currentWord?.word.pronounciation?.text }
- { word.grammaticalDetails.map((detail, index) => {
+ { currentWord?.word.grammaticalDetails.map((detail, index) => {
return
@@ -69,8 +81,8 @@ export const WordDetails: React.FC = () => {
{ detail.typeName }
+ { detail.type }
Similar:
+ { currentWord?.word.similarWords && Synonyms:
Antonyms:
+ My Notes: