diff --git a/api/login/sendCodeToServer.ts b/api/login/sendCodeToServer.ts index c001eca1..eeae44c4 100644 --- a/api/login/sendCodeToServer.ts +++ b/api/login/sendCodeToServer.ts @@ -1,8 +1,8 @@ import { client } from '@/api/common/axios'; import PATH from '../../constant/path'; -export const sendCodeToServer = async (authCode: string) => { - const url = `${PATH.API}/${PATH.V1}/${PATH.AUTH}/${PATH.KAKAO}/${PATH.CALLBACK}`; +export const sendCodeToServer = async (code: string) => { + const url = `${PATH.API}/${PATH.V1}/${PATH.AUTH}/${PATH.KAKAO}/${PATH.CALLBACK}?${PATH.REDIRECT_URI}=${process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI}`; const data = await client.post( url, @@ -10,9 +10,7 @@ export const sendCodeToServer = async (authCode: string) => { { headers: { 'Content-Type': 'application/json', - }, - params: { - code: authCode, + code: `${code}`, }, }, ); diff --git a/api/mypage/editWishesInfo.ts b/api/mypage/editWishesInfo.ts deleted file mode 100644 index 3502744a..00000000 --- a/api/mypage/editWishesInfo.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { EditWishesInfoDataType } from '@/types/mypage/editWishesInfoDataType'; -import { client } from '../common/axios'; -import PATH from '../../constant/path'; - -export const editWishesInfo = async (editWishesInfoData: EditWishesInfoDataType) => { - const accessToken = localStorage.getItem('accessToken'); - - const data = await client.put( - `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PROGRESS}`, - editWishesInfoData, - { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, - }, - }, - ); - - return data.data.data; -}; diff --git a/api/mypage/getEditWishesInfo.ts b/api/mypage/getEditWishesInfo.ts deleted file mode 100644 index 0e5657c0..00000000 --- a/api/mypage/getEditWishesInfo.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { client } from '../common/axios'; -import PATH from '../../constant/path'; - -export const getEditWishesInfo = async () => { - const accessToken = localStorage.getItem('accessToken'); - - const data = await client.get(`${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PROGRESS}`, { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, - }, - }); - - return data.data.data; -}; diff --git a/api/mypage/mypageAPI.ts b/api/mypage/mypageAPI.ts new file mode 100644 index 00000000..cdb51253 --- /dev/null +++ b/api/mypage/mypageAPI.ts @@ -0,0 +1,46 @@ +import { client } from '../common/axios'; +import PATH from '../../constant/path'; +import { EditWishesInfoDataType } from '@/types/mypage/editWishesInfoDataType'; + +export const getEditWishesInfo = async () => { + const accessToken = localStorage.getItem('accessToken'); + + const data = await client.get(`${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PROGRESS}`, { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, + }); + + return data.data.data; +}; + +export const editWishesInfo = async (editWishesInfoData: EditWishesInfoDataType) => { + const accessToken = localStorage.getItem('accessToken'); + + const data = await client.put( + `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PROGRESS}`, + { editWishesInfoData }, + { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, + }, + ); + + return data.data.data; +}; + +export const deleteUserInfo = async () => { + const accessToken = localStorage.getItem('accessToken'); + + const data = await client.delete(`${PATH.API}/${PATH.V1}/${PATH.USER}`, { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, + }); + + return data; +}; diff --git a/api/wishes/wishesAPI.ts b/api/wishes/wishesAPI.ts index c188a133..69397bca 100644 --- a/api/wishes/wishesAPI.ts +++ b/api/wishes/wishesAPI.ts @@ -2,8 +2,8 @@ import { AccountInfoType } from '@/types/wishes/accountInfotype'; import PATH from '../../constant/path'; import { client } from '../common/axios'; import { WishesDataType } from '@/types/wishes/wishesDataType'; -import { PARSING_TAG_KEY } from '@/constant/parsingTagKey'; import axios from 'axios'; +import { SiteDataType } from '@/types/siteDataType'; export const createWishesLink = async (wishesData: WishesDataType) => { const accessToken = localStorage.getItem('accessToken'); @@ -53,28 +53,32 @@ export const editUserAccount = async (accountInfo: AccountInfoType, phone: strin return data; }; -export const getItemInfo = async (link: string) => { +export const getItemInfo = async (link: string, siteData: SiteDataType | undefined) => { const accessToken = localStorage.getItem('accessToken'); - const imageTag = await client.get( - `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PRESENT}/${PATH.INFO}?url=${link}&tag=${PARSING_TAG_KEY['29cm'].imageTag}`, - { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, + const imageTag = + siteData && + (await client.get( + `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PRESENT}/${PATH.INFO}?url=${link}&tag=${siteData.IMAGE_TAG}`, + { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, }, - }, - ); + )); - const priceTag = await client.get( - `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PRESENT}/${PATH.INFO}?url=${link}&tag=${PARSING_TAG_KEY['29cm'].priceTag}`, - { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, + const priceTag = + siteData && + (await client.get( + `${PATH.API}/${PATH.V1}/${PATH.WISHES}/${PATH.PRESENT}/${PATH.INFO}?url=${link}&tag=${siteData.PRICE_TAG}`, + { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, }, - }, - ); + )); return { imageTag, priceTag }; }; @@ -107,13 +111,11 @@ export const getPresignedURL = async (fileName: string | undefined) => { }; export const uploadPresignedURL = async (signedURL: string, file: File | Blob | null) => { - console.log(decodeURIComponent(signedURL)); const data = await axios.put(signedURL, file, { headers: { 'Content-Type': file?.type, }, }); - console.log(data); return data; }; diff --git a/components/cakes/SelectCakes.tsx b/components/cakes/SelectCakes.tsx index da1457b3..7b6d57eb 100644 --- a/components/cakes/SelectCakes.tsx +++ b/components/cakes/SelectCakes.tsx @@ -38,7 +38,7 @@ export default function SelectCakes(props: SelectCakesProps) { - {selectedCake.name} {convertMoneyText(selectedCake.price)}원 + {selectedCake.name} {convertMoneyText(String(selectedCake.price))}원 ); diff --git a/components/cakes/cakesHeader.tsx b/components/cakes/cakesHeader.tsx index 1c555300..4130e11a 100644 --- a/components/cakes/cakesHeader.tsx +++ b/components/cakes/cakesHeader.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import BackBtn from '../common/backBtn'; +import BackBtn from '../common/button/backBtn'; import InputHeader from '../common/inputHeader'; import theme from '@/styles/theme'; diff --git a/components/common/alertTextBox.tsx b/components/common/alertTextBox.tsx index 1db92303..bf223337 100644 --- a/components/common/alertTextBox.tsx +++ b/components/common/alertTextBox.tsx @@ -26,7 +26,7 @@ const Styled = { margin-top: 1rem; `, Text: styled.div` - margin: 0 0.6rem 0; + margin-left: 0.6rem; ${theme.fonts.body12}; color: ${theme.colors.warning_red}; `, diff --git a/components/common/backBtn.tsx b/components/common/button/backBtn.tsx similarity index 100% rename from components/common/backBtn.tsx rename to components/common/button/backBtn.tsx diff --git a/components/common/footer.tsx b/components/common/footer.tsx new file mode 100644 index 00000000..63526e9a --- /dev/null +++ b/components/common/footer.tsx @@ -0,0 +1,82 @@ +import { LogoImg } from '@/public/assets/images'; +import theme from '@/styles/theme'; +import styled from 'styled-components'; +import Image from 'next/image'; + +export default function Footer() { + const handleTermsOfUse = () => { + window.open('https://sunmulzu.notion.site/d20153cbfb7848f8a2599f263217dcc2'); + }; + + const handlePrivacyPolicy = () => { + window.open('https://sunmulzu.notion.site/dd520cd904db4b439c85e91af022bd02?pvs=4'); + }; + + const handleMarketingAgreement = () => { + window.open('https://sunmulzu.notion.site/3e4a34be04f54f159d7e44c0e92c6e05?pvs=4'); + }; + + return ( + + {'조물주보다 + + + 상호명: 조물주보다생일선물주 +
+ 사업자등록번호: 246-05-02593 +
+ 통신판매업신고: 2023-경기양주-1379 +
+ 사업장주소지: 경기도 양주시 고덕로 159, 207-403 +
+ 대표자명: 이승원 +
+ + + + 이용약관 + 개인정보처리방침 + 광고마케팅정보수신동의 + +
+ ); +} + +const Styled = { + Container: styled.footer` + width: 37.5rem; + background-color: ${theme.colors.main_blue}; + padding: 2.9rem 2.2rem; + margin: 8.12rem 0 0 0; + `, + + HorizontalLine: styled.div` + display: block; + width: 100%; + height: 0.1rem; + margin: 1rem 0; + background: #ffffff; + opacity: 0.6; + `, + + ContentContainer: styled.div` + ${theme.fonts.body12}; + line-height: 2.2rem; + color: ${theme.colors.white}; + opacity: 0.6; + margin: 1.5rem 0 0 0; + `, + + ButtonContainer: styled.div` + display: flex; + gap: 0.5rem; + `, + + Button: styled.button` + ${theme.fonts.body12}; + line-height: 2.2rem; + color: ${theme.colors.white}; + opacity: 0.8; + padding: 0; + `, +}; diff --git a/components/common/layout.tsx b/components/common/layout.tsx index abbefe11..57189b35 100644 --- a/components/common/layout.tsx +++ b/components/common/layout.tsx @@ -1,22 +1,36 @@ +import theme from '@/styles/theme'; import styled from 'styled-components'; +import Footer from './footer'; interface LayoutProps { + footer?: boolean; children: React.ReactNode; } function Layout(props: LayoutProps) { - const { children } = props; + const { footer, children } = props; - return {children}; + return ( + + {children} + {footer &&