mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-16 17:59:41 +05:00
Merge remote-tracking branch 'origin/feat_player'
This commit is contained in:
parent
bb437fe7ca
commit
25e31a7799
62 changed files with 1508 additions and 701 deletions
|
@ -1,17 +0,0 @@
|
|||
import { ProfilePage } from "@/app/pages/Profile";
|
||||
import { fetchDataViaGet } from "@/app/api/utils";
|
||||
import { ENDPOINTS } from "@/app/api/config";
|
||||
|
||||
export async function generateMetadata({ params }) {
|
||||
const id = params.id
|
||||
const profile = await fetchDataViaGet(`${ENDPOINTS.user.profile}/${id}`);
|
||||
|
||||
return {
|
||||
title: "Профиль " + profile.profile.login,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Search({ params }) {
|
||||
const id = params.id
|
||||
return <ProfilePage id={id} />;
|
||||
}
|
16
app/profile/[id]/page.tsx
Normal file
16
app/profile/[id]/page.tsx
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { ProfilePage } from "#/pages/Profile";
|
||||
import { fetchDataViaGet } from "#/api/utils";
|
||||
|
||||
export async function generateMetadata({ params }) {
|
||||
const id:string = params.id;
|
||||
const profile: any = await fetchDataViaGet(`https://api.anixart.tv/profile/${id}`);
|
||||
|
||||
return {
|
||||
title: "Профиль " + profile.profile.login,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Profile({ params }) {
|
||||
const id: string = params.id;
|
||||
return <ProfilePage id={id} />;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
"use client"
|
||||
import { useRouter } from "next/navigation";
|
||||
import { getJWT } from "../api/utils";
|
||||
|
||||
export default function myProfile() {
|
||||
const user = getJWT()
|
||||
const router = useRouter()
|
||||
|
||||
if (!user) {
|
||||
return router.push("/login")
|
||||
} else {
|
||||
return router.push(`/profile/${user.user_id}`)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue