diff --git a/src/2_widgets/WordMainInfo/WordInfo/WordOriginal/index.ts b/src/2_widgets/WordMainInfo/WordInfo/WordOriginal/index.ts
index ca461dd..cdae9c1 100644
--- a/src/2_widgets/WordMainInfo/WordInfo/WordOriginal/index.ts
+++ b/src/2_widgets/WordMainInfo/WordInfo/WordOriginal/index.ts
@@ -1 +1 @@
-export { default } from './WordOriginal';
+export { WordOriginal } from './WordOriginal';
diff --git a/src/2_widgets/WordMainInfo/WordInfo/index.ts b/src/2_widgets/WordMainInfo/WordInfo/index.ts
index 42c6fa3..5dc7ffe 100644
--- a/src/2_widgets/WordMainInfo/WordInfo/index.ts
+++ b/src/2_widgets/WordMainInfo/WordInfo/index.ts
@@ -1 +1,3 @@
export { default } from './WordInfo';
+
+export { WordOriginal } from './WordOriginal';
diff --git a/src/2_widgets/WordsLayout/WordsLayout.module.scss b/src/2_widgets/WordsLayout/WordsLayout.module.scss
index bc2874e..72cb022 100644
--- a/src/2_widgets/WordsLayout/WordsLayout.module.scss
+++ b/src/2_widgets/WordsLayout/WordsLayout.module.scss
@@ -51,8 +51,6 @@
}
.btn {
- width: 185px;
- padding: 22px 15px !important;
@include media($max-width: 830px) {
padding: 10px 15px;
}
diff --git a/src/3_features/filteringWords/lib/filteringWordsByActivity.ts b/src/3_features/filteringWords/lib/filteringWordsByActivity.ts
index 3941660..c8fa4ac 100644
--- a/src/3_features/filteringWords/lib/filteringWordsByActivity.ts
+++ b/src/3_features/filteringWords/lib/filteringWordsByActivity.ts
@@ -1,4 +1,4 @@
-import { Word, Activity } from '../../../4_entities/words';
+import { Word, Activity } from '@entities/words/model/types';
export const filteringWordsByActivity = (words: Array
, activity: Activity) => {
return words.filter((word) => word.activity === activity);
diff --git a/src/4_entities/word/api/definitionsMock.ts b/src/4_entities/word/api/definitionsMock.ts
new file mode 100644
index 0000000..34bb8d8
--- /dev/null
+++ b/src/4_entities/word/api/definitionsMock.ts
@@ -0,0 +1,67 @@
+import { TDefinition } from '../model/types';
+
+export const definitionsMock: TDefinition[] = [
+ {
+ id: 1245,
+ author: 'Mike',
+ text: 'Gain or acquire knowledge of or skill in (something) by study, experience, or being taught.',
+ translation:
+ 'Приобретать знания или умения в (чем-либо) путем изучения, приобретения опыта или обучения.',
+ popularity: 'high',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 224,
+ author: 'Jane',
+ text: 'To come to know by chance, or by study or other application',
+ translation: 'Весна',
+ popularity: 'medium',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 2247,
+ author: 'Iren',
+ text: 'To come to know by chance, or by study or other application',
+ translation: 'Весна',
+ popularity: 'low',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 12490,
+ author: 'Mike',
+ text: 'Spring',
+ translation: '',
+ popularity: 'high',
+ examples: [
+ "We learn from the record kept at the Freedmen's Bureau, that there are two thousand two hundred children here",
+ ],
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 2244,
+ author: 'Jane',
+ text: 'To come to know by chance, or by study or other application',
+ translation: 'Весна',
+ popularity: 'medium',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 22472,
+ author: 'Nick',
+ text: 'Become aware of (something) by information or from observation.',
+ translation:
+ 'Приобретать знания или умения в (чем-либо) путем изучения, приобретения опыта или обучения.',
+ popularity: 'low',
+ examples: [
+ "We learn from the record kept at the Freedmen's Bureau, that there are two thousand two hundred children here",
+ "If you want to be more than just ordinary, then at some point, you're going to have to learn to burn your boats",
+ ],
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+];
diff --git a/src/4_entities/word/api/wordApi.tsx b/src/4_entities/word/api/wordApi.tsx
new file mode 100644
index 0000000..3e16e5f
--- /dev/null
+++ b/src/4_entities/word/api/wordApi.tsx
@@ -0,0 +1,29 @@
+import { IWord, TDefinition } from '../model/types';
+import { wordMock } from './wordMock';
+import { definitionsMock } from './definitionsMock';
+
+export const wordApi = {
+ getWordById: async (id: string) => {
+ console.log('[wordApi]: wordId=', id);
+
+ const response: Promise = new Promise((resolve) => {
+ setTimeout(() => {
+ resolve(wordMock);
+ }, 1);
+ });
+
+ return await response;
+ },
+
+ getAllDefinitions: async (id: string) => {
+ console.log('[wordApi]: wordId=', id);
+
+ const response: Promise = new Promise((resolve) => {
+ setTimeout(() => {
+ resolve(definitionsMock);
+ }, 1);
+ });
+
+ return await response;
+ },
+};
diff --git a/src/4_entities/word/api/wordMock.ts b/src/4_entities/word/api/wordMock.ts
new file mode 100644
index 0000000..3bb9c2a
--- /dev/null
+++ b/src/4_entities/word/api/wordMock.ts
@@ -0,0 +1,60 @@
+import { IWord } from '../model/types';
+
+export const wordMock: IWord = {
+ id: 1,
+ slug: 'word1',
+ created: '2022-01-01',
+ modified: '2022-03-02',
+ translations_count: 1,
+ favorite: false,
+ types: [0, 1],
+ text: 'textWord1',
+ language: 'en',
+ activity: 'ACTIVE',
+ translations: [
+ {
+ id: 243432,
+ text: 'textTranslation1',
+ },
+ ],
+ examples_count: 0,
+ examples: [],
+ definitions: [
+ {
+ id: 1245,
+ author: 'Mike',
+ text: 'Become aware of (something) by information or from observation.',
+ translation:
+ 'Приобретать знания или умения в (чем-либо) путем изучения, приобретения опыта или обучения.',
+ popularity: 'high',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 224,
+ author: 'Jane',
+ text: 'To come to know by chance, or by study or other application',
+ translation: 'Весна',
+ popularity: 'medium',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ {
+ id: 2247,
+ author: 'Iren',
+ text: 'Gain or acquire knowledge of or skill in (something) by study, experience, or being taught.',
+ translation:
+ 'Приобретать знания или умения в (чем-либо) путем изучения, приобретения опыта или обучения.',
+ popularity: 'low',
+ created: '2023-11-13T09:03:15.483Z',
+ modified: '2023-11-13T09:03:15.483Z',
+ },
+ ],
+ tags: [],
+ is_problematic: false,
+ synonyms: [],
+ antonyms: [],
+ forms: [],
+ similars: [],
+ notes: [],
+};
diff --git a/src/4_entities/word/model/types.ts b/src/4_entities/word/model/types.ts
new file mode 100644
index 0000000..d1530f0
--- /dev/null
+++ b/src/4_entities/word/model/types.ts
@@ -0,0 +1,64 @@
+import { TPopularity } from '@shared/ui/Popularity/Popularity';
+
+export type TTranslation = {
+ id: number;
+ text: string;
+};
+
+export interface ISynonym extends TTranslation {}
+
+export interface IAntonym extends TTranslation {}
+
+export interface IForm extends TTranslation {}
+
+export interface ISimilar extends TTranslation {}
+
+export type TExample = {
+ id: number;
+ text: string;
+ translation?: string;
+ created: string;
+ modified: string;
+};
+
+export type TDefinition = {
+ id: number;
+ text: string;
+ translation: string;
+ author?: string;
+ created: string;
+ examples?: Array;
+ modified: string;
+ popularity?: TPopularity;
+};
+
+export type TNote = {
+ text: string;
+};
+
+export type TActivity = 'INACTIVE' | 'ACTIVE' | 'MASTERED';
+
+export interface IWord {
+ id: number;
+ slug: string;
+ language: string;
+ text: string;
+ translations: Array;
+ translations_count: number;
+ examples_count: number;
+ examples: Array;
+ definitions: Array;
+ types: Array;
+ tags: Array;
+ is_problematic: boolean;
+ activity: TActivity;
+ collections?: Array;
+ created: string;
+ modified: string;
+ synonyms: Array;
+ favorite: boolean;
+ antonyms: Array;
+ forms: Array;
+ similars: Array;
+ notes: Array;
+}
diff --git a/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.module.scss b/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.module.scss
new file mode 100644
index 0000000..3beae39
--- /dev/null
+++ b/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.module.scss
@@ -0,0 +1,23 @@
+@use '@styles/colors' as colors;
+@import '@styles/mixins/font';
+
+$totalColor: colors.$neutral-text-middle-color;
+
+.header {
+ display: flex;
+ gap: 0.5rem;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: solid 1px #cdcdcd;
+ padding: 0.6rem 1.25rem;
+}
+
+.total {
+ @include font-source-sans(1.5rem, $totalColor, 500, 1.5, 'Inter');
+}
+
+.actions {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
diff --git a/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.tsx b/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.tsx
new file mode 100644
index 0000000..13bc78c
--- /dev/null
+++ b/src/4_entities/word/ui/ShadowBlockHeader/ShadowBlockHeader.tsx
@@ -0,0 +1,27 @@
+import { SectionTitle, ButtonIcon } from '@shared/ui';
+import SVGPlus from '@assets/icons/actions/plus.svg?react';
+import SVGLearn from '@assets/icons/actions/hat.svg?react';
+import styles from './ShadowBlockHeader.module.scss';
+
+type TWidgetHeader = {
+ title: string;
+ count: string;
+};
+
+export const ShadowBlockHeader = ({ title, count }: TWidgetHeader) => {
+ return (
+
+
+ {title} {count}
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/4_entities/word/ui/ShadowBlockHeader/index.ts b/src/4_entities/word/ui/ShadowBlockHeader/index.ts
new file mode 100644
index 0000000..025677c
--- /dev/null
+++ b/src/4_entities/word/ui/ShadowBlockHeader/index.ts
@@ -0,0 +1 @@
+export { ShadowBlockHeader } from './ShadowBlockHeader';
diff --git a/src/4_entities/word/ui/WordPageStatus/WordPageStatus.module.scss b/src/4_entities/word/ui/WordPageStatus/WordPageStatus.module.scss
new file mode 100644
index 0000000..049d5c6
--- /dev/null
+++ b/src/4_entities/word/ui/WordPageStatus/WordPageStatus.module.scss
@@ -0,0 +1,11 @@
+.header {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 2rem;
+ padding: 1.5rem 1.4rem;
+}
+
+.actions {
+ display: flex;
+ gap: 0.6rem;
+}
diff --git a/src/4_entities/word/ui/WordPageStatus/WordPageStatus.tsx b/src/4_entities/word/ui/WordPageStatus/WordPageStatus.tsx
new file mode 100644
index 0000000..a9470b9
--- /dev/null
+++ b/src/4_entities/word/ui/WordPageStatus/WordPageStatus.tsx
@@ -0,0 +1,20 @@
+import { ReactElement, ReactNode } from 'react';
+import { SectionTitle, ShadowBlock } from '@shared/ui';
+import styles from './WordPageStatus.module.scss';
+
+type TWordPageStatus = {
+ title: string;
+ icon: ReactElement;
+ children: ReactNode | ReactNode[];
+};
+
+export const WordPageStatus = ({ title, icon, children }: TWordPageStatus) => {
+ return (
+
+
+ {icon} {title}
+
+ {children}
+
+ );
+};
diff --git a/src/4_entities/word/ui/WordPageStatus/index.ts b/src/4_entities/word/ui/WordPageStatus/index.ts
new file mode 100644
index 0000000..cd3f4a7
--- /dev/null
+++ b/src/4_entities/word/ui/WordPageStatus/index.ts
@@ -0,0 +1 @@
+export { WordPageStatus } from './WordPageStatus';
diff --git a/src/5_shared/ui/WordStatus/WordStatus.module.scss b/src/4_entities/word/ui/WordStatus/WordStatus.module.scss
similarity index 100%
rename from src/5_shared/ui/WordStatus/WordStatus.module.scss
rename to src/4_entities/word/ui/WordStatus/WordStatus.module.scss
diff --git a/src/5_shared/ui/WordStatus/WordStatus.tsx b/src/4_entities/word/ui/WordStatus/WordStatus.tsx
similarity index 92%
rename from src/5_shared/ui/WordStatus/WordStatus.tsx
rename to src/4_entities/word/ui/WordStatus/WordStatus.tsx
index 09c55a2..ac81503 100644
--- a/src/5_shared/ui/WordStatus/WordStatus.tsx
+++ b/src/4_entities/word/ui/WordStatus/WordStatus.tsx
@@ -1,4 +1,4 @@
-import { Activity } from '@entities/words';
+import { TActivity } from '@entities/word/model/types';
import SvgStatusActive from '@shared/assets/icons/status_active.svg?react';
import SvgStatusNotActive from '@shared/assets/icons/icon_not_active.svg?react';
import SvgStatusCompleted from '@shared/assets/icons/icon_completed.svg?react';
@@ -6,7 +6,7 @@ import SvgIconQuestion from '@shared/assets/icons/icon_question.svg?react';
import styles from './WordStatus.module.scss';
type Props = {
- activity?: Activity;
+ activity?: TActivity;
colorTheme: 'dark' | 'light';
size?: 'mini' | 'big';
};
diff --git a/src/4_entities/word/ui/WordStatus/index.ts b/src/4_entities/word/ui/WordStatus/index.ts
new file mode 100644
index 0000000..04cdc52
--- /dev/null
+++ b/src/4_entities/word/ui/WordStatus/index.ts
@@ -0,0 +1 @@
+export { WordStatus } from './WordStatus';
diff --git a/src/4_entities/word/ui/index.ts b/src/4_entities/word/ui/index.ts
new file mode 100644
index 0000000..c4cee1b
--- /dev/null
+++ b/src/4_entities/word/ui/index.ts
@@ -0,0 +1,5 @@
+export { WordStatus } from './WordStatus';
+
+export { WordPageStatus } from './WordPageStatus';
+
+export { ShadowBlockHeader } from './ShadowBlockHeader';
diff --git a/src/4_entities/words/index.ts b/src/4_entities/words/index.ts
index 9cd8140..00236c9 100644
--- a/src/4_entities/words/index.ts
+++ b/src/4_entities/words/index.ts
@@ -1,2 +1,2 @@
-export type { Word, Activity, ActivityFilter } from './model/types';
+export type { Word, ActivityFilter, Activity } from './model/types';
export { wordsReducer, wordsSelector, getWords, setFilter } from './model/slice';
diff --git a/src/5_shared/assets/icons/actions/hat.svg b/src/5_shared/assets/icons/actions/hat.svg
new file mode 100644
index 0000000..6e85a5d
--- /dev/null
+++ b/src/5_shared/assets/icons/actions/hat.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/5_shared/assets/icons/actions/plus.svg b/src/5_shared/assets/icons/actions/plus.svg
index 24a8107..7743506 100644
--- a/src/5_shared/assets/icons/actions/plus.svg
+++ b/src/5_shared/assets/icons/actions/plus.svg
@@ -1,3 +1,3 @@
-
+