Skip to content

Commit

Permalink
chore(feed): Revert a refacto out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
WaDadidou committed Nov 19, 2024
1 parent d5bed42 commit 62b7926
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const DislikeButton: FC<{
post: Post;
setPost: Dispatch<SetStateAction<Post>>;
}> = ({ post, setPost }) => {
const { handleReaction, isReactLoading } = useSocialReactions({
const { handleReaction, isPostMutationLoading } = useSocialReactions({
post,
setPost,
});

if (isReactLoading)
if (isPostMutationLoading)
return <ActivityIndicator animating color={secondaryColor} size={32} />;
return (
<TouchableOpacity
Expand Down
4 changes: 2 additions & 2 deletions packages/components/socialFeed/SocialActions/LikeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const LikeButton: FC<{
post: Post;
setPost: Dispatch<SetStateAction<Post>>;
}> = ({ post, setPost }) => {
const { handleReaction, isReactLoading } = useSocialReactions({
const { handleReaction, isPostMutationLoading } = useSocialReactions({
post,
setPost,
});

if (isReactLoading)
if (isPostMutationLoading)
return <ActivityIndicator animating color={secondaryColor} size={32} />;
return (
<TouchableOpacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const SocialCardFooter: FC<{
}) => {
const wallet = useSelectedWallet();
const postNetwork = getNetwork(post.networkId);
const { handleReaction, isReactLoading } = useSocialReactions({
const { handleReaction, isPostMutationLoading } = useSocialReactions({
post,
setPost,
});
Expand All @@ -45,7 +45,7 @@ export const SocialCardFooter: FC<{
nbShown={nbReactionsShown(cardWidth)}
reactions={post.reactions}
onPressReaction={handleReaction}
isLoading={isReactLoading}
isLoading={isPostMutationLoading}
/>

<SpacerRow size={1.5} />
Expand All @@ -59,7 +59,7 @@ export const SocialCardFooter: FC<{
>
<EmojiSelector
onEmojiSelected={handleReaction}
isLoading={isReactLoading}
isLoading={isPostMutationLoading}
/>
{isPostConsultation && handleReply && (
<>
Expand Down
8 changes: 4 additions & 4 deletions packages/hooks/feed/useSocialReactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useSocialReactions = ({
userId,
postCategory,
);
const { mutate: postMutate, isLoading: isReactLoading } =
const { mutate: postMutate, isLoading: isPostMutationLoading } =
useTeritoriSocialFeedReactPostMutation({
onSuccess(_data, variables) {
const reactions = getUpdatedReactions(
Expand All @@ -64,8 +64,8 @@ export const useSocialReactions = ({
const [isLoading, setLoading] = useState(false);

useEffect(() => {
setLoading(isReactLoading);
}, [isReactLoading]);
setLoading(isPostMutationLoading);
}, [isPostMutationLoading]);

const reactOnCosmos = async (emoji: string, walletAddress: string) => {
const client = await signingSocialFeedClient({
Expand Down Expand Up @@ -166,5 +166,5 @@ export const useSocialReactions = ({
}
};

return { handleReaction, isReactLoading: isLoading };
return { handleReaction, isPostMutationLoading: isLoading };
};
4 changes: 2 additions & 2 deletions packages/screens/Mini/Feed/components/PostActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type CardFooterProps = {

export function PostActions({ post, setPost }: CardFooterProps) {
const wallet = useSelectedWallet();
const { handleReaction, isReactLoading } = useSocialReactions({
const { handleReaction, isPostMutationLoading } = useSocialReactions({
post,
setPost,
});
Expand Down Expand Up @@ -56,7 +56,7 @@ export function PostActions({ post, setPost }: CardFooterProps) {
onPressReaction={handleReaction}
/>
<SpacerRow size={0.75} />
{loading || isReactLoading ? (
{loading || isPostMutationLoading ? (
<Spinner size={14} />
) : (
<EmojiSelector
Expand Down

0 comments on commit 62b7926

Please sign in to comment.