|
|
@@ -10,7 +10,7 @@ import { useAuth, User } from '@/client/home/hooks/AuthProvider';
|
|
|
|
|
|
const MemberPage: React.FC = () => {
|
|
|
const navigate = useNavigate();
|
|
|
- const { user } = useAuth();
|
|
|
+ const { user, logout } = useAuth();
|
|
|
|
|
|
if (!user) {
|
|
|
return (
|
|
|
@@ -57,14 +57,26 @@ const MemberPage: React.FC = () => {
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
- <button
|
|
|
- onClick={() => navigate('/profile/edit')}
|
|
|
- className="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center"
|
|
|
- >
|
|
|
- <PencilIcon className="w-4 h-4 mr-2" />
|
|
|
- 编辑资料
|
|
|
- </button>
|
|
|
+ <div className="flex">
|
|
|
+ <button
|
|
|
+ onClick={() => navigate('/profile/edit')}
|
|
|
+ className="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center"
|
|
|
+ >
|
|
|
+ <PencilIcon className="w-4 h-4 mr-2" />
|
|
|
+ 编辑资料
|
|
|
+ </button>
|
|
|
+
|
|
|
+ <button
|
|
|
+ onClick={async () => {
|
|
|
+ await logout();
|
|
|
+ navigate('/');
|
|
|
+ }}
|
|
|
+ className="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ml-4"
|
|
|
+ >
|
|
|
+ 退出登录
|
|
|
+ </button>
|
|
|
+
|
|
|
+ </div>
|
|
|
|
|
|
{(user as any).bio && (
|
|
|
<p className="mt-4 text-center text-gray-600 max-w-lg">
|