diff --git a/components/BottomNav.tsx b/components/BottomNav.tsx index 9fdfd09ca..489da5d74 100644 --- a/components/BottomNav.tsx +++ b/components/BottomNav.tsx @@ -41,7 +41,7 @@ export default function BottomNav() { const getParams = (category: Category) => { switch (category) { case "홈": - return `?location=${locationEn}&date=${getStudyStandardDate()}`; + return `?tab=study&location=${locationEn}&date=${getStudyStandardDate()}`; case undefined: newSearchParams.append("write", "on"); return pathname + "?" + newSearchParams.toString(); diff --git a/components/Icons/chatIcons.tsx b/components/Icons/chatIcons.tsx index 39bc0fd8c..ee78eb78c 100644 --- a/components/Icons/chatIcons.tsx +++ b/components/Icons/chatIcons.tsx @@ -6,12 +6,12 @@ export function ChatTalkIcon({ isActive }: { isActive: boolean }) { height="20" rx="10" fill="#A0AEC0" - fillOpacity={isActive ? "0.64" : "0.32"} + fill-opacity={isActive ? "0.64" : "0.32"} /> - + diff --git a/components/molecules/navs/TabNav.tsx b/components/molecules/navs/TabNav.tsx index 122597518..425288b9b 100644 --- a/components/molecules/navs/TabNav.tsx +++ b/components/molecules/navs/TabNav.tsx @@ -1,4 +1,4 @@ -import { Skeleton, Tab, TabList, Tabs } from "@chakra-ui/react"; +import { Tab, TabList, Tabs } from "@chakra-ui/react"; export interface ITabNavOptions { text: string; func: () => void; @@ -10,7 +10,6 @@ interface ITabNav { hasBorder?: boolean; isMain?: boolean; isFullSize?: boolean; - isLoading?: boolean; } export default function TabNav({ @@ -19,7 +18,6 @@ export default function TabNav({ hasBorder = true, isMain = false, isFullSize, - isLoading, }: ITabNav) { const idx = tabOptionsArr.findIndex((tab) => tab.text === selected); @@ -64,9 +62,7 @@ export default function TabNav({ boxShadow: "none", }} > - - {tab.text} - + {tab.text} ))} diff --git a/constants/keys/localStorage.ts b/constants/keys/localStorage.ts index 6e616b34f..ebd3d12ec 100644 --- a/constants/keys/localStorage.ts +++ b/constants/keys/localStorage.ts @@ -50,4 +50,4 @@ export const USER_LOCATION = "userLocation"; //스터디 출석 export const STUDY_ATTEND_INFO = "studyAttendInfo"; -export const STUDY_RECORD = "studyRecord"; +export const STUDY_RECORD_INFO = "studyRecordInfo"; diff --git a/modals/common/CollectionModal.tsx b/modals/common/CollectionModal.tsx index 4db6643ce..26dcc8a91 100644 --- a/modals/common/CollectionModal.tsx +++ b/modals/common/CollectionModal.tsx @@ -25,9 +25,7 @@ function CollectionModal({ collection, setIsModal }: ICollectionModal) { > <> {collection?.alphabet ? ( - - - + ) : ( diff --git a/modals/pop-up/StudyChallengeModal.tsx b/modals/pop-up/StudyChallengeModal.tsx deleted file mode 100644 index ea84b59ab..000000000 --- a/modals/pop-up/StudyChallengeModal.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { Box, Button, Flex, Grid, ListItem, UnorderedList } from "@chakra-ui/react"; -import dayjs from "dayjs"; -import { useState } from "react"; - -import InfoBoxCol, { InfoBoxProps } from "../../components/molecules/InfoBoxCol"; -import { useToast } from "../../hooks/custom/CustomToast"; -import { useUserInfoFieldMutation } from "../../hooks/user/mutations"; -import { useUserInfoQuery } from "../../hooks/user/queries"; -import { IModal } from "../../types/components/modalTypes"; -import { dayjsToFormat, getWeekNumber } from "../../utils/dateTimeUtils"; -import { IFooterOptions, ModalLayout } from "../Modals"; - -function StudyChallengeModal({ setIsModal }: IModal) { - const toast = useToast(); - const { data: userInfo } = useUserInfoQuery(); - - const today = dayjs().day() === 0 ? dayjs().add(1, "day") : dayjs(); - - const [targetTime, setTargetTime] = useState(3); - - const timeArr = [3, 4, 5, 6, 8, 10, 12, null]; - - const { mutate, isLoading } = useUserInfoFieldMutation("weekStudyTargetHour", { - onSuccess() { - if (targetTime) { - toast("success", "신청 완료! 이번주 공부 목표 달성을 응원합니다!"); - } else { - toast("success", "다음번엔 참여해 주세요!"); - } - setIsModal(false); - }, - }); - - const handleSubmit = () => { - mutate({ hour: targetTime }); - }; - - const infoBoxPropsArr: InfoBoxProps[] = [ - { - category: "보유 금액", - text: `${userInfo?.deposit}원`, - }, - { - category: "소모 금액", - text: targetTime ? "-1000원" : "0원", - color: "red", - }, - { - category: "환급 금액", - text: targetTime ? `1000원 + ${targetTime * 10} POINT` : "0원", - color: "mint", - }, - ]; - - const footerOptions: IFooterOptions = { - main: { - text: "신 청", - func: handleSubmit, - isLoading, - }, - isFull: true, - }; - - return ( - <> - - - 이번주 공부 목표 시간을 정하고, 도전해 보세요! -
- 달성률에 따라 추가 포인트를 획득할 수 있습니다. -
- - - - 주간 목표 - - - - {timeArr.map((time, idx) => ( - - ))} - - - - - - - 누적 시간은 카페 공부 시간 기준으로 측정됩니다. - 실패하더라도 실패 정도에 따라 환급됩니다. - -
{" "} - - ); -} - -export default StudyChallengeModal; diff --git a/pageTemplates/setting/userSetting/userSettingPopUp.tsx b/pageTemplates/setting/userSetting/userSettingPopUp.tsx index 613fe4004..360e60dce 100644 --- a/pageTemplates/setting/userSetting/userSettingPopUp.tsx +++ b/pageTemplates/setting/userSetting/userSettingPopUp.tsx @@ -1,8 +1,6 @@ import { Box, Button, Flex } from "@chakra-ui/react"; import dayjs from "dayjs"; import { useSession } from "next-auth/react"; -import Image from "next/image"; -import Link from "next/link"; import { useEffect, useState } from "react"; import BottomFlexDrawer from "../../../components/organisms/drawer/BottomFlexDrawer"; @@ -12,16 +10,13 @@ import { GATHER_JOIN_MEMBERS, PROMOTION_POP_UP, STUDY_ATTEND_MEMBERS, - STUDY_RECORD, } from "../../../constants/keys/localStorage"; import { useGatherQuery } from "../../../hooks/gather/queries"; import PromotionModal from "../../../modals/aboutHeader/promotionModal/PromotionModal"; import FAQPopUp from "../../../modals/pop-up/FAQPopUp"; import LastWeekAttendPopUp from "../../../modals/pop-up/LastWeekAttendPopUp"; import LocationRegisterPopUp from "../../../modals/pop-up/LocationRegisterPopUp"; -import StudyChallengeModal from "../../../modals/pop-up/StudyChallengeModal"; import { IUser, IUserSummary } from "../../../types/models/userTypes/userInfoTypes"; -import { dayjsToStr } from "../../../utils/dateTimeUtils"; import { checkAndSetLocalStorage } from "../../../utils/storageUtils"; export type UserPopUp = @@ -34,8 +29,7 @@ export type UserPopUp = // | "alphabet" // | "enthusiastic" // | "instagram" - | "registerLocation" - | "studyChallenge"; + | "registerLocation"; const MODAL_COMPONENTS = { faq: FAQPopUp, @@ -48,7 +42,6 @@ const MODAL_COMPONENTS = { // manager: ManagerPopUp, // instagram: InstaPopUp, registerLocation: LocationRegisterPopUp, - studyChallenge: StudyChallengeModal, }; interface UserSettingPopUpProps { @@ -64,9 +57,6 @@ export default function UserSettingPopUp({ userInfo }: UserSettingPopUpProps) { const { data: gatherData } = useGatherQuery(-1); - const studyRecordStr = localStorage.getItem(STUDY_RECORD); - const studyRecord = JSON.parse(studyRecordStr); - useEffect(() => { return; if (!gatherData) return; @@ -153,9 +143,6 @@ export default function UserSettingPopUp({ userInfo }: UserSettingPopUpProps) { // setModalTypes((old) => [...old, "studyChallenge"]); // } - if (studyRecord && studyRecord?.date !== dayjsToStr(dayjs())) { - setDrawerType("bottom"); - } // if (!checkAndSetLocalStorage(SUGGEST_POP_UP, 29)) { // setModalTypes((old) => [...old, "suggest"]); // if (popUpCnt++ === 2) return; @@ -197,30 +184,19 @@ export default function UserSettingPopUp({ userInfo }: UserSettingPopUpProps) { setDrawerType(null)} > - - 지난 스터디 결과가 도착했어요
기록을 확인해볼까요? -
- - studyResult + + 어제의 스터디 기록이 도착했어요!
기록을 확인해볼까요?
- - + {/* - + */} {/* */} - + {/* {isModal && } */} {isModal && ( { - localStorage.setItem(STUDY_RECORD, null); - }, []); - - const { data: studyVoteOne } = useStudyVoteOneQuery(dateParam, { - enabled: !!dateParam, - }); - - const findRealTime = studyVoteOne?.data?.[0] as RealTimeInfoProps; - - const findParticipation = studyVoteOne?.data as StudyParticipationProps; - const findParStudy = findParticipation?.members?.find((who) => who.user.uid === userInfo?.uid); - - const commonAttendanceInfo = findRealTime || findParStudy; - const rankNum = studyVoteOne?.rankNum; - - const alphabet = - collectionInfo?.stamps === 0 - ? collectionInfo?.collects?.[collectionInfo?.collects?.length - 1] - : null; - - //스터디 기본 이미지 - const { text: badgeText, colorScheme: badgeColorScheme } = - STUDY_STATUS_TO_BADGE[findRealTime?.status || findParticipation?.status] || {}; - - const studyTime = dayjs(commonAttendanceInfo?.time.end).diff( - dayjs(commonAttendanceInfo?.attendanceInfo?.arrived), - "m", - ); - - const getStudyTime = `${Math.floor(studyTime / 60)}시간 ${studyTime % 60}분`; - const members = - findParticipation?.members?.filter((who) => who.user.uid !== userInfo?.uid) || - (studyVoteOne?.data as RealTimeInfoProps[])?.filter( - (one) => one.place.name === findRealTime?.place.name && one.user.uid !== userInfo?.uid, - ); - - const lateTime = - dayjs(commonAttendanceInfo?.attendanceInfo.arrived).diff( - dayjs(commonAttendanceInfo?.time?.start), - "m", - ) > 0 - ? `${dayjs(commonAttendanceInfo?.attendanceInfo.arrived).diff( - dayjs(commonAttendanceInfo?.time?.start), - "m", - )}분 지각` - : "빠른 출석"; - - const accumulationHour = - userInfo && - `${Math.ceil(userInfo.weekStudyAccumulationMinutes / 60)}시간 ${userInfo.weekStudyAccumulationMinutes % 60}분`; - - const gridProps = commonAttendanceInfo && [ - { - title: "목표 시간", - text: `${dayjsToTime(dayjs(commonAttendanceInfo.time.start))} ~ ${dayjsToTime(dayjs(commonAttendanceInfo.time.end))}`, - }, - { - title: "출석 체크", - text: `${dayjsToTime(dayjs(commonAttendanceInfo.attendanceInfo.arrived))}(${lateTime})`, - }, - { - title: "달성 시간", - text: getStudyTime, - }, - { - title: "이번 주 누적 시간", - text: accumulationHour, - }, - ]; - - const targetHour = userInfo?.weekStudyTragetHour; - - return ( - <> - - - {studyVoteOne && ( - <> - - studyRecordImage - - - - {dayjsToFormat(dayjs(dateParam).locale("ko"), "M월 D일(ddd) 스터디")} - - - {badgeText} - - - - - 주간 목표 시간 - {targetHour ? `${targetHour}시간` : "미설정"} - - - - - - - - 누적 스터디 시간 - - {accumulationHour} - - - - - {gridProps.map((prop) => ( - - - {prop.title} - - - {prop.text} - - - ))} - - - - - - 스터디 랭킹 - - - - - -
- } - /> - - - - - - ) : ( - - - - ) - } - mainText={alphabet ? `알파벳 ${changeAlphabet(alphabet)} 획득` : "스탬프 획득"} - subText={ - alphabet - ? "알파벳을 수집해 상품을 획득해 봐요!" - : "스탬프를 모아 알파벳을 획득해 봐요 !" - } - /> - -
{" "} - - - 같이 공부한 인원 - - - {members.map((member, idx) => { - const isMyFriend = userInfo?.friend.includes(member.user.uid); - - return ( - - - - - } - /> - ); - })} - - - )} - - router.push("/home")} - /> - - ); -} - -export default StudyResultPage; diff --git a/pages/studyPage.tsx b/pages/studyPage.tsx index 1ecc20596..06b09a745 100644 --- a/pages/studyPage.tsx +++ b/pages/studyPage.tsx @@ -12,7 +12,7 @@ import VoteMap from "../components/organisms/VoteMap"; import { USER_LOCATION } from "../constants/keys/localStorage"; import { LOCATION_CENTER_DOT, - LOCATION_MAX_BOUNDARY + LOCATION_MAX_BOUNDARY, } from "../constants/serviceConstants/studyConstants/studyVoteMapConstants"; import { STUDY_COMMENT_ARR } from "../constants/settingValue/comment"; import { useStudyVoteQuery } from "../hooks/study/queries"; @@ -24,7 +24,7 @@ import { getStudyTime } from "../libs/study/getStudyTime"; import { getCurrentLocationIcon, getStudyIcon, - getStudyVoteIcon + getStudyVoteIcon, } from "../libs/study/getStudyVoteIcon"; import StudyInFoDrawer, { StudyInfoProps } from "../pageTemplates/studyPage/StudyInfoDrawer"; import StudyMapTopNav from "../pageTemplates/studyPage/StudyMapTopNav"; @@ -37,7 +37,7 @@ import { IMapOptions, IMarkerOptions } from "../types/externals/naverMapTypes"; import { StudyDailyInfoProps, StudyPlaceProps, - StudyStatus + StudyStatus, } from "../types/models/studyTypes/studyDetails"; import { PlaceInfoProps } from "../types/models/utilTypes"; import { ActiveLocation, LocationEn } from "../types/services/locationTypes"; @@ -94,7 +94,7 @@ export default function StudyPage() { newSearchParams.set("center", myStudyParticipation ? "votePlace" : "locationPlace"); newSearchParams.set("location", `${convertLocationLangTo(locationValue, "en")}`); - newSearchParams.set("date", `${ getStudyViewDate(dayjs(date))}`); + newSearchParams.set("date", `${getStudyViewDate(dayjs(date))}`); router.replace(`/studyPage?${newSearchParams.toString()}`); diff --git a/pages/vote/attend/configuration.tsx b/pages/vote/attend/configuration.tsx index 6f2d448cc..6ff43d584 100644 --- a/pages/vote/attend/configuration.tsx +++ b/pages/vote/attend/configuration.tsx @@ -1,7 +1,7 @@ import { Box } from "@chakra-ui/react"; import dayjs from "dayjs"; -import { useRouter, useSearchParams } from "next/navigation"; import { useSession } from "next-auth/react"; +import { useRouter, useSearchParams } from "next/navigation"; import { useEffect, useRef, useState } from "react"; import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil"; @@ -14,7 +14,6 @@ import Textarea from "../../../components/atoms/Textarea"; import BottomNav from "../../../components/layouts/BottomNav"; import Header from "../../../components/layouts/Header"; import Slide from "../../../components/layouts/PageSlide"; -import { STUDY_RECORD } from "../../../constants/keys/localStorage"; import { POINT_SYSTEM_DEPOSIT, POINT_SYSTEM_PLUS, @@ -39,13 +38,12 @@ import { import { CollectionProps } from "../../../types/models/collections"; import { StudyPlaceProps } from "../../../types/models/studyTypes/studyDetails"; import { convertTimeStringToDayjs } from "../../../utils/convertUtils/convertTypes"; -import { dayjsToFormat, dayjsToStr } from "../../../utils/dateTimeUtils"; +import { dayjsToFormat } from "../../../utils/dateTimeUtils"; function Configuration() { const router = useRouter(); const searchParams = useSearchParams(); const newSearchParams = new URLSearchParams(searchParams); - const { data: session } = useSession(); const toast = useToast(); const typeToast = useTypeToast(); @@ -131,16 +129,15 @@ function Configuration() { } newSearchParams.set("center", "votePlace"); - newSearchParams.set("date", dayjsToStr(dayjs())); - newSearchParams.set("voteDrawer", "down"); router.push(`/studyPage?${newSearchParams.toString()}`); }; const saveTogetherMembers = () => { - const record = { - date: dayjsToStr(dayjs()), - }; - localStorage.setItem(STUDY_RECORD, JSON.stringify(record)); + // const myStudyInfo = getMyStudyInfo(myStudyParticipation, session?.user.uid); + // const record = { + // date: dayjsToStr(dayjs()), + // }; + // localStorage.setItem(STUDY_RECORD_INFO, JSON.stringify(record)); }; const formData = new FormData(); diff --git a/public/51.png b/public/51.png deleted file mode 100644 index ac6911d30..000000000 Binary files a/public/51.png and /dev/null differ