From e46acbae50a7c7e57a878d7ee8536b1b2dd71c95 Mon Sep 17 00:00:00 2001 From: LSJ Date: Mon, 11 Nov 2024 23:09:05 +0900 Subject: [PATCH] group-square-image --- components/molecules/CommentSection.tsx | 2 +- components/molecules/UserComment.tsx | 2 +- libs/study/getLocationByCoordinates.ts | 8 -------- modals/common/CollectionModal.tsx | 2 +- modals/common/CommentEditModal.tsx | 2 +- pageTemplates/group/GroupMine.tsx | 3 +-- .../SecretSquare/SecretSquareComments.tsx | 4 ++-- .../vote/voteDrawer/VoteDrawerPlace.tsx | 2 +- pages/group/index.tsx | 19 ++++++++++++++++--- types/models/groupTypes/group.ts | 1 + 10 files changed, 25 insertions(+), 20 deletions(-) diff --git a/components/molecules/CommentSection.tsx b/components/molecules/CommentSection.tsx index 2cfed9754..f9eeaedbf 100644 --- a/components/molecules/CommentSection.tsx +++ b/components/molecules/CommentSection.tsx @@ -22,7 +22,7 @@ function CommentSection({ setReplyProps, }: CommentSectionProps) { const { data: session } = useSession(); - console.log(52, commentArr); + return ( <> diff --git a/components/molecules/UserComment.tsx b/components/molecules/UserComment.tsx index 602d9eca1..02c782139 100644 --- a/components/molecules/UserComment.tsx +++ b/components/molecules/UserComment.tsx @@ -137,7 +137,7 @@ function UserComment({ }); setLikeArr((old) => [...old, session?.user.id]); }; - console.log(54, isReComment, parentId, commentId); + return ( <> diff --git a/libs/study/getLocationByCoordinates.ts b/libs/study/getLocationByCoordinates.ts index 99405c9dc..566b35206 100644 --- a/libs/study/getLocationByCoordinates.ts +++ b/libs/study/getLocationByCoordinates.ts @@ -6,14 +6,6 @@ export function getLocationByCoordinates(lat: number, lon: number): string | nul const isWithinLatitude = lat >= southwest.latitude && lat <= northeast.latitude; const isWithinLongitude = lon >= southwest.longitude && lon <= northeast.longitude; - console.log( - lat, - lon, - southwest.latitude, - northeast.latitude, - isWithinLatitude, - isWithinLongitude, - ); if (isWithinLatitude && isWithinLongitude) { return location; } diff --git a/modals/common/CollectionModal.tsx b/modals/common/CollectionModal.tsx index 26dcc8a91..2265d60f6 100644 --- a/modals/common/CollectionModal.tsx +++ b/modals/common/CollectionModal.tsx @@ -16,7 +16,7 @@ function CollectionModal({ collection, setIsModal }: ICollectionModal) { const footerOptions: IFooterOptions = { main: {}, }; - + return ( group.status !== "end") .map((group) => ({ - imageUrl: group.image || getRandomImage(), + imageUrl: group?.squareImage || getRandomImage(), text: group.title, url: `/group/${group.id}`, func: () => setGroup(group), diff --git a/pageTemplates/square/SecretSquare/SecretSquareComments.tsx b/pageTemplates/square/SecretSquare/SecretSquareComments.tsx index 0b1db0f1d..df4e473a9 100644 --- a/pageTemplates/square/SecretSquare/SecretSquareComments.tsx +++ b/pageTemplates/square/SecretSquare/SecretSquareComments.tsx @@ -36,7 +36,7 @@ function SecretSquareComments({ author, comments, refetch }: SecretSquareComment const [commentArr, setCommentArr] = useState(comments || []); const [replyProps, setReplyProps] = useState(); - console.log(24, replyProps); + useEffect(() => { setCommentArr(comments); }, [comments]); @@ -89,7 +89,7 @@ function SecretSquareComments({ author, comments, refetch }: SecretSquareComment } } }); - console.log(commentArr); + return ( <> diff --git a/pageTemplates/vote/voteDrawer/VoteDrawerPlace.tsx b/pageTemplates/vote/voteDrawer/VoteDrawerPlace.tsx index d2e3877d8..13a59d19b 100644 --- a/pageTemplates/vote/voteDrawer/VoteDrawerPlace.tsx +++ b/pageTemplates/vote/voteDrawer/VoteDrawerPlace.tsx @@ -54,7 +54,7 @@ export function VoteDrawerPlace({ setIsRightDrawer, setIsVoteDrawer, date }: Pla return; } const changeLocation = getLocationByCoordinates(+placeInfo?.y, +placeInfo?.x); - console.log(34, changeLocation); + if (!changeLocation) { toast("warning", "서비스중인 지역이 아닙니다."); return; diff --git a/pages/group/index.tsx b/pages/group/index.tsx index 16067d6e1..cb1f866f0 100644 --- a/pages/group/index.tsx +++ b/pages/group/index.tsx @@ -5,6 +5,8 @@ import { useEffect, useRef, useState } from "react"; import { useSetRecoilState } from "recoil"; import styled from "styled-components"; +// import RuleModal from "../../components/modals/RuleModal"; +import { GATHER_RANDOM_IMAGE_ARR } from "../../assets/images/randomImages"; import { MainLoadingAbsolute } from "../../components/atoms/loaders/MainLoading"; import SectionHeader from "../../components/atoms/SectionHeader"; import Select from "../../components/atoms/Select"; @@ -13,7 +15,6 @@ import Header from "../../components/layouts/Header"; import Slide from "../../components/layouts/PageSlide"; import { GroupThumbnailCard } from "../../components/molecules/cards/GroupThumbnailCard"; import ButtonGroups from "../../components/molecules/groups/ButtonGroups"; -// import RuleModal from "../../components/modals/RuleModal"; import TabNav, { ITabNavOptions } from "../../components/molecules/navs/TabNav"; import { GROUP_STUDY_CATEGORY_ARR, @@ -27,6 +28,7 @@ import GroupSkeletonMain from "../../pageTemplates/group/GroupSkeletonMain"; import { transferGroupDataState } from "../../recoils/transferRecoils"; import { GroupCategory, IGroup } from "../../types/models/groupTypes/group"; import { shuffleArray } from "../../utils/convertUtils/convertDatas"; +import { getRandomIdx } from "../../utils/mathUtils"; interface ICategory { main: GroupCategory; @@ -166,7 +168,11 @@ function GroupPage() {
- {!isGuest && } + {!isGuest && ( + + + + )}