24 lines
594 B
JavaScript
24 lines
594 B
JavaScript
import React, { useEffect, useState } from 'react';
|
|
import { useParams } from 'react-router-dom';
|
|
import { FetchPOST } from '../middlewares/Fetch';
|
|
import ProfileDetail from '../components/ProfileDetail';
|
|
|
|
export default function Profile({setSelectedMenu}) {
|
|
const { username } = useParams();
|
|
|
|
useEffect(() => {
|
|
FetchPOST({
|
|
port: 3001,
|
|
pathname: "/get/user/my"
|
|
}).then(get => {
|
|
(get.username === username) && setSelectedMenu(0);
|
|
});
|
|
},[]);
|
|
console.log(username)
|
|
|
|
return (
|
|
<div className='flex flex-col w-full'>
|
|
<ProfileDetail/>
|
|
</div>
|
|
)
|
|
} |