Skip to content

Commit

Permalink
Merge pull request #34 from chimobi-justice/checked-ownership-show-ar…
Browse files Browse the repository at this point in the history
…ticle

chore: checked if it owner hide follow button on show article
  • Loading branch information
chimobi-justice authored Oct 13, 2024
2 parents 1af6e79 + cc29d90 commit 22b9cf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/pages/Articles/HeroSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ArticleHeroSection: FunctionComponent<IArticleHeroProps> = ({
authorUsername,
is_following,
followUser,
isOwner,
read_time,
date
}) => {
Expand Down Expand Up @@ -40,7 +41,7 @@ const ArticleHeroSection: FunctionComponent<IArticleHeroProps> = ({
<Heading size="sm">{authorName}</Heading>
</Link>

{user && (
{user && !isOwner && (
<Text
fontSize={"14px"}
color={"blue"}
Expand Down
1 change: 1 addition & 0 deletions src/pages/Articles/show/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const ShowArticle: FunctionComponent = () => {
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}
Expand Down
5 changes: 3 additions & 2 deletions src/types/article/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 22b9cf1

Please sign in to comment.