diff --git a/src/api/planet/space/space.tsx b/src/api/planet/space/space.tsx index be14117d..1057331e 100644 --- a/src/api/planet/space/space.tsx +++ b/src/api/planet/space/space.tsx @@ -1,4 +1,4 @@ -import { authClient } from "@/api/client"; +import { authClient } from '@/api/client'; // 메인 스페이스 아이디 조회 export const getMainId = async () => { @@ -7,6 +7,13 @@ export const getMainId = async () => { return response; }; +// 메인 스페이스 변경 +export const putMainSpace = async (spaceId: string) => { + const response = await authClient.put(`/api/v1/spaces/${spaceId}/main`); + + return response; +}; + // 특정 스페이스 조회 export const getSpaceInfo = async (spaceId: string) => { const response = await authClient.get(`/api/v1/spaces/${spaceId}`); @@ -21,14 +28,14 @@ export const getSpaceList = async () => { // 스페이스 생성 export const postNewSpace = async ({ spaceName, - templateType, + templateType }: { spaceName: string; templateType: number; }) => { return await authClient.post(`/api/v1/spaces`, { spaceName: spaceName, - templateType: templateType, + templateType: templateType }); }; @@ -40,30 +47,30 @@ export const deleteSpace = async ({ spaceId }: { spaceId: string }) => { // 여러 스페이스 삭제 export const deleteSpaces = async ({ spaceIds }: { spaceIds: string[] }) => { return await authClient.delete(`/api/v1/spaces`, { - data: { spaceIds }, + data: { spaceIds } }); }; // 스페이스 이름 수정 export const putSpace = async ({ spaceId, - spaceName, + spaceName }: { spaceId: string; spaceName: string; }) => { return await authClient.put(`/api/v1/spaces/${spaceId}/name`, { - spaceName, + spaceName }); }; // 스페이스 순서 변경 export const putSpacesOrder = async ({ - orders, + orders }: { orders: { spaceId: string; index: number }[]; }) => { return await authClient.put(`/api/v1/spaces/order`, { - orders, + orders }); }; diff --git a/src/app/mypage/send/page.tsx b/src/app/mypage/send/page.tsx index 66a8d7da..a3ad98d9 100644 --- a/src/app/mypage/send/page.tsx +++ b/src/app/mypage/send/page.tsx @@ -1,20 +1,20 @@ -"use client"; +'use client'; import { deleteSentLetter, deleteSentLetters, - getSentLetter, -} from "@/api/mypage/user"; -import Button from "@/components/common/Button"; -import ConfirmModal from "@/components/common/ConfirmModal"; -import Loader, { LoaderContainer } from "@/components/common/Loader"; -import NavigatorBar from "@/components/common/NavigatorBar"; -import LetterTag from "@/components/mypage/LetterTag"; -import { useToast } from "@/hooks/useToast"; -import { SentLetterListType } from "@/types/letter"; -import { useRouter } from "next/navigation"; -import { Suspense, useEffect, useState } from "react"; -import styled from "styled-components"; + getSentLetter +} from '@/api/mypage/user'; +import Button from '@/components/common/Button'; +import ConfirmModal from '@/components/common/ConfirmModal'; +import Loader, { LoaderContainer } from '@/components/common/Loader'; +import NavigatorBar from '@/components/common/NavigatorBar'; +import LetterTag from '@/components/mypage/LetterTag'; +import { useToast } from '@/hooks/useToast'; +import { SentLetterListType } from '@/types/letter'; +import { useRouter } from 'next/navigation'; +import { Suspense, useEffect, useState } from 'react'; +import styled from 'styled-components'; const SendedLetter = () => { const [isSelecting, setIsSelecting] = useState(false); // 항목을 선택중인지 @@ -49,7 +49,7 @@ const SendedLetter = () => { await fetchDeleteLetter(selectedId); setIsSelecting(false); setSelectedId([]); - console.log("Deleted IDs:", selectedId); + console.log('Deleted IDs:', selectedId); fetchLetterList(); } }; @@ -69,7 +69,7 @@ const SendedLetter = () => { const fetchLetterList = async () => { try { const response = await getSentLetter(); - setSenderArray(response.data.content); + setSenderArray(response.data.content.reverse()); } catch (error) { console.log(error); } @@ -78,22 +78,22 @@ const SendedLetter = () => { const fetchDeleteLetter = async (letterIds: string[]) => { if (letterIds.length === 1) { try { - const response = await deleteSentLetter(letterIds[0]); + await deleteSentLetter(letterIds[0]); showToast(`1개의 편지가 삭제되었어요`, { icon: false, close: true, - bottom: "50px", + bottom: '50px' }); } catch (error) { console.log(error); } } else if (letterIds.length > 1) { try { - const response = await deleteSentLetters(letterIds); + await deleteSentLetters(letterIds); showToast(`${letterIds.length}개의 편지가 삭제되었어요`, { icon: false, close: true, - bottom: "50px", + bottom: '50px' }); } catch (error) { console.log(error); @@ -105,7 +105,7 @@ const SendedLetter = () => { {isPopup && ( {
{!isSelecting ? ( <> - {" "} + {' '} setIsSelecting(!isSelecting)}> 삭제 @@ -191,10 +191,10 @@ const Container = styled.div<{ max-height: 100%; justify-content: space-between; /* ${({ $isSelecting }) => - $isSelecting ? "justify-content: space-between" : ""}; */ + $isSelecting ? 'justify-content: space-between' : ''}; */ color: white; background: ${(props) => props.theme.colors.bg}; - background-image: url("/assets/mypage/img_background.png"); + background-image: url('/assets/mypage/img_background.png'); background-size: cover; background-position: center; background-repeat: no-repeat; diff --git a/src/app/planet/manage/page.tsx b/src/app/planet/manage/page.tsx index 3d24ab6e..44593af0 100644 --- a/src/app/planet/manage/page.tsx +++ b/src/app/planet/manage/page.tsx @@ -11,6 +11,7 @@ import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'; import { deleteSpaces, getSpaceList, + putMainSpace, putSpacesOrder } from '@/api/planet/space/space'; import { useToast } from '@/hooks/useToast'; @@ -104,13 +105,19 @@ const PlanetManagePage = () => { }; /* 홈(메인) 행성 고정 */ - const handleFixMainPlanet = () => { + const handleFixMainPlanet = async () => { const selectedPlanet = planets?.filter((planet) => selectedId.includes(planet.spaceId) ); - - /* TODO: 선택 행성 (selectedId) 메인 행성으로 변경 API 연동 */ - + await putMainSpace(selectedId); + setPlanets( + planets.map((planet) => + planet.spaceId === selectedId + ? { ...planet, isMainSpace: true } + : { ...planet, isMainSpace: false } + ) + ); + setViewSpaceId(null); setIsBottomUp(false); showToast(`${selectedPlanet[0]?.spaceName} 행성을 홈으로 고정했어요`, { icon: false, diff --git a/src/app/signup/complete/page.tsx b/src/app/signup/complete/page.tsx index 34697cf6..db62f2ee 100644 --- a/src/app/signup/complete/page.tsx +++ b/src/app/signup/complete/page.tsx @@ -1,22 +1,22 @@ -"use client"; +'use client'; -import Button from "@/components/common/Button"; -import Loader, { LoaderContainer } from "@/components/common/Loader"; -import NavigatorBar from "@/components/common/NavigatorBar"; -import { useRouter, useSearchParams } from "next/navigation"; -import { Suspense } from "react"; -import styled from "styled-components"; +import Button from '@/components/common/Button'; +import Loader, { LoaderContainer } from '@/components/common/Loader'; +import NavigatorBar from '@/components/common/NavigatorBar'; +import { useRouter, useSearchParams } from 'next/navigation'; +import { Suspense } from 'react'; +import styled from 'styled-components'; const Signup = () => { const router = useRouter(); const searchParams = useSearchParams(); - const url = searchParams.get("url"); + const url = searchParams.get('url'); const handleButtonClick = () => { if (url) { router.push(`/verify/letter?url=${url}`); } else { - router.push("/onboarding"); + router.push('/onboarding'); } }; return ( @@ -29,7 +29,7 @@ const Signup = () => {
레터링에 오신 걸 환영해요 - 편지에 담긴 진심으로 나만의 우주를 채워보세요! + 편지에 담긴 진심으로 나의 스페이스를 채워보세요!
@@ -39,7 +39,7 @@ const Signup = () => { @@ -72,7 +72,7 @@ const Container = styled.div` flex-direction: column; //overflow: scroll; justify-content: space-between; - background-image: url("/assets/signup/signup_bg.png"); + background-image: url('/assets/signup/signup_bg.png'); background-size: cover; background-position: center; background-repeat: no-repeat; diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx index 98badbeb..ccb404fc 100644 --- a/src/app/signup/page.tsx +++ b/src/app/signup/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import { theme } from '@/styles/theme'; import styled from 'styled-components'; export default function Signup() { @@ -10,6 +11,6 @@ const Container = styled.div` display: flex; min-height: 100%; padding: 20px; - color: white; - background: #060812; + color: ${theme.colors.white}; + background: ${theme.colors.bg}; `; diff --git a/src/app/signup/step1/page.tsx b/src/app/signup/step1/page.tsx index 0810d65f..7dc10c01 100644 --- a/src/app/signup/step1/page.tsx +++ b/src/app/signup/step1/page.tsx @@ -1,22 +1,22 @@ -"use client"; +'use client'; -import Button from "@/components/common/Button"; -import Check from "@/components/common/Check"; -import { Suspense, useState } from "react"; -import styled from "styled-components"; -import { useRouter, useSearchParams } from "next/navigation"; -import NavigatorBar from "@/components/common/NavigatorBar"; -import { userInfo } from "@/recoil/signupStore"; -import { useRecoilState } from "recoil"; -import { links } from "@/styles/theme"; -import Loader, { LoaderContainer } from "@/components/common/Loader"; -import { useToast } from "@/hooks/useToast"; +import Button from '@/components/common/Button'; +import Check from '@/components/common/Check'; +import { Suspense, useState } from 'react'; +import styled from 'styled-components'; +import { useRouter, useSearchParams } from 'next/navigation'; +import NavigatorBar from '@/components/common/NavigatorBar'; +import { userInfo } from '@/recoil/signupStore'; +import { useRecoilState } from 'recoil'; +import { links } from '@/styles/theme'; +import Loader, { LoaderContainer } from '@/components/common/Loader'; +import { useToast } from '@/hooks/useToast'; const SignupStep1 = () => { const router = useRouter(); const { showToast } = useToast(); const searchParams = useSearchParams(); - const url = searchParams.get("url"); + const url = searchParams.get('url'); const [user, setUser] = useRecoilState(userInfo); const [isAllChecked, setIsAllChecked] = useState(false); const [isSerivceChecked, setIsServiceChecked] = useState(false); @@ -28,34 +28,34 @@ const SignupStep1 = () => { if (url) { router.push(`/signup/step2?url=${url}`); } else { - router.push("/signup/step2"); + router.push('/signup/step2'); } setUser({ ...user, marketingPermission: isMarketingChecked, servicePermission: isSerivceChecked, - privatePermission: isPersonalChecked, + privatePermission: isPersonalChecked }); } else { - showToast("필수 항목에 동의해주세요!", { + showToast('필수 항목에 동의해주세요!', { icon: true, close: false, - bottom: "120px", + bottom: '120px' }); } }; const handleCheckChange = (type: string) => { switch (type) { - case "all": + case 'all': const newAllChecked = !isAllChecked; setIsAllChecked(newAllChecked); setIsServiceChecked(newAllChecked); setIsPersonalChecked(newAllChecked); setIsMarketingChecked(newAllChecked); break; - case "service": + case 'service': const newServiceChecked = !isSerivceChecked; setIsServiceChecked(newServiceChecked); updateAllChecked( @@ -64,7 +64,7 @@ const SignupStep1 = () => { isMarketingChecked ); break; - case "personal": + case 'personal': const newPersonalChecked = !isPersonalChecked; setIsPersonalChecked(newPersonalChecked); updateAllChecked( @@ -73,7 +73,7 @@ const SignupStep1 = () => { isMarketingChecked ); break; - case "marketing": + case 'marketing': const newMarketingChecked = !isMarketingChecked; setIsMarketingChecked(newMarketingChecked); updateAllChecked( @@ -113,7 +113,7 @@ const SignupStep1 = () => { handleCheckChange("all")} + onChange={() => handleCheckChange('all')} label="약관 전체 동의" sublabel="(선택사항 포함)" /> @@ -122,7 +122,7 @@ const SignupStep1 = () => { handleCheckChange("service")} + onChange={() => handleCheckChange('service')} label="서비스 이용 약관" sublabel="(필수)" /> @@ -137,7 +137,7 @@ const SignupStep1 = () => { handleCheckChange("personal")} + onChange={() => handleCheckChange('personal')} label="개인정보 수집 및 이용 동의" sublabel="(필수)" /> @@ -152,7 +152,7 @@ const SignupStep1 = () => { handleCheckChange("marketing")} + onChange={() => handleCheckChange('marketing')} label="마케팅 수신 동의" sublabel="(선택)" /> @@ -169,6 +169,7 @@ const SignupStep1 = () => {
diff --git a/src/app/signup/step2/page.tsx b/src/app/signup/step2/page.tsx index ca1a9f0d..0f5c1c90 100644 --- a/src/app/signup/step2/page.tsx +++ b/src/app/signup/step2/page.tsx @@ -103,6 +103,7 @@ const SignupStep2 = () => { isOpen={isBottomUp} handleOpen={handleBottomUpChange} onConfirm={handleLoginClick} + confirmText="네, 맞아요" /> )} @@ -111,10 +112,10 @@ const SignupStep2 = () => { 회원가입을 하기 전
- 먼저 본인 인증이 필요해요 + 먼저 실명 입력이 필요해요
- 별명이 아닌 정확한 실명을 입력해주세요 + 반드시 ‘성+이름’의 실명으로 작성해주세요 @@ -122,7 +123,7 @@ const SignupStep2 = () => { inputType="signup" value={name} onChange={setName} - placeholder="ex)홍길동" + placeholder="ex) 홍길동" isValid={isVaild} isValidChange={setIsVaild} errorMessage="단독 자음, 모음만 쓸 수 없어요 (ex) ㄱ, ㅏ)" @@ -136,6 +137,7 @@ const SignupStep2 = () => { diff --git a/src/components/planet/PlanetList.tsx b/src/components/planet/PlanetList.tsx index ffc70cf4..105dad67 100644 --- a/src/components/planet/PlanetList.tsx +++ b/src/components/planet/PlanetList.tsx @@ -83,8 +83,8 @@ export default PlanetList; const Box = styled.div` width: 100%; + height: 68px; display: flex; - padding: 14px 12px 14px 16px; flex-direction: column; align-items: flex-start; gap: 10px; @@ -140,8 +140,8 @@ const MainLabel = styled.div` `; const IconButton = styled.button` - width: 24px; - height: 24px; + width: 30px; + height: 40px; display: flex; align-items: center; justify-content: center;