|
| 1 | +'use client'; |
| 2 | +import Image from 'next/image'; |
| 3 | +import { signIn, signOut, useSession } from 'next-auth/react'; |
| 4 | +import React from 'react'; |
| 5 | +import Timeline from '@/components/Timeline'; |
| 6 | + |
| 7 | +const ProfileSettings = () => { |
| 8 | + const session = useSession(); |
| 9 | + const totalLikes = 120; // 仮のデータ |
| 10 | + const totalPosts = 35; // 仮のデータ |
| 11 | + |
| 12 | + return ( |
| 13 | + <div className='flex justify-center py-10'> |
| 14 | + {/* ヘッダ */} |
| 15 | + <div className='fixed top-0 z-40 flex h-12 w-full items-center justify-center bg-white font-kokuryu text-2xl'> |
| 16 | + <div className=''>Tankalizer</div> |
| 17 | + </div> |
| 18 | + |
| 19 | + <div className='fixed left-0 top-0 z-[-1] h-lvh w-full opacity-20'> |
| 20 | + <Image src='/bg.jpg' layout='fill' objectFit='cover' alt='Background'></Image> |
| 21 | + </div> |
| 22 | + |
| 23 | + {session.status === 'authenticated' ? ( |
| 24 | + <div className='pt-12'> |
| 25 | + <div className='w-full max-w-xl border-[2px] border-gray-300 bg-gradient-to-r from-amber-100 to-amber-50 rounded-2xl shadow-lg'> |
| 26 | + <div className='text-center text-xl font-semibold text-gray-700 py-4 border-b border-gray-300'> |
| 27 | + プロフィール |
| 28 | + </div> |
| 29 | + <div className='p-6 space-y-6'> |
| 30 | + <div className='flex flex-col items-center space-y-4'> |
| 31 | + {session.data.user?.image && ( |
| 32 | + <Image |
| 33 | + src={session.data.user.image} |
| 34 | + alt='プロフィール画像' |
| 35 | + width={100} |
| 36 | + height={100} |
| 37 | + className='rounded-full border-2 border-gray-300' |
| 38 | + /> |
| 39 | + )} |
| 40 | + <div className='space-y-2 w-full text-center'> |
| 41 | + <label htmlFor='name' className='block text-gray-700 font-medium'> |
| 42 | + 名前 {session.data.user?.name} |
| 43 | + </label> |
| 44 | + <div className='mt-4 text-gray-600'> |
| 45 | + <p>総雅数: {totalLikes}</p> |
| 46 | + <p>総投稿数: {totalPosts}</p> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + <Timeline limit={10} max={100} targetUserUrl={session.data.user?.image ?? ''} /> |
| 53 | + </div> |
| 54 | + ) : ( |
| 55 | + <div className='text-center text-gray-700'>ログインしてください。</div> |
| 56 | + )} |
| 57 | + </div> |
| 58 | + ); |
| 59 | +}; |
| 60 | + |
| 61 | +export default ProfileSettings; |
0 commit comments