Skip to content

Commit

Permalink
Merge pull request #38 from RicardoGEsteves/remove-dead-code
Browse files Browse the repository at this point in the history
chore: ⚰️ refactor: Remove unused code and update stream player components
  • Loading branch information
RicardoGEsteves authored Jan 14, 2024
2 parents 336029e + 3101b75 commit 44090c8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
36 changes: 0 additions & 36 deletions app/(browse)/[username]/_components/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { toast } from "sonner";
import { useTransition } from "react";

// import { onBlock, onUnblock } from "@/actions/block";
import { onFollow, onUnfollow } from "@/actions/follow";
import { Button } from "@/components/ui/button";

Expand Down Expand Up @@ -43,34 +42,6 @@ const Actions = ({ isFollowing, userId }: ActionsProps) => {
}
};

// const handleUnblock = () => {
// startTransition(() => {
// onUnblock(userId)
// .then((data) =>
// toast.success(`Unblocked the user ${data.blocked.username}`)
// )
// .catch(() => toast.error("Something went wrong"));
// });
// };

// const handleBlock = () => {
// startTransition(() => {
// onBlock(userId)
// .then((data) =>
// toast.success(`Blocked the user ${data?.blocked.username}`)
// )
// .catch(() => toast.error("Something went wrong"));
// });
// };

// const onBlockUnblock = () => {
// if (isBlocked) {
// handleUnblock();
// } else {
// handleBlock();
// }
// };

return (
<>
<Button
Expand All @@ -80,13 +51,6 @@ const Actions = ({ isFollowing, userId }: ActionsProps) => {
>
{isFollowing ? "Unfollow" : "Follow"}
</Button>
{/* <Button
onClick={onBlockUnblock}
disabled={isPending}
>
//TODO: Change this to {isBlocked ? "unBlock" : "Block"}
Block
</Button> */}
</>
);
};
Expand Down
5 changes: 2 additions & 3 deletions components/stream-player/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ const Actions = ({ hostIdentity, isFollowing, isHost }: ActionsProps) => {
}
};

return (
//TODO: {!isHost ? ( the button ) : null}
return !isHost ? (
<Button
disabled={isPending || isHost}
onClick={toggleFollow}
Expand All @@ -73,7 +72,7 @@ const Actions = ({ hostIdentity, isFollowing, isHost }: ActionsProps) => {
/>
{isFollowing ? "Unfollow" : "Follow"}
</Button>
);
) : null;
};

export default Actions;
Expand Down
1 change: 0 additions & 1 deletion components/stream-player/live-video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const LiveVideo = ({ participant }: LiveVideoProps) => {
/>
<div className="absolute top-0 h-full w-full opacity-0 hover:opacity-100 hover:transition-all">
<div className="absolute bottom-0 flex h-10 w-full items-center justify-between bg-background/70 px-4">
{/*TODO: bg-gradient-to-t from-background/X to-background/Y */}
<VolumeControl
onChange={onVolumeChange}
value={volume}
Expand Down

0 comments on commit 44090c8

Please sign in to comment.