Skip to content

Commit

Permalink
Added subscription count on profile cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxcorel committed Aug 21, 2023
1 parent f003b0c commit 6c5133e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/users/components/UserProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function UserProfileCard(props: Props) {
console.log("[UserProfileCard.useEffect()]: " + error)

})
}, [])
}, [props.username, subscribed])

function handleSubscribeButtonClick() {
if (!subscribed) {
Expand Down Expand Up @@ -122,10 +122,10 @@ export default function UserProfileCard(props: Props) {
focus:outline-none
dark:focus:ring-blue-800"
>
{subscribed ? "UNSUBSCRIBE" : "SUBSCRIBE"}
{subscribed ? "UNSUBSCRIBE" : "SUBSCRIBE"} {user?.subscriptionCount}
</button>
</div>
<p className={" m-4"}>
<p className={"m-4"}>
{user?.aboutMe}
</p>

Expand Down
3 changes: 2 additions & 1 deletion types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type OnlyfinProfileExtended = {
username: string,
isSubscribed: boolean,
aboutMe: string,
self: boolean
self: boolean,
subscriptionCount: number
}

type OnlyfinReview = {
Expand Down

0 comments on commit 6c5133e

Please sign in to comment.