From 143eafa561ca5fa4b289e7e9477ce85ed09306e7 Mon Sep 17 00:00:00 2001 From: KotikVacia Date: Wed, 18 Jan 2023 02:31:16 +0500 Subject: [PATCH 1/3] final-review: try fix filename --- .../src/components/{footer => Footer}/Footer.test.tsx | 0 .../{footer/footer.tsx => Footer/Footer.tsx} | 4 +++- project/src/components/Tabs/Tabs.tsx | 6 +++++- project/src/components/VideoPlayer/VideoPlayer.tsx | 2 +- .../src/pages/{player/player.tsx => Player/Player.tsx} | 10 +++++++--- 5 files changed, 16 insertions(+), 6 deletions(-) rename project/src/components/{footer => Footer}/Footer.test.tsx (100%) rename project/src/components/{footer/footer.tsx => Footer/Footer.tsx} (76%) rename project/src/pages/{player/player.tsx => Player/Player.tsx} (94%) diff --git a/project/src/components/footer/Footer.test.tsx b/project/src/components/Footer/Footer.test.tsx similarity index 100% rename from project/src/components/footer/Footer.test.tsx rename to project/src/components/Footer/Footer.test.tsx diff --git a/project/src/components/footer/footer.tsx b/project/src/components/Footer/Footer.tsx similarity index 76% rename from project/src/components/footer/footer.tsx rename to project/src/components/Footer/Footer.tsx index 74a9b01..518245f 100644 --- a/project/src/components/footer/footer.tsx +++ b/project/src/components/Footer/Footer.tsx @@ -4,7 +4,9 @@ export const Footer = () => ( ); diff --git a/project/src/components/Tabs/Tabs.tsx b/project/src/components/Tabs/Tabs.tsx index 7c383ba..882bbc8 100644 --- a/project/src/components/Tabs/Tabs.tsx +++ b/project/src/components/Tabs/Tabs.tsx @@ -19,6 +19,10 @@ export const Tabs = ({ activeTab }: TabsProps) => { return ; default: - return

Not active tab :(

; + return ( +

+ Not active tab :( +

+ ); } }; diff --git a/project/src/components/VideoPlayer/VideoPlayer.tsx b/project/src/components/VideoPlayer/VideoPlayer.tsx index a617ab4..5227325 100644 --- a/project/src/components/VideoPlayer/VideoPlayer.tsx +++ b/project/src/components/VideoPlayer/VideoPlayer.tsx @@ -14,7 +14,7 @@ export const VideoPlayer = ({ film, muted, width, height, isPlaying }: PlayerPro const videoPlayerRef = useRef(null); useEffect(() => { - if (videoPlayerRef === null) { + if (!videoPlayerRef) { return; } diff --git a/project/src/pages/player/player.tsx b/project/src/pages/Player/Player.tsx similarity index 94% rename from project/src/pages/player/player.tsx rename to project/src/pages/Player/Player.tsx index 22e2f2e..a96cc03 100644 --- a/project/src/pages/player/player.tsx +++ b/project/src/pages/Player/Player.tsx @@ -46,10 +46,14 @@ export const Player = () => { }, []); const formatTime = useCallback((seconds: number) => { - if (seconds / 60 / 60 >= 1) { - return moment(seconds * 1000).format('-hh:mm:ss'); + const hours = seconds / 60 / 60; + const timeToFormat = seconds * 1000; + + if (hours >= 1) { + return moment(timeToFormat).format('-hh:mm:ss'); } - return moment(seconds * 1000).format('-mm:ss'); + + return moment(timeToFormat).format('-mm:ss'); }, []); return ( From a5f8e1495b958dc8c7ae2c2f98d928734a175ed4 Mon Sep 17 00:00:00 2001 From: KotikVacia Date: Wed, 18 Jan 2023 02:41:46 +0500 Subject: [PATCH 2/3] final-review: try fix filename (part 2) --- Readme.md | 2 +- .../src/components/{filmsList => FilmsList}/FilmsList.test.tsx | 0 .../{filmsList/filmsList.tsx => FilmsList/FilmsList.tsx} | 0 project/src/{pages/main/main.tsx => components/Main/Main.tsx} | 0 project/src/components/app/app.tsx | 2 +- 5 files changed, 2 insertions(+), 2 deletions(-) rename project/src/components/{filmsList => FilmsList}/FilmsList.test.tsx (100%) rename project/src/components/{filmsList/filmsList.tsx => FilmsList/FilmsList.tsx} (100%) rename project/src/{pages/main/main.tsx => components/Main/Main.tsx} (100%) diff --git a/Readme.md b/Readme.md index 6f222f9..a9bb2aa 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ # Личный проект «Что посмотреть» * Студент: [Владислав Аткишкин](https://up.htmlacademy.ru/univer-js3-urfu/1/user/840933). -* Наставник:  [Александр Григорьев](https://htmlacademy.ru/profile/id43108). +* Наставник: [Александр Григорьев](https://htmlacademy.ru/profile/id43108). --- diff --git a/project/src/components/filmsList/FilmsList.test.tsx b/project/src/components/FilmsList/FilmsList.test.tsx similarity index 100% rename from project/src/components/filmsList/FilmsList.test.tsx rename to project/src/components/FilmsList/FilmsList.test.tsx diff --git a/project/src/components/filmsList/filmsList.tsx b/project/src/components/FilmsList/FilmsList.tsx similarity index 100% rename from project/src/components/filmsList/filmsList.tsx rename to project/src/components/FilmsList/FilmsList.tsx diff --git a/project/src/pages/main/main.tsx b/project/src/components/Main/Main.tsx similarity index 100% rename from project/src/pages/main/main.tsx rename to project/src/components/Main/Main.tsx diff --git a/project/src/components/app/app.tsx b/project/src/components/app/app.tsx index eb70d8f..d76128d 100644 --- a/project/src/components/app/app.tsx +++ b/project/src/components/app/app.tsx @@ -6,7 +6,7 @@ import { AddReview } from '../../pages/AddReview/AddReview'; import { Player } from '../../pages/Player/Player'; import { NotFound } from '../../pages/NotFound/NotFound'; import { PrivateRoute } from './privateRoute'; -import { Main } from '../../pages/Main/Main'; +import { Main } from '../Main/Main'; import { useAppSelector } from '../../hooks'; import { getIsDataLoaded } from '../../store/dataReducer/selector'; import { AuthorizationStatus } from '../../enums/auth.enum'; From f2688965f512575a96d54dc280dda93be10a89a5 Mon Sep 17 00:00:00 2001 From: KotikVacia Date: Wed, 18 Jan 2023 02:43:37 +0500 Subject: [PATCH 3/3] final-review: fix ReviewCard.test.tsx test --- project/src/components/ReviewCard/ReviewCard.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/components/ReviewCard/ReviewCard.test.tsx b/project/src/components/ReviewCard/ReviewCard.test.tsx index 2cbb4ae..ebd17a4 100644 --- a/project/src/components/ReviewCard/ReviewCard.test.tsx +++ b/project/src/components/ReviewCard/ReviewCard.test.tsx @@ -25,7 +25,7 @@ describe('', () => { expect(screen.getByText('December 31, 2022')).toBeInTheDocument(); expect(screen.getByText('ФИЛЬМ АГОНЬ!!!')).toBeInTheDocument(); - expect(screen.getByText(10)).toBeInTheDocument(); + expect(screen.getByText('10.0')).toBeInTheDocument(); expect(screen.getByText('vladik')).toBeInTheDocument(); }); });