FEAT: Navigate to category page of stream's category upon clicking it

This commit is contained in:
Chris-1010
2025-02-27 21:32:51 +00:00
parent 9f6a4a2d87
commit 2b325746f5
2 changed files with 16 additions and 17 deletions

View File

@@ -32,7 +32,6 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
const [showCheckout, setShowCheckout] = useState(false);
const { showChat } = useChat();
const navigate = useNavigate();
const [isSubscribed, setIsSubscribed] = useState(false);
const [timeStarted, setTimeStarted] = useState("");
useEffect(() => {
@@ -126,18 +125,6 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
loadStripe();
}, []);
// Checks if user is subscribed
useEffect(() => {
fetch(`/api/user/subscription/${streamerName}/expiration`)
.then((response) => response.json())
.then((data) => {
if (data.remaining_time > 0) {
setIsSubscribed(true);
}
})
.catch((error) => console.error("Error fetching subscription:", error));
}, [streamerName]);
return (
<SocketProvider>
<DynamicPageContent className="w-full min-h-screen">
@@ -188,9 +175,9 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
<h2 className="text-[0.75em] lg:text-[0.85em] xl:text-[1em] font-bold">
{streamData ? streamData.title : "Loading..."}
</h2>
<span className="text-[0.75em] lg:text-[0.85em] xl:text-[1em] text-gray-400">
<a href={streamData ? `/category/${streamData.streamCategory}` : "#"} className="text-[0.75em] lg:text-[0.85em] xl:text-[1em] text-gray-400">
{streamData ? streamData.streamCategory : "Loading..."}
</span>
</a>
</div>
{/* Streamer Info */}