From cc29d90b551de1c732c73535d971538ce61d3da7 Mon Sep 17 00:00:00 2001 From: justice chimobi Date: Sun, 13 Oct 2024 01:11:08 +0100 Subject: [PATCH] chore: checked if it owner hide follow button on showarticl --- src/pages/Articles/HeroSection/index.tsx | 3 ++- src/pages/Articles/show/index.tsx | 1 + src/types/article/index.ts | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/Articles/HeroSection/index.tsx b/src/pages/Articles/HeroSection/index.tsx index 0fb81df..95a0867 100644 --- a/src/pages/Articles/HeroSection/index.tsx +++ b/src/pages/Articles/HeroSection/index.tsx @@ -12,6 +12,7 @@ const ArticleHeroSection: FunctionComponent = ({ authorUsername, is_following, followUser, + isOwner, read_time, date }) => { @@ -40,7 +41,7 @@ const ArticleHeroSection: FunctionComponent = ({ {authorName} - {user && ( + {user && !isOwner && ( { authorAvatar={data?.data?.author?.avatar} authorName={data?.data?.author?.fullname} authorUsername={data?.data?.author?.username} + isOwner={data?.data?.isOwner} is_following={data?.data?.author?.is_following} read_time={data?.data?.read_time} date={data?.data?.created_at?.human} diff --git a/src/types/article/index.ts b/src/types/article/index.ts index 083c46d..87fba50 100644 --- a/src/types/article/index.ts +++ b/src/types/article/index.ts @@ -41,8 +41,9 @@ export interface IArticleHeroProps { authorAvatar: string; authorName: string; authorUsername: string; - is_following: string; - followUser: () => void; + is_following: boolean; + isOwner: boolean; read_time: string; date: string; + followUser: () => void; } \ No newline at end of file