diff --git a/client/pages/profile/index.js b/client/pages/profile/index.js index 6e88ad5..197ac4b 100644 --- a/client/pages/profile/index.js +++ b/client/pages/profile/index.js @@ -5,7 +5,7 @@ import RHeader from "@/components/header"; import UpdateUsername from "@/components/changeusername"; import { Button, Modal, ModalBody, ModalFooter, Form, FormGroup, Label, Input } from "reactstrap"; import ChangePassword from "@/components/changepassword"; - +import FilesApi from "@/Api/FilesApi"; const ProfileCard = () => { @@ -15,6 +15,8 @@ const ProfileCard = () => { const [showUpdateUsername, setShowUpdateUsername] = useState(false); const [imagesExpanded, setImagesExpanded] = useState(false); const imagesContainerRef = useRef(null); + const [images, setImages] = useState([]); + const [loading, setLoading] = useState(true); const toggleImagesExpanded = () => { setImagesExpanded(!imagesExpanded); @@ -48,7 +50,41 @@ const ProfileCard = () => { fetchUsername(); }, []); -const toggleUpdateUsernameModal = () => { + + useEffect(() => { + const fetchImages = async () => { + const userId = sessionStorage.getItem('uid'); + const response = await FilesApi.get(`/user/${userId}`); + setImages(response.data); + setLoading(false); + }; + + fetchImages(); + }, []); + + const renderImages = () => { + if (loading) { + return
Enjoy Stylizing your best Selfies
FaceStylizer is a Non-Profit Organization