Fixed settings layout on smaller devices
This commit is contained in:
@ -1,56 +0,0 @@
|
||||
import axios from "axios"
|
||||
import { currentUser } from "@/lib/current-user";
|
||||
import { db } from "@/lib/db"
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
try {
|
||||
const user = await currentUser();
|
||||
if (!user) {
|
||||
return new NextResponse("Unauthorized", { status: 401 });
|
||||
}
|
||||
|
||||
let badges = await axios.get("https://api.twitch.tv/helix/chat/badges")
|
||||
|
||||
|
||||
const badgesData = await db.ttsBadgeFilter.findMany({
|
||||
where: {
|
||||
data: {
|
||||
userId: user.id
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// return NextResponse.json(badgesData);
|
||||
return new NextResponse("Bad Request", { status: 400 });
|
||||
} catch (error) {
|
||||
console.log("[CONNECTION/TWITCH]", error);
|
||||
return new NextResponse("Internal Error", { status: 500});
|
||||
}
|
||||
}
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const user = await currentUser();
|
||||
const badges = await req.json();
|
||||
|
||||
console.log("BADGES", badges);
|
||||
if (!user) {
|
||||
return new NextResponse("Unauthorized", { status: 401 });
|
||||
}
|
||||
|
||||
// const badgesData = await db.tTSBadgeFilter.createMany({
|
||||
// badges.map((badgeName, value) => {
|
||||
// data: {
|
||||
// userId: user.id
|
||||
// }
|
||||
// })
|
||||
// });
|
||||
|
||||
// return NextResponse.json(badgesData);
|
||||
return new NextResponse("Bad Request", { status: 400 });
|
||||
} catch (error) {
|
||||
console.log("[CONNECTION/TWITCH]", error);
|
||||
return new NextResponse("Internal Error", { status: 500});
|
||||
}
|
||||
}
|
@ -10,10 +10,10 @@ const SettingsLayout = async (
|
||||
|
||||
return (
|
||||
<div className="h-full">
|
||||
<div className={cn("hidden md:flex h-full w-[250px] z-30 flex-col fixed inset-y-0", header_url.endsWith("/settings") && "md:flex h-full w-full z-30 flex-col fixed inset-y-0")}>
|
||||
<div className={cn("hidden md:flex h-full w-[250px] z-30 flex-col fixed inset-y-0",
|
||||
header_url.endsWith("/settings") && "flex h-full w-full md:w-[250px] z-30 flex-col fixed inset-y-0")}>
|
||||
<SettingsNavigation />
|
||||
</div>
|
||||
{header_url}
|
||||
<main className={cn("md:pl-[250px] h-full", header_url.endsWith("/settings") && "hidden")}>
|
||||
{children}
|
||||
</main>
|
||||
|
@ -1,9 +1,6 @@
|
||||
import { auth } from "@/auth";
|
||||
|
||||
const SettingsPage = async () => {
|
||||
return (
|
||||
<div>
|
||||
{JSON.stringify(await auth())}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user