blob: 1a9c29a996ac5eedf5eebeb0d954e6e77ed467dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
'use client'
import Link from "next/link"
import Image from "next/image"
import { AuthContext } from '../components/AuthContext'
import { useContext, useEffect } from "react";
import { useRouter } from 'next/navigation';
export default function Profiles() {
const user = useContext(AuthContext);
const router = useRouter();
useEffect(() => {
// Check if user is authenticated
if (!user) {
// Redirect or perform any necessary action
router.push('/login');
} else {
// User is authenticated, continue with desired logic
}
}, [user]);
return (
<div className="bg-black w-screen h-screen flex flex-col items-center justify-center">
<h1>Netflix</h1>
<p className="text-white text-[3.5vw]">Who's watching?</p>
<div className="flex flex-row gap-3 mt-6">
{
USERS.map((user, index) => (
<div key={index} className="flex flex-col items-center justify-center">
<Link href={'/browse'} className="w-[128px] h-[128px] rounded-xl overflow-hidden bg-white">
<img src={user.avatar} alt="" className="w-full h-full" />
</Link>
<p className="text-gray-400 text-xs">{user.name}</p>
</div>
))}
</div>
</div>
)
}
const USERS = [
{
name:'Alberto',
avatar:'https://api.dicebear.com/9.x/adventurer/svg?seed=alberto'
},
{
name:'Kids',
avatar:'https://api.dicebear.com/9.x/adventurer/svg?seed=kids'
},
{
name:'Add profile',
avatar:'https://api.dicebear.com/9.x/adventurer/svg?seed=add'
// icon:'...'
}
]
|