|
|
@@ -10,19 +10,18 @@ import { Navbar } from '@/components/ui/navbar'
|
|
|
import './index.css'
|
|
|
|
|
|
const ProfilePage: React.FC = () => {
|
|
|
- const [userProfile, setUserProfile] = useState<UserProfile | null>(null)
|
|
|
- const [loading, setLoading] = useState(true)
|
|
|
- const { user, logout } = useAuth()
|
|
|
+ // const [userProfile, setUserProfile] = useState<UserProfile | null>(null)
|
|
|
+ const { user: userProfile, logout, isLoading: loading } = useAuth()
|
|
|
|
|
|
- useEffect(() => {
|
|
|
- if (user) {
|
|
|
- setUserProfile({
|
|
|
- ...user,
|
|
|
- avatar: user.avatar || 'https://images.unsplash.com/photo-1494790108755-2616b612b786?w=160&h=160&fit=crop&crop=face',
|
|
|
- })
|
|
|
- }
|
|
|
- setLoading(false)
|
|
|
- }, [user])
|
|
|
+ // useEffect(() => {
|
|
|
+ // if (user) {
|
|
|
+ // setUserProfile({
|
|
|
+ // ...user,
|
|
|
+ // avatar: user.avatar || 'https://images.unsplash.com/photo-1494790108755-2616b612b786?w=160&h=160&fit=crop&crop=face',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // setLoading(false)
|
|
|
+ // }, [user])
|
|
|
|
|
|
const handleLogout = async () => {
|
|
|
try {
|
|
|
@@ -144,7 +143,7 @@ const ProfilePage: React.FC = () => {
|
|
|
<View className="relative">
|
|
|
<Image
|
|
|
className="w-24 h-24 border-4 border-white shadow-lg"
|
|
|
- src={userProfile.avatar || 'https://images.unsplash.com/photo-1494790108755-2616b612b786?w=160&h=160&fit=crop&crop=face'}
|
|
|
+ src={userProfile.avatarFile?.fullUrl || 'https://images.unsplash.com/photo-1494790108755-2616b612b786?w=160&h=160&fit=crop&crop=face'}
|
|
|
mode="aspectFill"
|
|
|
rounded="full"
|
|
|
/>
|