diff --git a/frontend/src/components/listings/MyListingGrid.tsx b/frontend/src/components/listings/MyListingGrid.tsx index 5fc1b065..b26ae742 100644 --- a/frontend/src/components/listings/MyListingGrid.tsx +++ b/frontend/src/components/listings/MyListingGrid.tsx @@ -72,14 +72,14 @@ const MyListingGrid = ({ userId }: MyListingGridProps) => { }; fetchListings(); - }, [userId]); + }, [userId, auth.currentUser?.username]); return listingInfos === null ? (
) : ( -
+
{listingInfos.map((info) => ( { const auth = useAuthentication(); const { addErrorAlert } = useAlertQueue(); + const navigate = useNavigate(); const [listingInfos, setListingInfos] = useState(null); const [listingDetails, setListingDetails] = useState {
) : ( -

- You have not upvoted any listings -

+
+

You have not upvoted any bots

+ +
); }; diff --git a/frontend/src/components/pages/Profile.tsx b/frontend/src/components/pages/Profile.tsx index 26ea12a2..c87df828 100644 --- a/frontend/src/components/pages/Profile.tsx +++ b/frontend/src/components/pages/Profile.tsx @@ -4,8 +4,8 @@ import { useTypedParams } from "react-router-typesafe-routes/dom"; import MyListingGrid from "@/components/listings/MyListingGrid"; import UpvotedGrid from "@/components/listings/UpvotedGrid"; +import EditProfileForm from "@/components/profile/EditProfileForm"; import { Card, CardContent, CardHeader } from "@/components/ui/Card"; -import { Input, TextArea } from "@/components/ui/Input/Input"; import Spinner from "@/components/ui/Spinner"; import { Tooltip } from "@/components/ui/ToolTip"; import { Button } from "@/components/ui/button"; @@ -73,6 +73,7 @@ export const RenderProfile = (props: RenderProfileProps) => { console.error("Failed to update profile", error); } finally { setIsSubmitting(false); + auth.fetchCurrentUser(); } }; @@ -195,18 +196,18 @@ export const RenderProfile = (props: RenderProfileProps) => { ? `${user.first_name || ""} ${user.last_name || ""}` : "Anonymous Creator"} -
-

+

+

@ {user.username}

{user.permissions && ( -

+

{getRoleName(user.permissions)}

)}
-

+

Joined on{" "} {user.created_at ? formatJoinDate(user.created_at) @@ -243,128 +244,30 @@ export const RenderProfile = (props: RenderProfileProps) => { {isEditing ? ( -

-
-
- -

- Changing your username will change the URL for all your - posted listings. -

- setUsername(e.target.value)} - className="mt-1 block w-full" - /> - {isCheckingUsername && ( -

- Checking username... -

- )} - {!isCheckingUsername && isUsernameChanged && ( -

- {usernameError || - (isUsernameAvailable - ? "Username is available" - : "Username is not available")} -

- )} -
- -
-
- - setFirstName(e.target.value)} - className="mt-1 block w-full" - /> -
- -
- - setLastName(e.target.value)} - className="mt-1 block w-full" - /> -
-
- -
- -