From ee72fcbfb9c2234b3b6033e1e2fd40008ef0a587 Mon Sep 17 00:00:00 2001 From: Kostiantyn Date: Thu, 30 Jun 2022 23:57:51 +0300 Subject: [PATCH 1/2] bugfix_588 --- src/components/Posts/PostInfo/PostInfo.tsx | 8 ++++---- src/old/modules/posts/components/PostView.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Posts/PostInfo/PostInfo.tsx b/src/components/Posts/PostInfo/PostInfo.tsx index 033e69d0f..26806dc53 100644 --- a/src/components/Posts/PostInfo/PostInfo.tsx +++ b/src/components/Posts/PostInfo/PostInfo.tsx @@ -14,12 +14,12 @@ export interface IPostInfo { origins: IOrigin[]; type: IPostType; publishedAt: string; - realViews?: number; + displayViews?: number; }; } export default function PostInfo({ info }: IPostInfo): JSX.Element { - const { directions, origins, type, publishedAt, realViews } = info; + const { directions, origins, type, publishedAt, displayViews } = info; const classes = useStyles(); const history = useHistory(); @@ -71,10 +71,10 @@ export default function PostInfo({ info }: IPostInfo): JSX.Element {
  • - {realViews === undefined ? ( + {displayViews === undefined ? ( ) : ( - realViews + displayViews )}
  • diff --git a/src/old/modules/posts/components/PostView.tsx b/src/old/modules/posts/components/PostView.tsx index 6ab986912..ce6146a01 100644 --- a/src/old/modules/posts/components/PostView.tsx +++ b/src/old/modules/posts/components/PostView.tsx @@ -45,7 +45,7 @@ const PostView: React.FC = ({ isPreview, post, onDelete }) => { origins: post.origins, type: post.type, publishedAt: post.publishedAt, - realViews: post.realViews, + displayViews: post.views, videoUrl: post.videoUrl, }; From e7866abf465ee1088e5b0a589c670a7026d89b8e Mon Sep 17 00:00:00 2001 From: Kostiantyn Date: Fri, 1 Jul 2022 00:38:01 +0300 Subject: [PATCH 2/2] test fix --- src/components/Posts/PostInfo/__tests__/PostInfo.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Posts/PostInfo/__tests__/PostInfo.test.tsx b/src/components/Posts/PostInfo/__tests__/PostInfo.test.tsx index 7f877fce1..fcc901f0f 100644 --- a/src/components/Posts/PostInfo/__tests__/PostInfo.test.tsx +++ b/src/components/Posts/PostInfo/__tests__/PostInfo.test.tsx @@ -54,7 +54,7 @@ describe('PostInfo tests', () => { name: 'Стаття', }, publishedAt: '05.10.2021', - realViews: 9, + displayViews: 9, }, }; }); @@ -122,7 +122,7 @@ describe('PostInfo tests', () => { }); it('should Skeleton be visible', () => { - delete mocks.info.realViews; + delete mocks.info.displayViews; const { asFragment } = render();