Skip to content

Commit

Permalink
group-square-image
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Nov 11, 2024
1 parent 44e2e88 commit e46acba
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion components/molecules/CommentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function CommentSection({
setReplyProps,
}: CommentSectionProps) {
const { data: session } = useSession();
console.log(52, commentArr);


return (
<>
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/UserComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function UserComment({
});
setLikeArr((old) => [...old, session?.user.id]);
};
console.log(54, isReComment, parentId, commentId);

return (
<>
<Flex align="center" px={5} py={3} borderBottom="var(--border)">
Expand Down
8 changes: 0 additions & 8 deletions libs/study/getLocationByCoordinates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion modals/common/CollectionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function CollectionModal({ collection, setIsModal }: ICollectionModal) {
const footerOptions: IFooterOptions = {
main: {},
};

return (
<ModalLayout
title={collection?.alphabet ? "알파벳을 획득했어요!" : "출석 완료!"}
Expand Down
2 changes: 1 addition & 1 deletion modals/common/CommentEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function CommentEditModal({
isSecret,
}: CommentEditModalProps) {
const [isFirst, setIsFirst] = useState(true);
console.log(commentId, subCommentId);

const footerOptions: IFooterOptions = {
main: {
text: "변경",
Expand Down
3 changes: 1 addition & 2 deletions pageTemplates/group/GroupMine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { getRandomImage } from "../../utils/imageUtils";

function GroupMine() {
const { data } = useGroupsMineQuery(true, "pending");
console.log(42, data);

const setGroup = useSetRecoilState(transferGroupDataState);

Expand All @@ -20,7 +19,7 @@ function GroupMine() {
data
?.filter((group) => group.status !== "end")
.map((group) => ({
imageUrl: group.image || getRandomImage(),
imageUrl: group?.squareImage || getRandomImage(),
text: group.title,
url: `/group/${group.id}`,
func: () => setGroup(group),
Expand Down
4 changes: 2 additions & 2 deletions pageTemplates/square/SecretSquare/SecretSquareComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function SecretSquareComments({ author, comments, refetch }: SecretSquareComment

const [commentArr, setCommentArr] = useState<UserCommentProps[]>(comments || []);
const [replyProps, setReplyProps] = useState<ReplyProps>();
console.log(24, replyProps);

useEffect(() => {
setCommentArr(comments);
}, [comments]);
Expand Down Expand Up @@ -89,7 +89,7 @@ function SecretSquareComments({ author, comments, refetch }: SecretSquareComment
}
}
});
console.log(commentArr);

return (
<>
<Slide isNoPadding>
Expand Down
2 changes: 1 addition & 1 deletion pageTemplates/vote/voteDrawer/VoteDrawerPlace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 16 additions & 3 deletions pages/group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -166,7 +168,11 @@ function GroupPage() {
<Header title="소모임" isBack={false} />
<Slide isNoPadding>
<Layout>
{!isGuest && <Box minH="108px"><GroupMine /></Box>}
{!isGuest && (
<Box minH="108px">
<GroupMine />
</Box>
)}
<Box px={5} mt={5} mb={3}>
<SectionHeader title="전체 소모임" subTitle="All Small Group">
<Select
Expand Down Expand Up @@ -234,7 +240,14 @@ function GroupPage() {
participants={group.participants.map((user) =>
group.isSecret ? { user: ABOUT_USER_SUMMARY } : user,
)}
imageProps={{ image: group.image, isPriority: idx < 4 }}
imageProps={{
image:
group?.squareImage ||
GATHER_RANDOM_IMAGE_ARR[
getRandomIdx(GATHER_RANDOM_IMAGE_ARR.length - 1)
],
isPriority: idx < 4,
}}
maxCnt={group.memberCnt.max}
id={group.id}
func={() => setTransdferGroupData(group)}
Expand Down
1 change: 1 addition & 0 deletions types/models/groupTypes/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface IGroupWriting extends TimeStampProps {
gender: boolean;
isFree: boolean;
age: number[];
squareImage?: string;
password: string;
period: string;
organizer: IUser;
Expand Down

0 comments on commit e46acba

Please sign in to comment.