From d9029c6d7164e44124b37244a7759e4025468e0f Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 19:53:13 +0700 Subject: [PATCH 1/7] chore: update wording, change super like to like --- src/components/voting/SuperLike.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/voting/SuperLike.tsx b/src/components/voting/SuperLike.tsx index fa085a9e9..83732417c 100644 --- a/src/components/voting/SuperLike.tsx +++ b/src/components/voting/SuperLike.tsx @@ -121,8 +121,7 @@ export default function SuperLike({ post, ...props }: SuperLikeProps) { ) let tooltipTitle = '' - if (isPostCreatedMoreThan1Week) - tooltipTitle = 'You cannot super like posts that are older than 7 days' + if (isPostCreatedMoreThan1Week) tooltipTitle = 'You cannot like posts that are older than 7 days' else if (isMyPost) tooltipTitle = 'You cannot like your own post' const button = ( From 65a245fadbb37e3e87658b46ed99bb6d68a3538a Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 19:53:44 +0700 Subject: [PATCH 2/7] style: fix follow button not full width and make space name as link --- .../creators/cards/CreatorInfoCard.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/creators/cards/CreatorInfoCard.tsx b/src/components/creators/cards/CreatorInfoCard.tsx index a9ad34a5d..ed795534f 100644 --- a/src/components/creators/cards/CreatorInfoCard.tsx +++ b/src/components/creators/cards/CreatorInfoCard.tsx @@ -6,6 +6,7 @@ import { useMyAddress } from 'src/components/auth/MyAccountsContext' import { FormatBalance } from 'src/components/common/balances' import { SpaceFollowersModal } from 'src/components/profiles/AccountsListModal' import { OfficialSpaceStatus, SpaceAvatar } from 'src/components/spaces/helpers' +import ViewSpaceLink from 'src/components/spaces/ViewSpaceLink' import CollapsibleParagraph from 'src/components/utils/CollapsibleParagraph/CollapsibleParagraph' import FollowSpaceButton from 'src/components/utils/FollowSpaceButton' import { Pluralize } from 'src/components/utils/Plularize' @@ -35,10 +36,15 @@ export default function CreatorInfoCard({ space, showStakeButton = true }: Creat
- - {space.content?.name ?? 'Untitled'} - - + + {space.content?.name ?? 'Untitled'} + + + } + /> )}
sendEvent('follow', { spaceId: space.id, @@ -79,7 +86,7 @@ export default function CreatorInfoCard({ space, showStakeButton = true }: Creat }) } > - +
) : ( From 13d09e29d3c9cba00fcd46bb183972f042622058 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 20:05:40 +0700 Subject: [PATCH 3/7] fix: wrong logic when showing stake button --- src/components/creators/CreatorDashboardSidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/creators/CreatorDashboardSidebar.tsx b/src/components/creators/CreatorDashboardSidebar.tsx index 6ae957baa..02e0df96e 100644 --- a/src/components/creators/CreatorDashboardSidebar.tsx +++ b/src/components/creators/CreatorDashboardSidebar.tsx @@ -105,7 +105,7 @@ function PostPageSidebar({ space }: Extract - + {!loadingTotalStake && (data?.hasStaked ? ( <> From 7719fa3d993ed083fde8fa5b619cb3c25f7c9e09 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 20:06:15 +0700 Subject: [PATCH 4/7] chore: not showing follow button if its my space --- .../creators/cards/CreatorInfoCard.tsx | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/src/components/creators/cards/CreatorInfoCard.tsx b/src/components/creators/cards/CreatorInfoCard.tsx index ed795534f..8d1955629 100644 --- a/src/components/creators/cards/CreatorInfoCard.tsx +++ b/src/components/creators/cards/CreatorInfoCard.tsx @@ -5,7 +5,7 @@ import { BsBoxArrowUpRight } from 'react-icons/bs' import { useMyAddress } from 'src/components/auth/MyAccountsContext' import { FormatBalance } from 'src/components/common/balances' import { SpaceFollowersModal } from 'src/components/profiles/AccountsListModal' -import { OfficialSpaceStatus, SpaceAvatar } from 'src/components/spaces/helpers' +import { OfficialSpaceStatus, SpaceAvatar, useIsMySpace } from 'src/components/spaces/helpers' import ViewSpaceLink from 'src/components/spaces/ViewSpaceLink' import CollapsibleParagraph from 'src/components/utils/CollapsibleParagraph/CollapsibleParagraph' import FollowSpaceButton from 'src/components/utils/FollowSpaceButton' @@ -30,6 +30,10 @@ export default function CreatorInfoCard({ space, showStakeButton = true }: Creat const { data: stakeData } = useFetchStakeData(myAddress, space.id) const { data: totalStake } = useFetchTotalStake(myAddress) const sendEvent = useSendEvent() + const isMySpace = useIsMySpace(space.struct) + + const shouldShowStakeButton = isCreatorSpace && showStakeButton + const shouldShowFollowButton = !isMySpace return ( @@ -60,35 +64,39 @@ export default function CreatorInfoCard({ space, showStakeButton = true }: Creat
{!stakeData?.hasStaked ? ( -
- {isCreatorSpace && showStakeButton && ( - - )} -
- sendEvent('follow', { - spaceId: space.id, - eventSource: 'post', - amountRange: getAmountRange(totalStake?.amount), - }) - } - > - + (shouldShowFollowButton || shouldShowStakeButton) && ( +
+ {shouldShowStakeButton && ( + + )} + {shouldShowFollowButton && ( +
+ sendEvent('follow', { + spaceId: space.id, + eventSource: 'post', + amountRange: getAmountRange(totalStake?.amount), + }) + } + > + +
+ )}
-
+ ) ) : (
From 917ee4d15a9cede1d8cafc20c4d1dd9af4a6a28e Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 20:34:40 +0700 Subject: [PATCH 5/7] chore: update wording --- .../creators/creator-rewards/CreatorRewardInfoCard.tsx | 2 +- src/components/creators/staker-rewards/StakerRewardInfo.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/creators/creator-rewards/CreatorRewardInfoCard.tsx b/src/components/creators/creator-rewards/CreatorRewardInfoCard.tsx index 3e1dc2e8d..d403ca4b0 100644 --- a/src/components/creators/creator-rewards/CreatorRewardInfoCard.tsx +++ b/src/components/creators/creator-rewards/CreatorRewardInfoCard.tsx @@ -79,7 +79,7 @@ export default function CreatorRewardInfoCard() {
Distribution in - +
diff --git a/src/components/creators/staker-rewards/StakerRewardInfo.tsx b/src/components/creators/staker-rewards/StakerRewardInfo.tsx index 86c84c029..a76aadff0 100644 --- a/src/components/creators/staker-rewards/StakerRewardInfo.tsx +++ b/src/components/creators/staker-rewards/StakerRewardInfo.tsx @@ -75,8 +75,8 @@ export default function StakerRewardInfo({ size, ...props }: StakerRewardInfoPro reward the authors of the posts you like.

- If you like more than 10, those author rewards will then be distributed among - more authors, resulting in each author receiving fewer rewards. + Liking more than 10 posts will spread the author rewards across more authors, + resulting in each author receiving fewer rewards.

} @@ -140,7 +140,7 @@ export default function StakerRewardInfo({ size, ...props }: StakerRewardInfoPro
Distribution in - +
From 37b4b6c4ca96fee97b88e735b0d2be1143386dee Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 22:31:40 +0700 Subject: [PATCH 6/7] chore: remove comment section from stats --- src/components/statistics/Statistics.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/statistics/Statistics.tsx b/src/components/statistics/Statistics.tsx index 3bd2ffe97..291c94b9b 100644 --- a/src/components/statistics/Statistics.tsx +++ b/src/components/statistics/Statistics.tsx @@ -19,7 +19,7 @@ export type ActivityEvent = | 'SpaceFollowed' | 'PostCreated' | 'PostShared,CommentShared' - | 'CommentCreated,CommentReplyCreated' + // | 'CommentCreated,CommentReplyCreated' | 'PostReactionCreated,CommentReactionCreated' | 'AccountFollowed' @@ -28,7 +28,7 @@ export const eventArr = [ 'SpaceFollowed', 'PostCreated', 'PostShared,CommentShared', - 'CommentCreated,CommentReplyCreated', + // 'CommentCreated,CommentReplyCreated', 'PostReactionCreated,CommentReactionCreated', 'AccountFollowed', ] @@ -183,6 +183,8 @@ export function Statistics(props: FormProps) { } }, [address, period]) + console.log(parseData(constrainedPeriod.toString(), dates, data)) + return (
From bce565ff31173a00c7edceb7691dc2b975a9a0e8 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 10 Jan 2024 22:33:09 +0700 Subject: [PATCH 7/7] chore: remove log --- src/components/statistics/Statistics.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/statistics/Statistics.tsx b/src/components/statistics/Statistics.tsx index 291c94b9b..1b2c04c7f 100644 --- a/src/components/statistics/Statistics.tsx +++ b/src/components/statistics/Statistics.tsx @@ -183,8 +183,6 @@ export function Statistics(props: FormProps) { } }, [address, period]) - console.log(parseData(constrainedPeriod.toString(), dates, data)) - return (