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 && }
+
+ );
}
export default Layout;
-const Root = styled.div`
- width: 100%;
- /* &.minHeight {
- min-height: 136.7rem;
- } */
- display: flex;
- flex-direction: column;
-`;
+const Styled = {
+ Root: styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ width: 100%;
+ `,
+
+ Container: styled.div`
+ width: 37.5rem;
+ padding: 2.2rem;
+ `,
+};
diff --git a/components/common/loading.tsx b/components/common/loading.tsx
new file mode 100644
index 00000000..55d020d7
--- /dev/null
+++ b/components/common/loading.tsx
@@ -0,0 +1,30 @@
+import theme from '@/styles/theme';
+import ClipLoader from 'react-spinners/ClipLoader';
+import styled from 'styled-components';
+
+export default function Loading() {
+
+ return (
+
+
+ 로딩중입니다
+
+ );
+}
+
+const Styled = {
+ Container: styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 100vh;
+ `,
+
+ Title: styled.h1`
+ ${theme.fonts.headline24_100};
+ color: ${theme.colors.main_blue};
+ margin: 2.4rem 0 3rem;
+ `,
+};
+
diff --git a/components/common/mainView.tsx b/components/common/mainView.tsx
index 1fc78fba..f29b252d 100644
--- a/components/common/mainView.tsx
+++ b/components/common/mainView.tsx
@@ -4,7 +4,7 @@ import theme from '@/styles/theme';
import { KakaoLoginIc, WideArrowDownIc } from '@/public/assets/icons';
import { MainLoginImg } from '@/public/assets/images';
import GuideModal from '@/components/common/modal/GuideModal';
-import Modal from '@/components/common/modal';
+import Modal from '@/components/common/modal/modal';
import useModal from '@/hooks/common/useModal';
interface MainViewProps {
@@ -25,7 +25,7 @@ export default function MainView(props: MainViewProps) {
- 조물주보다,
+ 조물주보다
생일선물주
diff --git a/components/common/modal/BankInput.tsx b/components/common/modal/BankInput.tsx
index 5ad34464..5a92c5c1 100644
--- a/components/common/modal/BankInput.tsx
+++ b/components/common/modal/BankInput.tsx
@@ -1,6 +1,6 @@
import useModal from '@/hooks/common/useModal';
import InputBox from '../input/inputBox';
-import Modal from '../modal';
+import Modal from './modal';
import BankModal from './BankModal';
import styled from 'styled-components';
import { validation } from '@/validation/input';
diff --git a/components/common/modal/DeleteModal.tsx b/components/common/modal/DeleteModal.tsx
index bf9cda18..d0a83bc4 100644
--- a/components/common/modal/DeleteModal.tsx
+++ b/components/common/modal/DeleteModal.tsx
@@ -4,7 +4,7 @@ import Image from 'next/image';
import theme from '@/styles/theme';
import { CloseSmallIc } from '@/public/assets/icons';
import IconButton from '@/components/common/button/iconButton';
-import { DeleteModalCake } from '@/public/assets/images';
+import { MainCakeImg } from '@/public/assets/images';
import ButtonBox from '@/components/common/button/buttonBox';
interface DeleteModalProps {
@@ -28,7 +28,7 @@ export default function DeleteModal(props: DeleteModalProps) {
-
+
총 {linksCount}개의 소원링크를 삭제합니다.
diff --git a/components/common/modal/ShareModal.tsx b/components/common/modal/ShareModal.tsx
index 1320bd4a..be30e4bf 100644
--- a/components/common/modal/ShareModal.tsx
+++ b/components/common/modal/ShareModal.tsx
@@ -27,17 +27,41 @@ export default function ShareModal(props: ShareModalProps) {
}, []);
const handlShareSNS = (name: string) => {
+ const link = encodeURIComponent(wishesLink);
+ const text = encodeURIComponent(
+ `${loginUserInfo.nickName}님의 생일선물을 고민하고 있다면?\n고민할 필요없이 이 귀여운 케이크를 선물해 ${loginUserInfo.nickName}님의 생일 펀딩에 참여해보세요! \n`,
+ );
+ const hashtag = encodeURIComponent(`#조물주보다생일선물주`);
+
if (name === 'KakaoTalk') {
useKakaoShare(loginUserInfo.nickName, wishesLink);
+ } else if (name === 'FaceBook') {
+ if (name === 'FaceBook') {
+ window.open(`http://www.facebook.com/sharer/sharer.php?u=${link}&hashtag=${hashtag}`);
+ }
+ } else if (name === 'Twitter') {
+ window.open(`https://twitter.com/intent/tweet?text=${text + link}`);
}
};
const handleTextCopy = async (text: string) => {
+ const isClipboardSupported = () => navigator?.clipboard != null;
+
try {
- await navigator.clipboard.writeText(text);
- alert('클립보드에 링크가 복사되었습니다.');
+ if (isClipboardSupported()) {
+ await navigator.clipboard.writeText(text);
+ } else {
+ const textArea = document.createElement('textarea');
+ textArea.value = text;
+ document.body.appendChild(textArea);
+ textArea.select();
+
+ document.execCommand('copy');
+ document.body.removeChild(textArea);
+ }
+ alert('링크가 복사되었습니다.');
} catch (error) {
- alert('복사에 실패하였습니다');
+ alert('공유하기가 지원되지 않는 환경입니다.');
}
};
diff --git a/components/common/modal/termsModal.tsx b/components/common/modal/TermsModal.tsx
similarity index 100%
rename from components/common/modal/termsModal.tsx
rename to components/common/modal/TermsModal.tsx
diff --git a/components/common/modal.tsx b/components/common/modal/modal.tsx
similarity index 100%
rename from components/common/modal.tsx
rename to components/common/modal/modal.tsx
diff --git a/components/common/progressBar.tsx b/components/common/progressBar.tsx
index ca830bfe..354a869e 100644
--- a/components/common/progressBar.tsx
+++ b/components/common/progressBar.tsx
@@ -8,6 +8,7 @@ interface ProgressBarProps {
export default function ProgressBar(props: ProgressBarProps) {
const { percent, vertical } = props;
+
return (
<>
@@ -19,8 +20,8 @@ export default function ProgressBar(props: ProgressBarProps) {
const Styled = {
Container: styled.div<{ vertical: boolean }>`
- width: 1rem;
- height: 27rem;
+ width: 27rem;
+ height: 1rem;
background-color: ${theme.colors.pastel_blue};
diff --git a/components/common/verticalProgressBar.tsx b/components/common/verticalProgressBar.tsx
new file mode 100644
index 00000000..53175f9b
--- /dev/null
+++ b/components/common/verticalProgressBar.tsx
@@ -0,0 +1,79 @@
+import theme from '@/styles/theme';
+import styled, { css } from 'styled-components';
+
+interface ProgressBarProps {
+ percent: number | undefined;
+}
+
+export default function VerticalProgressBar(props: ProgressBarProps) {
+ const { percent } = props;
+
+ return (
+ <>
+
+ {percent}%
+
+
+
+
+
+
+ >
+ );
+}
+
+const Styled = {
+
+ ProgressBox: styled.div`
+ height: 27rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: right;
+ `,
+
+ PercentWrapper: styled.div<{ percent: number }>`
+ height: ${(props) => props.percent}%;
+
+ ${(props) =>
+ props.percent > 3 &&
+ css`
+ margin-top: -2rem;
+ `}
+ `,
+
+ Percent: styled.div`
+ ${theme.fonts.button16};
+ color: ${theme.colors.main_blue};
+ margin-top: auto;
+ margin-right: 0.5rem;
+ `,
+
+ BarContainer: styled.div`
+ width: 1rem;
+ height: 27rem;
+
+ background-color: ${theme.colors.pastel_blue};
+
+ border-bottom-right-radius: 5rem;
+ border-bottom-left-radius: 5rem;
+ border-top-right-radius: 5rem;
+ border-top-left-radius: 5rem;
+
+ -ms-transform: rotate(180deg); /* IE 9 */
+ -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
+ transform: rotate(180deg);
+ `,
+
+ Progress: styled.div<{ percent: number }>`
+ height: ${(props) => props.percent}%;
+ max-height: 100%;
+ width: 100%;
+
+ background-color: ${theme.colors.main_blue};
+
+ border-bottom-right-radius: 5rem;
+ border-bottom-left-radius: 5rem;
+ border-top-right-radius: 5rem;
+ border-top-left-radius: 5rem;
+ `,
+};
diff --git a/components/login/index.tsx b/components/login/index.tsx
index 48dcbe19..7b447146 100644
--- a/components/login/index.tsx
+++ b/components/login/index.tsx
@@ -5,6 +5,7 @@ import { KakaoLoginIc } from '@/public/assets/icons';
import BasicBox from '../common/box/BasicBox';
import Button from '../common/button/button';
import MainView from '../common/mainView';
+import Footer from '../common/footer';
export default function LoginContainer() {
const KAKAO_AUTH_URL = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${process.env.NEXT_PUBLIC_KAKAO_RESTAPI_KEY}&redirect_uri=${process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI}`;
@@ -14,12 +15,15 @@ export default function LoginContainer() {
return (
-
-
-
+
+
+
+
+
+
);
}
@@ -31,6 +35,11 @@ const Styled = {
align-items: center;
`,
+ ButtonWrapper: styled.div`
+ position: fixed;
+ top: 60rem;
+`,
+
KakaoLoginIcon: styled((props) => (
))`
diff --git a/components/login/redirect.tsx b/components/login/redirect.tsx
index d8c9e530..cdda5b27 100644
--- a/components/login/redirect.tsx
+++ b/components/login/redirect.tsx
@@ -1,6 +1,7 @@
import { useRouter } from 'next/router';
import useAuthKakao from '@/hooks/queries/login/useAuthKakao';
import { useEffect } from 'react';
+import Loading from '../common/loading';
export default function Redirect() {
const router = useRouter();
@@ -14,8 +15,6 @@ export default function Redirect() {
}, [accessToken, refreshToken, nickName]);
return (
- <>
- 카카오 로그인 중 입니다...
- >
+
);
-}
+}
\ No newline at end of file
diff --git a/components/main/button.tsx b/components/main/button.tsx
index 472d83f3..eac09f13 100644
--- a/components/main/button.tsx
+++ b/components/main/button.tsx
@@ -3,7 +3,7 @@ import theme from '@/styles/theme';
import ButtonBox from '@/components/common/button/buttonBox';
import ShareModal from '../common/modal/ShareModal';
import useModal from '@/hooks/common/useModal';
-import Modal from '../common/modal';
+import Modal from '../common/modal/modal';
interface ButtonProps {
wishStatus: string;
diff --git a/components/main/cake.tsx b/components/main/cake.tsx
index 1fd98ca6..910496b1 100644
--- a/components/main/cake.tsx
+++ b/components/main/cake.tsx
@@ -7,11 +7,12 @@ import {
MainEndCakeImg,
MainEndChatImg,
MainWishChatImg,
- PillCakeImg,
+ MainCakeImg,
} from '@/public/assets/images';
-import ProgressBar from '../common/progressBar';
import { LoginUserInfo } from '@/recoil/auth/loginUserInfo';
import { useRecoilValue } from 'recoil';
+import { convertMoneyText } from '@/utils/common/convertMoneyText';
+import VerticalProgressBar from '../common/verticalProgressBar';
interface CakeProps {
wishStatus: string;
@@ -31,13 +32,13 @@ export default function Cake(props: CakeProps) {
return wishStatus === 'before' || wishStatus === 'while'
? MainWishChatImg
: wishStatus === 'end'
- ? MainEndChatImg
- : MainChatImg;
+ ? MainEndChatImg
+ : MainChatImg;
};
const priceData = wishStatus === 'while' || wishStatus === 'end' ? price : '???';
- const CakeImg = () => (wishStatus === 'end' ? MainEndCakeImg : PillCakeImg);
+ const CakeImg = () => (wishStatus === 'end' ? MainEndCakeImg : MainCakeImg);
return (
@@ -45,7 +46,7 @@ export default function Cake(props: CakeProps) {
-
+
{wishStatus === 'while' || wishStatus === 'end' ? (
@@ -56,17 +57,14 @@ export default function Cake(props: CakeProps) {
모인 케이크 금액
)}
- 총 {priceData}원
+ {typeof priceData === 'number' ? (
+ 총 {convertMoneyText(String(priceData))}원
+ ) : (
+ 총 {priceData}원
+ )}
-
- {percent}%
-
-
-
-
-
-
+
{(wishStatus === 'while' || wishStatus === 'end') && (
@@ -127,58 +125,4 @@ const Styled = {
flex-direction: column;
justify-content: center;
`,
-
- ProgressBox: styled.div`
- height: 27rem;
- display: flex;
- flex-direction: column;
- justify-content: right;
- `,
-
- PercentWrapper: styled.div<{ percent: number }>`
- height: ${(props) => props.percent}%;
-
- ${(props) =>
- props.percent > 3 &&
- css`
- margin-top: -2rem;
- `}
- `,
-
- Percent: styled.div`
- ${theme.fonts.button16};
- color: ${theme.colors.main_blue};
- margin-top: auto;
- margin-right: 0.5rem;
- `,
-
- // Progressbar
- BarContainer: styled.div`
- width: 1rem;
- height: 27rem;
-
- background-color: ${theme.colors.pastel_blue};
-
- border-bottom-right-radius: 5rem;
- border-bottom-left-radius: 5rem;
- border-top-right-radius: 5rem;
- border-top-left-radius: 5rem;
-
- -ms-transform: rotate(180deg); /* IE 9 */
- -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
- transform: rotate(180deg);
- `,
-
- Progress: styled.div<{ percent: number }>`
- height: ${(props) => props.percent}%;
- max-height: 100%;
- width: 100%;
-
- background-color: ${theme.colors.main_blue};
-
- border-bottom-right-radius: 5rem;
- border-bottom-left-radius: 5rem;
- border-top-right-radius: 5rem;
- border-top-left-radius: 5rem;
- `,
};
diff --git a/components/main/index.tsx b/components/main/index.tsx
index 54b58357..02912b84 100644
--- a/components/main/index.tsx
+++ b/components/main/index.tsx
@@ -3,24 +3,39 @@ import Button from './button';
import Cake from './cake';
import useGetProgressData from '@/hooks/queries/main/useGetProgressData';
import { useEffect, useState } from 'react';
-
+import { useSetRecoilState } from 'recoil';
+import { LoginUserInfo } from '@/recoil/auth/loginUserInfo';
export default function MainContainer() {
- const [status, setStatus] = useState('');
+ const [status, setStatus] = useState('none');
+ const setLoginUserInfo = useSetRecoilState(LoginUserInfo);
const { progressData, wishStatus } = useGetProgressData();
useEffect(() => {
setStatus(wishStatus);
+ progressData &&
+ setLoginUserInfo((prev) => ({
+ ...prev,
+ wishesId: progressData.wishId,
+ }));
}, [progressData, wishStatus]);
return (
<>
-
+
-
+
>
);
-}
\ No newline at end of file
+}
diff --git a/components/mypage/EditWishes/index.tsx b/components/mypage/EditWishes/index.tsx
index e9f2bcd2..375bf892 100644
--- a/components/mypage/EditWishes/index.tsx
+++ b/components/mypage/EditWishes/index.tsx
@@ -1,4 +1,4 @@
-import BackBtn from '@/components/common/backBtn';
+import BackBtn from '@/components/common/button/backBtn';
import BasicBox from '@/components/common/box/BasicBox';
import HalfBox from '@/components/common/box/HalfBox';
import LargeBox from '@/components/common/box/LargeBox';
@@ -43,8 +43,8 @@ export default function EditWishesContainer() {
bankName: bankInfo.bankName,
account: bankInfo.account,
phone: phone.phone,
- imageUrl: itemLink.imageURL,
- price: itemLink.price,
+ imageUrl: isLinkLoadType ? itemLink.imageURL : image.preSignedImageURL,
+ price: isLinkLoadType ? itemLink.price : Number(selfInputPrice.selfInputPrice),
title: title.title,
hint: hint.hint,
initial: initial.initial,
@@ -81,8 +81,8 @@ export default function EditWishesContainer() {
<>
- {image.previewImage ? (
-
+ {image.preSignedImageURL ? (
+
) : (
diff --git a/components/mypage/index.tsx b/components/mypage/index.tsx
index b94df81a..c50d2cf7 100644
--- a/components/mypage/index.tsx
+++ b/components/mypage/index.tsx
@@ -1,18 +1,19 @@
import theme from '@/styles/theme';
import styled from 'styled-components';
import InputHeader from '@/components/common/inputHeader';
-import BackBtn from '@/components/common/backBtn';
+import BackBtn from '@/components/common/button/backBtn';
import router from 'next/router';
import Image from 'next/image';
import ItemBox from './itemBox';
import { useRecoilValue } from 'recoil';
import { LoginUserInfo } from '@/recoil/auth/loginUserInfo';
import GuideModal from '@/components/common/modal/GuideModal';
-import Modal from '@/components/common/modal';
+import Modal from '@/components/common/modal/modal';
import useModal from '@/hooks/common/useModal';
-import { CakeProfileImg } from '@/public/assets/images';
+import { MypageCakeImg } from '@/public/assets/images';
import { useEffect, useState } from 'react';
import useInitEditWishesInfo from '@/hooks/mypage/useInitEditWishesInfo';
+import { deleteUserInfo } from '@/api/mypage/mypageAPI';
export default function MyPageContainer() {
const { isOpen, handleToggle } = useModal();
@@ -27,19 +28,15 @@ export default function MyPageContainer() {
const { data } = useInitEditWishesInfo();
const handleEditWish = () => {
- if (data !== null) {
- router.push('/mypage/editWishes');
- }
+ router.push('/mypage/editWishes');
};
const handleWishLinks = () => {
router.push('/mypage/links');
};
const handleCustomerService = () => {
- if (data !== null) {
- window.Kakao.Channel.chat({
- channelPublicId: process.env.NEXT_PUBLIC_KAKAO_CHANNEL_ID,
- });
- }
+ window.Kakao.Channel.chat({
+ channelPublicId: process.env.NEXT_PUBLIC_KAKAO_CHANNEL_ID,
+ });
};
const handleLogOut = () => {
@@ -50,6 +47,12 @@ export default function MyPageContainer() {
// useResetRecoilState(LoginUserInfo);
};
+ const handleWithdrawal = () => {
+ if (window.confirm('탈퇴를 진행하시겠습니까?')) {
+ deleteUserInfo();
+ }
+ };
+
return (
<>
@@ -64,12 +67,14 @@ export default function MyPageContainer() {
-
+
+
+
{nickName} 님
사용설명서 보기
고객센터 문의하기
- 로그아웃
+
+ 로그아웃
+ 회원탈퇴
+
>
);
@@ -115,9 +123,25 @@ const Styled = {
`,
TextContainer: styled.button`
- margin: 3rem 0 0;
${theme.fonts.button16_2};
color: ${theme.colors.main_blue};
text-decoration: underline;
`,
+
+ ProfileImgContainer: styled.div`
+ width: 5rem;
+ height: 5rem;
+ border-radius: 30rem;
+ background-color: ${theme.colors.pastel_blue};
+ display: flex;
+ justify-content: center;
+ padding-top: 0.5rem
+`,
+
+ TextWrapper: styled.div`
+ display: flex;
+ justify-content: space-between;
+
+ margin: 3rem 0 0;
+ `,
};
diff --git a/components/mypage/letters/[id].tsx b/components/mypage/letters/[id].tsx
index d5d4db33..b94aa936 100644
--- a/components/mypage/letters/[id].tsx
+++ b/components/mypage/letters/[id].tsx
@@ -1,12 +1,12 @@
import theme from '@/styles/theme';
import styled from 'styled-components';
import InputHeader from '@/components/common/inputHeader';
-import BackBtn from '@/components/common/backBtn';
+import BackBtn from '@/components/common/button/backBtn';
import CakeListButton from './cakeListButton';
import Image from 'next/image';
import { BorderImg } from '@/public/assets/images';
import { useEffect, useState } from 'react';
-import { ArrowLeftIc, ArrowRightIc } from '@/public/assets/icons';
+import { ArrowLeftIc, ArrowRightIc, BackBtnIc } from '@/public/assets/icons';
import { useRouter } from 'next/router';
import { useGetCakesLetters } from '@/hooks/queries/letters/useGetCakeLetters';
import { CAKE_LIST } from '@/constant/cakeList';
@@ -46,10 +46,20 @@ export default function LettersContainer() {
setClickedBox(movedBox);
};
+ const handleMoveBack = () => {
+ window.history.back();
+ }
+
+
return (
<>
-
+
('');
@@ -34,14 +35,16 @@ export default function LinksContainer() {
{`${convertDateFormat(wishData?.startAt)} ~ ${convertDateFormat(wishData?.endAt)}`}
-
- {/* */}
-
-
-
-
- 모인 케이크 보러가기 {'>'}
- 총 {wishData?.price}원
+
+
+
+
+ 모인 케이크 보러가기 {'>'}
+ 총 {wishData?.price}원
+
+
+
+
>
);
@@ -61,9 +64,18 @@ const Styled = {
CenterContainer: styled.div`
margin: 9rem 0 15.5rem;
-
+ width: 100%;
+ display: flex;
+ justify-content: right;
+ align-items: center;
`,
+ ContentContainer: styled.div`
+display: flex;
+flex-direction: column;
+justify-content: center;
+`,
+
BarContainer: styled.div`
float: right;
margin: 0rem 1.5rem 0 0;
diff --git a/components/mypage/links/index.tsx b/components/mypage/links/index.tsx
index 7270fb90..aec27360 100644
--- a/components/mypage/links/index.tsx
+++ b/components/mypage/links/index.tsx
@@ -1,11 +1,11 @@
import theme from '@/styles/theme';
import styled from 'styled-components';
import InputHeader from '@/components/common/inputHeader';
-import BackBtn from '@/components/common/backBtn';
+import BackBtn from '@/components/common/button/backBtn';
import IconButton from '@/components/common/button/iconButton';
import { DeleteBtnIc } from '@/public/assets/icons';
import useModal from '@/hooks/common/useModal';
-import Modal from '@/components/common/modal';
+import Modal from '@/components/common/modal/modal';
import DeleteModal from '@/components/common/modal/DeleteModal';
import { useState } from 'react';
import { useGetWishLinks } from '@/hooks/queries/links/useGetWishLinks';
@@ -47,7 +47,8 @@ export default function LinksMainContainer() {
<>
- {noWishes ? null : handleToggle()} src={DeleteBtnIc} alt="삭제하기" />}
+ {/* {noWishes ? null : handleToggle()} src={DeleteBtnIc} alt="삭제하기" />} */}
+ handleToggle()} src={DeleteBtnIc} alt="삭제하기" />
{isOpen && (
diff --git a/components/mypage/links/noWishLists.tsx b/components/mypage/links/noWishLists.tsx
index 7e119a72..f58a103d 100644
--- a/components/mypage/links/noWishLists.tsx
+++ b/components/mypage/links/noWishLists.tsx
@@ -1,7 +1,7 @@
import styled from 'styled-components';
import Image from 'next/image';
import theme from '@/styles/theme';
-import { LinksPageChatImg, PillCakeImg } from '@/public/assets/images';
+import { LinksPageChatImg, MainCakeImg } from '@/public/assets/images';
import ButtonBox from '@/components/common/button/buttonBox';
import router from 'next/router';
@@ -17,7 +17,7 @@ export default function NoWishLists() {
-
+
diff --git a/components/wishes/[id].tsx b/components/wishes/[id].tsx
index f9f481a9..d5204a59 100644
--- a/components/wishes/[id].tsx
+++ b/components/wishes/[id].tsx
@@ -31,10 +31,10 @@ export default function WishesContainer() {
return (
-
+
-
+
-
+
diff --git a/components/wishes/wishesForm/Preview.tsx b/components/wishes/wishesForm/Preview.tsx
index a751616a..60821f18 100644
--- a/components/wishes/wishesForm/Preview.tsx
+++ b/components/wishes/wishesForm/Preview.tsx
@@ -7,8 +7,8 @@ import theme from '@/styles/theme';
import BasicBox from '@/components/common/box/BasicBox';
import Button from '@/components/common/button/button';
import { useEffect, useState } from 'react';
-import Modal from '@/components/common/modal';
-import TermsModal from '@/components/common/modal/termsModal';
+import Modal from '@/components/common/modal/modal';
+import TermsModal from '@/components/common/modal/TermsModal';
import useModal from '@/hooks/common/useModal';
import { convertMoneyText } from '@/utils/common/convertMoneyText';
import PresentBox from '@/components/common/box/PresentBox';
@@ -21,7 +21,7 @@ interface PreviewProps {
export default function Preview(props: PreviewProps) {
const { handleNextStep } = props;
- const { wishesData, postWishesData, isSuccess } = useCreateWishesLink();
+ const { wishesData, postWishesData } = useCreateWishesLink();
const { isOpen, handleToggle } = useModal();
const [isAgreed, setIsAgreed] = useState(false);
@@ -63,7 +63,9 @@ export default function Preview(props: PreviewProps) {
/>
- 가격 : {convertMoneyText(wishesData.price)}
+
+ 가격 : {convertMoneyText(String(wishesData.price))}
+
diff --git a/components/wishes/wishesForm/WishesStep1.tsx b/components/wishes/wishesForm/WishesStep1.tsx
index 4c871e25..f36420ad 100644
--- a/components/wishes/wishesForm/WishesStep1.tsx
+++ b/components/wishes/wishesForm/WishesStep1.tsx
@@ -18,6 +18,8 @@ import useUploadItemInfo from '@/hooks/wishes/useUploadItemInfo';
import ItemImageBox from './itemImageBox';
import UploadTypeToggleBtn from '@/components/common/uploadTypeToggleBtn';
import { validation } from '@/validation/input';
+import { convertMoneyText } from '@/utils/common/convertMoneyText';
+import AlertTextBox from '@/components/common/alertTextBox';
interface WishesStep1Props {
handleNextStep: () => void;
@@ -29,7 +31,7 @@ export default function WishesStep1(props: WishesStep1Props) {
const { linkURL, handleChangeLinkURL, imageURL, changeImageURL, price, changePrice } =
useGetItemInfo();
- const { imageFile, previewImage, uploadImageFile } = useUploadItemInfo();
+ const { imageFile, preSignedImageURL, uploadImageFile } = useUploadItemInfo();
const [initial, handleChangeInitial] = useInput('', LIMIT_TEXT[15]);
const [isNextStepAvailable, setIsNextStepAvailable] = useState(false);
const [isLinkLoadType, setIsLinkLoadType] = useState(true); //false : 링크 불러오기 true : 직접 불러오기
@@ -60,7 +62,7 @@ export default function WishesStep1(props: WishesStep1Props) {
} else {
setWishesData((prev) => ({
...prev,
- imageURL: imageURL,
+ imageURL: preSignedImageURL,
price: Number(selfInputPrice),
initial: initial,
}));
@@ -92,10 +94,15 @@ export default function WishesStep1(props: WishesStep1Props) {
<>
- {previewImage ? (
-
+ {preSignedImageURL ? (
+
) : (
-
+
+ ※ 등록 가능한 사진파일
• 파일용량 : 10MB 이하
@@ -108,13 +115,16 @@ export default function WishesStep1(props: WishesStep1Props) {
readOnly
/>
+ {imageFile && !validation.checkImageFileSize(imageFile.size) && (
+ 사진은 10MB 이하로 업로드해주세요!
+ )}
@@ -150,8 +160,7 @@ const Styled = {
justify-content: center;
align-items: center;
- width: 100%;
- height: 100%;
+ margin-top: 1.3rem;
cursor: pointer;
`,
diff --git a/components/wishes/wishesForm/itemLink.tsx b/components/wishes/wishesForm/itemLink.tsx
index 67251895..0c190750 100644
--- a/components/wishes/wishesForm/itemLink.tsx
+++ b/components/wishes/wishesForm/itemLink.tsx
@@ -12,6 +12,7 @@ import { QUERY_KEY } from '@/constant/queryKey';
import { getItemInfo } from '@/api/wishes/wishesAPI';
import { extractImageSrc, extractPrice } from '@/utils/common/extractItem';
import { useQuery } from 'react-query';
+import { getSiteData } from '@/utils/common/getSiteData';
interface ItemLinkProps {
linkURL: string;
@@ -38,25 +39,29 @@ export default function ItemLink(props: ItemLinkProps) {
}
};
- const { refetch, isSuccess } = useQuery(QUERY_KEY.ITEM_DATA, () => getItemInfo(linkURL), {
- onSuccess: (data) => {
- const imageData = extractImageSrc(data?.imageTag.data?.data);
- const priceData = extractPrice(data?.priceTag.data?.data);
-
- if (imageData && priceData) {
- changeImageURL(imageData);
- changePrice(priceData);
- }
+ const { refetch, isSuccess } = useQuery(
+ QUERY_KEY.ITEM_DATA,
+ () => getItemInfo(linkURL, getSiteData(linkURL)),
+ {
+ onSuccess: (data) => {
+ const imageData = extractImageSrc(data?.imageTag?.data?.data);
+ const priceData = extractPrice(data?.priceTag?.data?.data);
+
+ if (imageData && priceData) {
+ changeImageURL(imageData);
+ changePrice(priceData);
+ }
+ },
+ enabled: isCorrectLinkURL && validation.isCorrectSite(linkURL),
},
- enabled: isCorrectLinkURL && validation.isCorrectSite(linkURL),
- });
+ );
return (
- {SITE_LIST.map((site) => (
-
-
-
+ {Object.values(SITE_LIST).map((siteData) => (
+
+
+
))}
@@ -71,7 +76,7 @@ export default function ItemLink(props: ItemLinkProps) {
)}
{imageURL && (
- 가격 : {convertMoneyText(price)}원
+ 가격 : {convertMoneyText(String(price))}원
)}
);
diff --git a/constant/alertMessage.ts b/constant/alertMessage.ts
new file mode 100644
index 00000000..7b74bdf0
--- /dev/null
+++ b/constant/alertMessage.ts
@@ -0,0 +1,3 @@
+export const ALERT_ACCOUNT_HYPEN_MESSAGE = '계좌번호는 (-)없이 입력해주세요';
+export const ALERT_ACCOUNT_LENGTH = '10~14자리의 계좌번호를 입력해주세요';
+export const ALERT_PHONE_FORM = '10~14자리의 계좌번호를 입력해주세요';
diff --git a/constant/imageFileSize.ts b/constant/imageFileSize.ts
new file mode 100644
index 00000000..b250c04b
--- /dev/null
+++ b/constant/imageFileSize.ts
@@ -0,0 +1 @@
+export const IMAGE_FILE_SIZE = 10 * 1024 * 1024;
diff --git a/constant/parsingTagKey.ts b/constant/parsingTagKey.ts
deleted file mode 100644
index dce4fe57..00000000
--- a/constant/parsingTagKey.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { ParsingTagKeyType } from '@/types/wishes/parsingTagKeyType';
-
-export const PARSING_TAG_KEY: ParsingTagKeyType = {
- ['29cm']: {
- imageTag: 'ewptmlp5',
- priceTag: 'ent7twr4',
- },
-};
diff --git a/constant/path.ts b/constant/path.ts
index aad224fd..66309c64 100644
--- a/constant/path.ts
+++ b/constant/path.ts
@@ -19,6 +19,7 @@ const PATH = {
FILE: 'file',
FILE_NAME: 'fileName',
PUBLIC: 'public',
+ REDIRECT_URI: 'redirectUri',
};
export default PATH;
diff --git a/constant/siteList.ts b/constant/siteList.ts
index fbb6d921..2d785d58 100644
--- a/constant/siteList.ts
+++ b/constant/siteList.ts
@@ -1,10 +1,19 @@
-import { TwentynineLogoImg } from '@/public/assets/images';
-import { SiteListType } from '@/types/siteListType';
+import { NaverShoppingLogoImg, TwentynineLogoImg } from '@/public/assets/images';
+import { SiteDataType } from '@/types/siteDataType';
-export const SITE_LIST: SiteListType[] = [
- {
- name: '29cm',
- link: 'https://www.29cm.co.kr/',
- logo: TwentynineLogoImg,
+export const SITE_LIST = {
+ TWENTY_NINE: {
+ NAME: 'naverShopping',
+ LINK: 'https://www.29cm.co.kr/',
+ LOGO: TwentynineLogoImg,
+ IMAGE_TAG: 'ewptmlp5',
+ PRICE_TAG: 'ent7twr4',
},
-];
\ No newline at end of file
+ NAVER_SHOP: {
+ NAME: 'naverShopping',
+ LINK: 'https://shopping.naver.com/',
+ LOGO: NaverShoppingLogoImg,
+ IMAGE_TAG: 'image_thumb__IB9B3', // 맞는지 잘 모름...
+ PRICE_TAG: 'lowestPrice_num__A5gM9', // 맞는지 잘 모름...
+ },
+};
diff --git a/constant/snsList.ts b/constant/snsList.ts
index f3ed1c73..c34e8162 100644
--- a/constant/snsList.ts
+++ b/constant/snsList.ts
@@ -12,12 +12,12 @@ export const SNS_LIST: SNSListType[] = [
// name: 'Instagram',
// logo: InstaLogoImg,
// },
- // {
- // name: 'FaceBook',
- // logo: FacebookLogoImg,
- // },
- // {
- // name: 'Twitter',
- // logo: TwitterLogoImg,
- // },
+ {
+ name: 'FaceBook',
+ logo: FacebookLogoImg,
+ },
+ {
+ name: 'Twitter',
+ logo: TwitterLogoImg,
+ },
];
\ No newline at end of file
diff --git a/hooks/mypage/useInitEditWishesInfo.tsx b/hooks/mypage/useInitEditWishesInfo.tsx
index 904c0dc4..f40ecb34 100644
--- a/hooks/mypage/useInitEditWishesInfo.tsx
+++ b/hooks/mypage/useInitEditWishesInfo.tsx
@@ -1,4 +1,4 @@
-import { getEditWishesInfo } from '@/api/mypage/getEditWishesInfo';
+import { getEditWishesInfo } from '@/api/mypage/mypageAPI';
import { QUERY_KEY } from '@/constant/queryKey';
import { useQuery } from 'react-query';
import { useEffect, useState } from 'react';
@@ -37,7 +37,7 @@ export default function useInitEditWishesInfo() {
changePrice,
} = useGetItemInfo();
- const { imageFile, previewImage, setPreviewImage, uploadImageFile } = useUploadItemInfo();
+ const { preSignedImageURL, setPreSignedImageURL, uploadImageFile } = useUploadItemInfo();
const [isLinkLoadType, setIsLinkLoadType] = useState(true); //false : 링크 불러오기 true : 직접 불러오기
const [selfInputPrice, handleChangeSelfInputPrice, setSelfInputPrice] = useInput(
'',
@@ -54,7 +54,7 @@ export default function useInitEditWishesInfo() {
setHint(data?.hint);
setInitial(data?.initial);
changeLinkURL(data?.imageUrl);
- setPreviewImage(data?.imageUrl);
+ setPreSignedImageURL(data?.imageUrl);
setSelfInputPrice(data?.price);
changeImageURL(data?.imageUrl);
changePrice(data?.price);
@@ -120,7 +120,7 @@ export default function useInitEditWishesInfo() {
changePrice,
},
image: {
- previewImage,
+ preSignedImageURL,
uploadImageFile,
},
@@ -139,6 +139,6 @@ export default function useInitEditWishesInfo() {
isGetEditWishesInfoSuccess,
- data
+ data,
};
}
diff --git a/hooks/queries/letters/useGetCakesCount.ts b/hooks/queries/letters/useGetCakesCount.ts
index 93f3735b..90567b1d 100644
--- a/hooks/queries/letters/useGetCakesCount.ts
+++ b/hooks/queries/letters/useGetCakesCount.ts
@@ -16,7 +16,7 @@ export function useGetCakesCount(wishId: string | string[] | undefined) {
onSuccess: (data) => {
// setCakesCountData(data);
if (Array.isArray(data)) {
- const cakesTotal = calculateTotal(data.map((cake: { count: any; }) => cake.count));
+ const cakesTotal = calculateTotal(data.map((cake: { count: number }) => cake.count));
setTotal(cakesTotal);
}
},
diff --git a/hooks/queries/login/useAuthKakao.ts b/hooks/queries/login/useAuthKakao.ts
index cefd2069..e49d9e09 100644
--- a/hooks/queries/login/useAuthKakao.ts
+++ b/hooks/queries/login/useAuthKakao.ts
@@ -40,6 +40,7 @@ export default function useAuthKakao() {
useEffect(() => {
if (authCode) {
+ console.log('useEffect', authCode);
kakaoLoginMutate();
}
}, [authCode, kakaoLoginMutate]);
diff --git a/hooks/queries/main/useGetProgressData.ts b/hooks/queries/main/useGetProgressData.ts
index faddce35..a56349b5 100644
--- a/hooks/queries/main/useGetProgressData.ts
+++ b/hooks/queries/main/useGetProgressData.ts
@@ -1,32 +1,26 @@
import { getProgressData } from '@/api/main/getProgressData';
import { QUERY_KEY } from '@/constant/queryKey';
-import { LoginUserInfo } from '@/recoil/auth/loginUserInfo';
-import { useEffect, useState } from 'react';
+import { useState } from 'react';
import { useQuery } from 'react-query';
-import { useRecoilValue } from 'recoil';
export default function useGetProgressData() {
const [wishStatus, setWishStatus] = useState('');
- const { data: progressData, isSuccess } = useQuery(
- QUERY_KEY.PROGRESS,
- getProgressData,
- {
- onSuccess: (data) => {
- if (data) {
- if (data.status === 'WHILE') {
- setWishStatus('while');
- } else if (data.status === 'END') {
- setWishStatus('end');
- } else if (data.status === 'BEFORE') {
- setWishStatus('before');
- }
- } else {
- setWishStatus('none');
+ const { data: progressData, isSuccess } = useQuery(QUERY_KEY.PROGRESS, getProgressData, {
+ onSuccess: (data) => {
+ if (data) {
+ if (data.status === 'WHILE') {
+ setWishStatus('while');
+ } else if (data.status === 'END') {
+ setWishStatus('end');
+ } else if (data.status === 'BEFORE') {
+ setWishStatus('before');
}
- },
- }
- );
+ } else {
+ setWishStatus('none');
+ }
+ },
+ });
return { progressData, wishStatus, isSuccess };
-}
\ No newline at end of file
+}
diff --git a/hooks/queries/mypage/useEditWishesInfo.tsx b/hooks/queries/mypage/useEditWishesInfo.tsx
index 1e8c1c7c..6674019a 100644
--- a/hooks/queries/mypage/useEditWishesInfo.tsx
+++ b/hooks/queries/mypage/useEditWishesInfo.tsx
@@ -1,9 +1,15 @@
-import { editWishesInfo } from '@/api/mypage/editWishesInfo';
+import { editWishesInfo } from '@/api/mypage/mypageAPI';
import { EditWishesInfoDataType } from '@/types/mypage/editWishesInfoDataType';
+import { useRouter } from 'next/router';
import { useMutation } from 'react-query';
export default function useEditWishesInfo(editWishesInfoData: EditWishesInfoDataType) {
- const { mutate: editWishesData } = useMutation(() => editWishesInfo(editWishesInfoData), {});
+ const router = useRouter();
+ const { mutate: editWishesData } = useMutation(() => editWishesInfo(editWishesInfoData), {
+ onSuccess: () => {
+ router.back();
+ },
+ });
return { editWishesData };
}
diff --git a/hooks/useKakaoShare.ts b/hooks/useKakaoShare.ts
index 555d3ec5..e7961c57 100644
--- a/hooks/useKakaoShare.ts
+++ b/hooks/useKakaoShare.ts
@@ -1,27 +1,27 @@
export default function useKakaoShare(nickname: string, link: string) {
- if (window.Kakao) {
- window.Kakao.Share.sendDefault({
- objectType: 'feed',
- content: {
- title: `${nickname}님의 생일선물을 고민하고 있다면?`,
- description:
- `고민할 필요없이 이 귀여운 케이크를 선물해 ${nickname}님의 생일 펀딩에 참여해보세요!`,
- imageUrl:
- 'https://ifh.cc/g/wWJNBF.jpg',
+ // if (window.Kakao) {
+ window.Kakao.Share.sendDefault({
+ objectType: 'feed',
+ content: {
+ title: `${nickname}님의 생일선물을 고민하고 있다면?`,
+ description:
+ `고민할 필요없이 이 귀여운 케이크를 선물해 ${nickname}님의 생일 펀딩에 참여해보세요!`,
+ imageUrl:
+ 'https://ifh.cc/g/wWJNBF.jpg',
+ link: {
+ mobileWebUrl: link,
+ webUrl: link,
+ },
+ },
+ buttons: [
+ {
+ title: '자세히 보기',
link: {
mobileWebUrl: link,
webUrl: link,
},
},
- buttons: [
- {
- title: '자세히 보기',
- link: {
- mobileWebUrl: link,
- webUrl: link,
- },
- },
- ],
- });
- }
+ ],
+ });
+ // }
}
diff --git a/hooks/wishes/useUploadItemInfo.ts b/hooks/wishes/useUploadItemInfo.ts
index eb27cb06..c6dc1a82 100644
--- a/hooks/wishes/useUploadItemInfo.ts
+++ b/hooks/wishes/useUploadItemInfo.ts
@@ -5,35 +5,27 @@ import { useMutation, useQuery } from 'react-query';
export default function useUploadItemInfo() {
const [imageFile, setImageFile] = useState(null);
- const [previewImage, setPreviewImage] = useState('');
- const [preSignedURL, setPreSignedURL] = useState('');
+ const [preSignedImageURL, setPreSignedImageURL] = useState('');
const { data } = useQuery(QUERY_KEY.PRE_SIGNED_URL, () => getPresignedURL(imageFile?.name), {
enabled: imageFile !== null && imageFile?.name !== '',
});
+ const { mutate } = useMutation(() => uploadPresignedURL(data?.data?.data?.signedUrl, imageFile), {
+ onSuccess: () => {
+ const s3URL = `https://wish-image-bucket.s3.ap-northeast-2.amazonaws.com/${data?.data?.data.filename}`;
+ setPreSignedImageURL(s3URL);
+ },
+ });
+
useEffect(() => {
- if (data?.data?.success) {
- mutate();
- }
+ data?.data?.success && mutate();
}, [data]);
- const { mutate } = useMutation(() => uploadPresignedURL(data?.data?.data?.signedUrl, imageFile));
-
- console.log(data);
-
function uploadImageFile(e: React.ChangeEvent) {
const imageFile = e.target.files && e.target.files[0];
-
- if (imageFile) {
- setImageFile(imageFile);
- const reader = new FileReader();
- imageFile && reader.readAsDataURL(imageFile);
- reader.onloadend = () => {
- setPreviewImage(reader.result as string);
- };
- }
+ imageFile && setImageFile(imageFile);
}
- return { imageFile, previewImage, setPreviewImage, uploadImageFile };
+ return { imageFile, preSignedImageURL, setPreSignedImageURL, uploadImageFile };
}
diff --git a/next.config.js b/next.config.js
index 74792dc1..e7f69dd6 100644
--- a/next.config.js
+++ b/next.config.js
@@ -30,7 +30,12 @@ const nextConfig = {
pathname: '/**',
},
],
- domains: ['img.29cm.co.kr', 'product.29cm.co.kr', 'localhost'],
+ domains: [
+ 'img.29cm.co.kr',
+ 'product.29cm.co.kr',
+ 'localhost',
+ 'wish-image-bucket.s3.ap-northeast-2.amazonaws.com',
+ ],
},
rules: {
test: /\.svg$/,
diff --git a/package.json b/package.json
index b4097ef6..61a98e0a 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"react-dom": "18.2.0",
"react-query": "^3.39.3",
"react-responsive": "^9.0.2",
+ "react-spinners": "^0.13.8",
"recoil": "^0.7.7",
"recoil-persist": "^4.2.0",
"serverless": "^2.59.0",
diff --git a/pages/cakes/[id].tsx b/pages/cakes/[id].tsx
index c1996f17..50043b0c 100644
--- a/pages/cakes/[id].tsx
+++ b/pages/cakes/[id].tsx
@@ -1,5 +1,10 @@
import CakesContainer from '@/components/cakes';
+import Layout from '@/components/common/layout';
export default function CakesPage() {
- return ;
+ return (
+
+
+
+ );
}
diff --git a/pages/cakes/approve/index.tsx b/pages/cakes/approve/index.tsx
index ec9a66e1..d4c7d58f 100644
--- a/pages/cakes/approve/index.tsx
+++ b/pages/cakes/approve/index.tsx
@@ -8,6 +8,7 @@ import { useEffect } from 'react';
import { useSetRecoilState } from 'recoil';
import styled from 'styled-components';
import SuccessMessageBox from '@/components/cakes/approve/successMessageBox';
+import Layout from '@/components/common/layout';
export default function ApprovePage() {
const setCakesData = useSetRecoilState(CakesData);
@@ -31,17 +32,19 @@ export default function ApprovePage() {
};
return (
-
-
-
-
- 당신도 받고 싶은 선물이 있나요?
-
-
+
+
+
+
+
+ 당신도 받고 싶은 선물이 있나요?
+
+
+
);
}
diff --git a/pages/index.tsx b/pages/index.tsx
index 1b9421af..5b4c0658 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1,9 +1,12 @@
+import Layout from '@/components/common/layout';
import LoginContainer from '@/components/login';
export default function LoginPage() {
return (
<>
-
+
+
+
>
);
}
diff --git a/pages/login/oauth2/code/kakao.tsx b/pages/login/oauth2/code/kakao/index.tsx
similarity index 62%
rename from pages/login/oauth2/code/kakao.tsx
rename to pages/login/oauth2/code/kakao/index.tsx
index ff01beac..ec9eeed7 100644
--- a/pages/login/oauth2/code/kakao.tsx
+++ b/pages/login/oauth2/code/kakao/index.tsx
@@ -1,10 +1,10 @@
+import Layout from '@/components/common/layout';
import Redirect from '@/components/login/redirect';
export default function Kakao() {
-
return (
- <>
+
- >
+
);
}
diff --git a/pages/main.tsx b/pages/main/index.tsx
similarity index 60%
rename from pages/main.tsx
rename to pages/main/index.tsx
index f15b88a3..bc585b99 100644
--- a/pages/main.tsx
+++ b/pages/main/index.tsx
@@ -1,10 +1,10 @@
+import Layout from '@/components/common/layout';
import MainContainer from '@/components/main';
export default function MainPage() {
-
return (
- <>
+
- >
+
);
}
diff --git a/pages/wishes/[id].tsx b/pages/wishes/[id].tsx
index 2f025105..4ff9fbe2 100644
--- a/pages/wishes/[id].tsx
+++ b/pages/wishes/[id].tsx
@@ -1,9 +1,10 @@
+import Layout from '@/components/common/layout';
import WishesContainer from '@/components/wishes/[id]';
export default function WishesPage() {
return (
- <>
+
- >
+
);
}
diff --git a/public/assets/icons/imageUploadIc.svg b/public/assets/icons/imageUploadIc.svg
index 00d1b596..f0fd9f62 100644
--- a/public/assets/icons/imageUploadIc.svg
+++ b/public/assets/icons/imageUploadIc.svg
@@ -1,3 +1,3 @@
-