diff --git a/src/frontend/src/assets/profile-circle.png b/src/frontend/src/assets/profile-circle.png new file mode 100644 index 000000000..e63f97c59 Binary files /dev/null and b/src/frontend/src/assets/profile-circle.png differ diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index 455cdf8a4..eb27a1482 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -1,9 +1,12 @@ import { useContext } from "react"; +import profileCircle from "../../assets/profile-circle.png"; import { FaDiscord, FaGithub } from "react-icons/fa"; import { RiTwitterXFill } from "react-icons/ri"; import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; import AlertDropdown from "../../alerts/alertDropDown"; import { + BACKEND_URL, + BASE_URL_API, LOCATIONS_TO_RETURN, USER_PROJECTS_HEADER, } from "../../constants/constants"; @@ -192,34 +195,35 @@ export default function Header(): JSX.Element { variant="none" size="none" data-testid="user-profile-settings" - className={ - "h-7 w-7 rounded-full focus-visible:outline-0 " + - (userData?.profile_image ?? - (userData?.id - ? gradients[ - parseInt(userData?.id ?? "", 30) % gradients.length - ] - : "bg-gray-500")) - } - /> + > + + {!autoLogin && ( <>
-
+ {userData?.username ?? "User"}
diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx index a5a6b9c56..5e2cee180 100644 --- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import useAlertStore from "../../../../../../../../stores/alertStore"; import { gradients } from "../../../../../../../../utils/styleUtils"; import useGetProfilePictures from "./hooks/use-get-profile-pictures"; @@ -10,6 +10,8 @@ import { import HorizontalScrollFadeComponent from "../../../../../../../../components/horizontalScrollFadeComponent"; import LoadingComponent from "../../../../../../../../components/loadingComponent"; import Loading from "../../../../../../../../components/ui/loading"; +import { cn } from "../../../../../../../../utils/utils"; +import { Button } from "../../../../../../../../components/ui/button"; type ProfilePictureChooserComponentProps = { profilePictures: { [key: string]: string[] }; @@ -24,35 +26,53 @@ export default function ProfilePictureChooserComponent({ value, onChange, }: ProfilePictureChooserComponentProps) { + const ref = useRef(null); + + useEffect(() => { + if (value && ref) { + ref.current?.scrollIntoView({ behavior: "smooth", block: "center" }); + } + }, [ref]); + return (
{loading ? ( ) : ( Object.keys(profilePictures).map((folder, idx) => ( -
diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx index f8f77c5b7..a841ecc5e 100644 --- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx @@ -17,7 +17,7 @@ type ProfilePictureFormComponentProps = { profilePicture: string; handleInput: (event: any) => void; handlePatchProfilePicture: (gradient: string) => void; - handleGetProfilePictures: () => Promise; + handleGetProfilePictures: () => Promise; userData: any; }; const ProfilePictureFormComponent = ({