Skip to content

Commit

Permalink
revert and fix next-auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Oct 24, 2024
1 parent 0caa319 commit 607e8ae
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 500 deletions.
2 changes: 1 addition & 1 deletion components/BottomNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions components/Icons/chatIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
/>
<g clipPath="url(#clip0_2234_1923)">
<g clip-path="url(#clip0_2234_1923)">
<path
fillRule="evenodd"
clipRule="evenodd"
clip-rule="evenodd"
d="M12.4899 10.3735C12.3873 10.3761 12.2853 10.3581 12.1897 10.3206C12.0942 10.2831 12.0071 10.2269 11.9336 10.1552C11.8602 10.0836 11.8018 9.9979 11.7619 9.90332C11.7221 9.80873 11.7016 9.70713 11.7016 9.60449C11.7016 9.50186 11.7222 9.40027 11.7621 9.30571C11.802 9.21115 11.8605 9.12554 11.934 9.05392C12.0075 8.9823 12.0946 8.92612 12.1902 8.88869C12.2858 8.85127 12.3878 8.83335 12.4904 8.836C12.6909 8.84118 12.8815 8.92448 13.0214 9.06813C13.1614 9.21179 13.2397 9.40444 13.2396 9.60499C13.2395 9.80555 13.1611 9.99815 13.0211 10.1417C12.881 10.2853 12.6904 10.3685 12.4899 10.3735ZM10.0329 10.3735C9.93028 10.3761 9.82813 10.3581 9.73252 10.3206C9.63692 10.2831 9.54979 10.2268 9.47627 10.1551C9.40275 10.0834 9.34433 9.99766 9.30446 9.90301C9.26458 9.80837 9.24405 9.7067 9.24409 9.60399C9.24412 9.50129 9.26471 9.39963 9.30465 9.30501C9.34459 9.21039 9.40306 9.12473 9.47663 9.05306C9.55019 8.98139 9.63736 8.92518 9.73299 8.88773C9.82862 8.85028 9.93078 8.83235 10.0334 8.835C10.2341 8.84018 10.4247 8.92353 10.5648 9.06728C10.7048 9.21103 10.7832 9.40381 10.7831 9.60449C10.783 9.80518 10.7046 9.9979 10.5644 10.1416C10.4243 10.2852 10.2336 10.3685 10.0329 10.3735ZM7.57545 10.3735C7.47285 10.3761 7.37076 10.3581 7.27522 10.3206C7.17967 10.2831 7.0926 10.2269 7.01913 10.1552C6.94565 10.0836 6.88727 9.9979 6.84742 9.90332C6.80757 9.80873 6.78706 9.70713 6.78709 9.60449C6.78713 9.50186 6.80771 9.40027 6.84762 9.30571C6.88753 9.21115 6.94597 9.12554 7.01948 9.05392C7.093 8.9823 7.18011 8.92612 7.27568 8.88869C7.37125 8.85127 7.47335 8.83335 7.57595 8.836C7.77644 8.84118 7.96697 8.92448 8.10692 9.06813C8.24687 9.21179 8.32516 9.40444 8.32509 9.60499C8.32503 9.80555 8.24661 9.99815 8.10657 10.1417C7.96653 10.2853 7.77594 10.3685 7.57545 10.3735ZM9.99995 4.75C7.08345 4.75 4.71045 6.907 4.71045 9.5585C4.71045 10.6935 5.19045 12.238 6.52745 13.235L6.36995 14.882C6.36404 14.9427 6.37475 15.0038 6.40094 15.0589C6.42714 15.114 6.46782 15.1609 6.51864 15.1946C6.56946 15.2283 6.62849 15.2475 6.68941 15.2503C6.75033 15.253 6.81084 15.2391 6.86445 15.21L8.57995 14.287C8.79345 14.309 9.42045 14.367 9.99995 14.367C12.9164 14.367 15.2894 12.21 15.2894 9.5585C15.2894 6.907 12.9164 4.75 9.99995 4.75Z"
fill="white"
/>
Expand Down
8 changes: 2 additions & 6 deletions components/molecules/navs/TabNav.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,7 +10,6 @@ interface ITabNav {
hasBorder?: boolean;
isMain?: boolean;
isFullSize?: boolean;
isLoading?: boolean;
}

export default function TabNav({
Expand All @@ -19,7 +18,6 @@ export default function TabNav({
hasBorder = true,
isMain = false,
isFullSize,
isLoading,
}: ITabNav) {
const idx = tabOptionsArr.findIndex((tab) => tab.text === selected);

Expand Down Expand Up @@ -64,9 +62,7 @@ export default function TabNav({
boxShadow: "none",
}}
>
<Skeleton w="54px" isLoaded={!isLoading}>
{tab.text}
</Skeleton>
{tab.text}
</Tab>
))}
</TabList>
Expand Down
2 changes: 1 addition & 1 deletion constants/keys/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
4 changes: 1 addition & 3 deletions modals/common/CollectionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ function CollectionModal({ collection, setIsModal }: ICollectionModal) {
>
<>
{collection?.alphabet ? (
<Flex justify="center">
<AboutIcon alphabet={collection.alphabet} size="lg" isActive />
</Flex>
<AboutIcon alphabet={collection.alphabet} size="lg" isActive />
) : (
<Box w="100%">
<Flex w="100%" justify="space-between" px={3}>
Expand Down
129 changes: 0 additions & 129 deletions modals/pop-up/StudyChallengeModal.tsx

This file was deleted.

37 changes: 6 additions & 31 deletions pageTemplates/setting/userSetting/userSettingPopUp.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 =
Expand All @@ -34,8 +29,7 @@ export type UserPopUp =
// | "alphabet"
// | "enthusiastic"
// | "instagram"
| "registerLocation"
| "studyChallenge";
| "registerLocation";

const MODAL_COMPONENTS = {
faq: FAQPopUp,
Expand All @@ -48,7 +42,6 @@ const MODAL_COMPONENTS = {
// manager: ManagerPopUp,
// instagram: InstaPopUp,
registerLocation: LocationRegisterPopUp,
studyChallenge: StudyChallengeModal,
};

interface UserSettingPopUpProps {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -197,30 +184,19 @@ export default function UserSettingPopUp({ userInfo }: UserSettingPopUpProps) {
<BottomFlexDrawer
isDrawerUp
isOverlay
height={429}
height={260}
isHideBottom
setIsModal={() => setDrawerType(null)}
>
<Box
py={3}
lineHeight="32px"
w="100%"
fontWeight="semibold"
fontSize="20px"
textAlign="start"
>
지난 스터디 결과가 도착했어요 <br /> 기록을 확인해볼까요?
</Box>
<Box p={5}>
<Image src="/51.png" width={160} height={160} alt="studyResult" />
<Box w="100%" fontWeight={600} fontSize="18px" textAlign="start">
어제의 스터디 기록이 도착했어요! <br /> 기록을 확인해볼까요?
</Box>

<Flex direction="column" mt="auto" w="100%">
<Link href={`/study/result?date=${studyRecord?.date}`} style={{ width: "100%" }}>
{/* <Link href={`/study/result?date=${studyRecord?.date}`} style={{ width: "100%" }}>
<Button w="full" size="lg" colorScheme="black" onClick={() => setDrawerType("right")}>
확인 하러가기
</Button>
</Link>
</Link> */}
<Button
my={2}
h="24px"
Expand All @@ -234,7 +210,6 @@ export default function UserSettingPopUp({ userInfo }: UserSettingPopUpProps) {
</Flex>
</BottomFlexDrawer>
)}

{/* {drawerType === "right" && <RightDrawer>23</RightDrawer>} */}
</>
);
Expand Down
19 changes: 5 additions & 14 deletions pageTemplates/study/StudyHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,24 @@ import AlertSimpleModal from "../../components/AlertSimpleModal";
import { EllipsisIcon } from "../../components/Icons/DotIcons";
import Header from "../../components/layouts/Header";
import { WEB_URL } from "../../constants/system";
import { useTypeToast } from "../../hooks/custom/CustomToast";
import { dayjsToFormat } from "../../utils/dateTimeUtils";
interface IStudyHeader {
brand: string;
name?: string;
address?: string;
coverImage?: string;
name: string;
address: string;
coverImage: string;
}

function StudyHeader({ brand, name, address, coverImage }: IStudyHeader) {
const { date } = useParams<{ date: string }>() || {};
const typeToast = useTypeToast();
const router = useRouter();
const [isModal, setIsModal] = useState(false);
const url = WEB_URL + router?.asPath;

const onClick = () => {
if (name) setIsModal(true);
else {
typeToast("not-yet");
}
};

return (
<>
<Header title={brand} isCenter defaultUrl="/home">
<Button variant="unstyled" onClick={onClick}>
<Button variant="unstyled" onClick={() => setIsModal(true)}>
<EllipsisIcon />
</Button>
{/* <KakaoShareBtn
Expand All @@ -46,7 +37,7 @@ function StudyHeader({ brand, name, address, coverImage }: IStudyHeader) {
url={url}
/> */}
</Header>

{/* {isModal && <BottomButtonColDrawer infoArr={infoArr} setIsModal={setIsModal} />} */}
{isModal && (
<AlertSimpleModal
options={{
Expand Down
Loading

0 comments on commit 607e8ae

Please sign in to comment.