Spaces:
Runtime error
Runtime error
user displayed
Browse files- components/main/index.tsx +25 -2
- next.config.js +4 -0
components/main/index.tsx
CHANGED
@@ -2,14 +2,16 @@
|
|
2 |
|
3 |
import { useState } from "react";
|
4 |
import { HiUserGroup, HiHeart, HiAdjustmentsHorizontal } from "react-icons/hi2";
|
|
|
|
|
5 |
|
6 |
import { InputGeneration } from "@/components/input-generation";
|
7 |
import { Button } from "@/components/button";
|
|
|
8 |
|
9 |
import { useInputGeneration } from "./hooks/useInputGeneration";
|
10 |
import { Collections } from "./collections";
|
11 |
import { Settings } from "./settings";
|
12 |
-
import { useUser } from "@/utils/useUser";
|
13 |
|
14 |
const categories = [
|
15 |
{
|
@@ -31,12 +33,14 @@ export const Main = () => {
|
|
31 |
const [category, setCategory] = useState<string>("community");
|
32 |
const [advancedSettings, setAdvancedSettings] = useState<boolean>(false);
|
33 |
|
|
|
|
|
34 |
return (
|
35 |
<main className="px-6 z-[2] relative max-w-[1722px] mx-auto">
|
36 |
<div className="py-2 pl-2 pr-2 lg:pr-4 bg-black bg-opacity-30 backdrop-blur-sm lg:sticky lg:top-4 z-10 rounded-full">
|
37 |
<div className="flex flex-col lg:flex-row items-center justify-between w-full">
|
38 |
<InputGeneration />
|
39 |
-
<div className="items-center justify-center lg:justify-end gap-5 w-full mt-6 lg:mt-0
|
40 |
{categories.map(({ key, label, icon, isLogged }) =>
|
41 |
isLogged && !user ? (
|
42 |
<img
|
@@ -59,6 +63,25 @@ export const Main = () => {
|
|
59 |
)}
|
60 |
</div>
|
61 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
</div>
|
63 |
<p
|
64 |
className="text-white/70 font-medium text-sm flex items-center justify-center lg:justify-start gap-2 hover:text-white cursor-pointer mt-3"
|
|
|
2 |
|
3 |
import { useState } from "react";
|
4 |
import { HiUserGroup, HiHeart, HiAdjustmentsHorizontal } from "react-icons/hi2";
|
5 |
+
import Link from "next/link";
|
6 |
+
import Image from "next/image";
|
7 |
|
8 |
import { InputGeneration } from "@/components/input-generation";
|
9 |
import { Button } from "@/components/button";
|
10 |
+
import { useUser } from "@/utils/useUser";
|
11 |
|
12 |
import { useInputGeneration } from "./hooks/useInputGeneration";
|
13 |
import { Collections } from "./collections";
|
14 |
import { Settings } from "./settings";
|
|
|
15 |
|
16 |
const categories = [
|
17 |
{
|
|
|
33 |
const [category, setCategory] = useState<string>("community");
|
34 |
const [advancedSettings, setAdvancedSettings] = useState<boolean>(false);
|
35 |
|
36 |
+
console.log("user", user);
|
37 |
+
|
38 |
return (
|
39 |
<main className="px-6 z-[2] relative max-w-[1722px] mx-auto">
|
40 |
<div className="py-2 pl-2 pr-2 lg:pr-4 bg-black bg-opacity-30 backdrop-blur-sm lg:sticky lg:top-4 z-10 rounded-full">
|
41 |
<div className="flex flex-col lg:flex-row items-center justify-between w-full">
|
42 |
<InputGeneration />
|
43 |
+
<div className="items-center justify-center lg:justify-end gap-5 w-full mt-6 lg:mt-0 flex">
|
44 |
{categories.map(({ key, label, icon, isLogged }) =>
|
45 |
isLogged && !user ? (
|
46 |
<img
|
|
|
63 |
)}
|
64 |
</div>
|
65 |
</div>
|
66 |
+
{user && (
|
67 |
+
<div className="flex items-center justify-center lg:justify-end text-white text-right text-sm gap-1 mt-4 lg:mt-0">
|
68 |
+
Logged as
|
69 |
+
<Link
|
70 |
+
href={user?.profile}
|
71 |
+
target="_blank"
|
72 |
+
className="hover:text-blue-500 flex items-center justify-end gap-2"
|
73 |
+
>
|
74 |
+
@{user?.preferred_username}
|
75 |
+
<Image
|
76 |
+
src={user?.picture}
|
77 |
+
width={24}
|
78 |
+
height={24}
|
79 |
+
className="rounded-full ring-1 ring-white/60 border border-black"
|
80 |
+
alt={user?.preferred_username}
|
81 |
+
/>
|
82 |
+
</Link>
|
83 |
+
</div>
|
84 |
+
)}
|
85 |
</div>
|
86 |
<p
|
87 |
className="text-white/70 font-medium text-sm flex items-center justify-center lg:justify-start gap-2 hover:text-white cursor-pointer mt-3"
|
next.config.js
CHANGED
@@ -10,6 +10,10 @@ const nextConfig = {
|
|
10 |
protocol: "https",
|
11 |
hostname: "huggingface.co",
|
12 |
},
|
|
|
|
|
|
|
|
|
13 |
],
|
14 |
},
|
15 |
}
|
|
|
10 |
protocol: "https",
|
11 |
hostname: "huggingface.co",
|
12 |
},
|
13 |
+
{
|
14 |
+
protocol: "https",
|
15 |
+
hostname: "aeiljuispo.cloudimg.io",
|
16 |
+
},
|
17 |
],
|
18 |
},
|
19 |
}
|