diff --git a/src/app/community/[id]/page.tsx b/src/app/community/[id]/page.tsx index e09f8dd2..d34f9b4a 100644 --- a/src/app/community/[id]/page.tsx +++ b/src/app/community/[id]/page.tsx @@ -133,7 +133,7 @@ const Page = () => { setIsModalOpen={setIsModalOpen} isUniversity={true} profileDp={userProfileData?.profile_dp?.imageUrl} - media={item?.imageUrl?.imageUrl} + media={item?.imageUrl} /> ))} diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx index d53bf2ad..77bcd72a 100644 --- a/src/app/community/page.tsx +++ b/src/app/community/page.tsx @@ -6,27 +6,6 @@ import UniversityCard from '@/components/universityCommunity/universityCommunity import { useGetUserSubscribedCommunityGroups } from '@/services/university-community' import Loading from '../loading' -// const data = [ -// { -// UniversityName: 'University of Seoul', -// UniversityAddress: '163 Seoulsiripdae-ro, Dongdaemun-gu, Seoul', -// UniversityLink: 'asd', -// universityLogo: 'https://www.stonybrook.edu/commcms/studyabroad/_images/university-logos/UOS_emblem.png', -// }, -// { -// UniversityName: 'University of Seoul', -// UniversityAddress: '163 Seoulsiripdae-ro, Dongdaemun-gu, Seoul', -// UniversityLink: 'asd', -// universityLogo: 'https://www.stonybrook.edu/commcms/studyabroad/_images/university-logos/UOS_emblem.png', -// }, -// { -// UniversityName: 'University of Seoul', -// UniversityAddress: '163 Seoulsiripdae-ro, Dongdaemun-gu, Seoul', -// UniversityLink: 'asd', -// universityLogo: 'https://www.stonybrook.edu/commcms/studyabroad/_images/university-logos/UOS_emblem.png', -// }, -// ] - const Page = () => { const { data: SubscribedData, isLoading } = useGetUserSubscribedCommunityGroups() diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx index 5e1bfda0..37922743 100644 --- a/src/app/register/page.tsx +++ b/src/app/register/page.tsx @@ -27,7 +27,7 @@ const SignUp = () => { const onSignupSubmit: SubmitHandler = (data) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { confirmPassword, tnc, country, city, ...signupData } = data + const { confirmPassword, tnc, ...signupData } = data mutateRegister(signupData) } diff --git a/src/app/timeline/page.tsx b/src/app/timeline/page.tsx index f2e34d6c..3534a67c 100644 --- a/src/app/timeline/page.tsx +++ b/src/app/timeline/page.tsx @@ -121,6 +121,7 @@ const Timeline = () => { \ No newline at end of file diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index 52a662fd..af6f69d8 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -11,7 +11,7 @@ import Image from 'next/image' import Link from 'next/link' //import demopic from '@assets/demopic.jpg' import star from '@assets/star.png' -import unibuzzLogo from '@assets/logo.svg' +import unibuzzLogo from '@assets/unibuzz_logo.svg' import { TbMailFilled } from 'react-icons/tb' import { FaBell } from 'react-icons/fa' import { usePathname } from 'next/navigation' @@ -276,10 +276,9 @@ const Navbar: React.FC = () => {
-
+
BACPAC LOGO - Unibuzz
diff --git a/src/components/Notifiaction/AssignNotification.tsx b/src/components/Notifiaction/AssignNotification.tsx index cd62673a..49fa49dd 100644 --- a/src/components/Notifiaction/AssignNotification.tsx +++ b/src/components/Notifiaction/AssignNotification.tsx @@ -14,7 +14,6 @@ type Props = { const AssignNotification = ({ id, senderName, communityGroupId, message, createdAt }: Props) => { const { mutate: updateIsSeen } = useUpdateIsSeenCommunityGroupNotification() - console.log('postId', communityGroupId) const handleIsSeenGroup = (id: string) => { const dataToPush = { @@ -23,6 +22,7 @@ const AssignNotification = ({ id, senderName, communityGroupId, message, created } // console.log('nData', dataToPush) updateIsSeen(dataToPush) + console.log('postId', communityGroupId) } return ( diff --git a/src/components/Notifiaction/CommentNotification.tsx b/src/components/Notifiaction/CommentNotification.tsx index 8168b949..0afbcb06 100644 --- a/src/components/Notifiaction/CommentNotification.tsx +++ b/src/components/Notifiaction/CommentNotification.tsx @@ -15,7 +15,6 @@ type Props = { const CommentNotification = ({ id, senderName, communityPostId, message, createdAt }: Props) => { const { mutate: updateIsSeen } = useUpdateIsSeenCommunityGroupNotification() - console.log('postId', communityPostId) const handleIsSeenGroup = (id: string) => { const dataToPush = { @@ -24,6 +23,7 @@ const CommentNotification = ({ id, senderName, communityPostId, message, created } // console.log('nData', dataToPush) updateIsSeen(dataToPush) + console.log('postId', communityPostId) } return (
diff --git a/src/components/Timeline/Modals/EditProfileModal.tsx b/src/components/Timeline/Modals/EditProfileModal.tsx index 862cdbb8..d8294dbe 100644 --- a/src/components/Timeline/Modals/EditProfileModal.tsx +++ b/src/components/Timeline/Modals/EditProfileModal.tsx @@ -37,7 +37,6 @@ const EditProfileModal = () => { } = useForm({ defaultValues: { fullname: userData.firstName, - email: userProfileData?.email[0]?.UniversityEmail || '', bio: userProfileData?.bio, phone_number: userProfileData?.phone_number, dob: userProfileData?.dob ? new Date(userProfileData?.dob).toISOString().split('T')[0] : '', @@ -133,26 +132,6 @@ const EditProfileModal = () => { {errors.city && Please enter your City!} - - - {errors.email && ( - - {' '} - {typeof errors.email.message === 'string' ? errors.email.message : 'Please enter your email!'} - - )} diff --git a/src/components/Timeline/Post.tsx b/src/components/Timeline/Post.tsx index 3d977fd8..bb25168e 100644 --- a/src/components/Timeline/Post.tsx +++ b/src/components/Timeline/Post.tsx @@ -6,7 +6,7 @@ import { IoPaperPlaneSharp } from 'react-icons/io5' // import Image from 'next/image' import { SlOptions } from 'react-icons/sl' import { FaBookmark } from 'react-icons/fa6' -import { MdOutlineImage } from 'react-icons/md' +// import { MdOutlineImage } from 'react-icons/md' import { MdGifBox, MdOutlineBookmarkBorder } from 'react-icons/md' import { HiReply, HiOutlineBell, HiOutlineFlag } from 'react-icons/hi' import { BiRepost } from 'react-icons/bi' @@ -52,7 +52,7 @@ interface PostProps { setModalContentType: React.Dispatch> setIsModalOpen: React.Dispatch> isUserProfile?: boolean - media?: string + media?: [] saved?: boolean isUniversity?: boolean postID?: string @@ -224,8 +224,10 @@ const Post: React.FC = ({
{/* media div */} {media && ( -
- media +
+ {media?.map((item: { imageUrl: string }) => ( + media + ))}
)} {/* Post Content */} @@ -285,16 +287,17 @@ const Post: React.FC = ({ placeholder="Add a comment..." className="flex-grow mx-1 sm:mx-4 p-1 border-none focus:outline-none w-full lg:min-w-[370px] xs:text-xs sm:text-sm" /> - + {/* */}
setImageValue(e.target.files[0])} + accept="image/gif,image/webp" />
@@ -340,6 +343,7 @@ const Post: React.FC = ({
+ {comment?.imageUrl?.imageUrl && }

{comment?.content}

diff --git a/src/components/Timeline/PostInput.tsx b/src/components/Timeline/PostInput.tsx index 71acdeb6..cacb6b70 100644 --- a/src/components/Timeline/PostInput.tsx +++ b/src/components/Timeline/PostInput.tsx @@ -20,27 +20,35 @@ interface PostInputProps { const PostInput: React.FC = ({ setIsModalOpen, setModalContentType, idToPost, profileDp }) => { const [inputValue, setInputValue] = useState('') - const [ImageValue, setImageValue] = useState(null) + const [ImageValue, setImageValue] = useState([]) const { mutate: CreateGroupPost } = useCreateGroupPost() const handleEmojiClick = (emojiData: any) => { setInputValue((prevValue) => prevValue + emojiData.emoji) } + const processImages = async (images: File[]) => { + const promises = images.map((image) => replaceImage(image, '')) + const results = await Promise.all(promises) + return results.map((result) => ({ + imageUrl: result?.imageUrl, + publicId: result?.publicId, + })) + } + const handleGroupPost = async () => { if (inputValue.length <= 1) { return console.log('Please type something to post!') } if (ImageValue) { - // setProfileImage(files[0]); - const imagedata: any = await replaceImage(ImageValue, '') - + const imagedata = await processImages(ImageValue) const data = { communityId: idToPost, content: inputValue, - imageUrl: { imageUrl: imagedata?.imageUrl, publicId: imagedata?.publicId }, + imageUrl: imagedata, } + CreateGroupPost(data) } else { const data = { @@ -69,21 +77,45 @@ const PostInput: React.FC = ({ setIsModalOpen, setModalContentTy {ImageValue && ( -
- -

setImageValue(null)} className="absolute right-0 top-0 w-5 h-5 bg-white rounded-full text-center"> - X -

+
+ {ImageValue?.map((item, idx) => ( +
+ +

setImageValue(ImageValue.filter((img) => img != item))} + className="absolute right-0 top-0 w-5 h-5 bg-white rounded-full text-center" + > + X +

+
+ ))}
)}
- setImageValue(e.target.files[0])} /> + setImageValue([...ImageValue, e.target.files[0]])} + />
- +
+ setImageValue([...ImageValue, e.target.files[0]])} + /> + +
{/* EMOJI Icon */} diff --git a/src/components/communityProfile/CommunityProfileContainer.tsx b/src/components/communityProfile/CommunityProfileContainer.tsx index c75791b9..2eed5f4f 100644 --- a/src/components/communityProfile/CommunityProfileContainer.tsx +++ b/src/components/communityProfile/CommunityProfileContainer.tsx @@ -58,6 +58,7 @@ const CommunityProfileContainer = () => { {selectedOption == valueType.Posts ? ( { ) : selectedOption == valueType.Media ? ( { setModalContentType={setModalContentType} setIsModalOpen={setIsModalOpen} isUserProfile={true} - media="https://cdn.pixabay.com/photo/2016/04/07/18/36/architecture-1314416_1280.jpg" + media={[]} /> ) : selectedOption == valueType.Saved ? ( { ) : ( +
-

{UniversityName}

+

{UniversityName}

{address}