mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-06 06:23:53 +05:00
anix/feat: add interesting carousel to discovery page
This commit is contained in:
parent
93205fdb4e
commit
bfb361a0a8
5 changed files with 121 additions and 15 deletions
|
@ -1,19 +1,10 @@
|
|||
"use client";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useUserStore } from "../store/auth";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { InterestingCarousel } from "#/components/Discovery/InterestingCarousel";
|
||||
|
||||
export const DiscoverPage = () => {
|
||||
const token = useUserStore((state) => state.token);
|
||||
const authState = useUserStore((state) => state.state);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (authState === "finished" && !token) {
|
||||
router.push("/login?redirect=/discover");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authState, token]);
|
||||
|
||||
return <></>;
|
||||
return (
|
||||
<>
|
||||
<InterestingCarousel />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue