Skip to content

Commit

Permalink
Merge pull request #121 from Make-A-Wish-Sopt/release#115-letters/bac…
Browse files Browse the repository at this point in the history
…kBtn

Release#115 letters/back btn
  • Loading branch information
nkavay committed Sep 6, 2023
2 parents f3f41eb + e426bd5 commit 0075b64
Show file tree
Hide file tree
Showing 87 changed files with 769 additions and 604 deletions.
8 changes: 3 additions & 5 deletions api/login/sendCodeToServer.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
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,
{},
{
headers: {
'Content-Type': 'application/json',
},
params: {
code: authCode,
code: `${code}`,
},
},
);
Expand Down
20 changes: 0 additions & 20 deletions api/mypage/editWishesInfo.ts

This file was deleted.

15 changes: 0 additions & 15 deletions api/mypage/getEditWishesInfo.ts

This file was deleted.

46 changes: 46 additions & 0 deletions api/mypage/mypageAPI.ts
Original file line number Diff line number Diff line change
@@ -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;
};
42 changes: 22 additions & 20 deletions api/wishes/wishesAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 };
};
Expand Down Expand Up @@ -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;
};
2 changes: 1 addition & 1 deletion components/cakes/SelectCakes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function SelectCakes(props: SelectCakesProps) {
</LargeBox>

<Styled.CakeInfo>
{selectedCake.name} {convertMoneyText(selectedCake.price)}
{selectedCake.name} {convertMoneyText(String(selectedCake.price))}
</Styled.CakeInfo>
</InputContainer>
);
Expand Down
2 changes: 1 addition & 1 deletion components/cakes/cakesHeader.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion components/common/alertTextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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};
`,
Expand Down
File renamed without changes.
82 changes: 82 additions & 0 deletions components/common/footer.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Styled.Container>
<Image src={LogoImg} alt={'조물주보다 생일선물주 로고'} />

<Styled.ContentContainer>
상호명: 조물주보다생일선물주
<br />
사업자등록번호: 246-05-02593
<br />
통신판매업신고: 2023-경기양주-1379
<br />
사업장주소지: 경기도 양주시 고덕로 159, 207-403
<br />
대표자명: 이승원
</Styled.ContentContainer>
<Styled.HorizontalLine />

<Styled.ButtonContainer>
<Styled.Button onClick={handleTermsOfUse}>이용약관</Styled.Button>
<Styled.Button onClick={handlePrivacyPolicy}>개인정보처리방침</Styled.Button>
<Styled.Button onClick={handleMarketingAgreement}>광고마케팅정보수신동의</Styled.Button>
</Styled.ButtonContainer>
</Styled.Container>
);
}

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;
`,
};
34 changes: 24 additions & 10 deletions components/common/layout.tsx
Original file line number Diff line number Diff line change
@@ -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 <Root>{children}</Root>;
return (
<Styled.Root>
<Styled.Container>{children}</Styled.Container>
{footer && <Footer />}
</Styled.Root>
);
}

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;
`,
};
30 changes: 30 additions & 0 deletions components/common/loading.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Styled.Container>
<ClipLoader color={theme.colors.main_blue} />
<Styled.Title>로딩중입니다</Styled.Title>
</Styled.Container>
);
}

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;
`,
};

4 changes: 2 additions & 2 deletions components/common/mainView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -25,7 +25,7 @@ export default function MainView(props: MainViewProps) {

<Styled.ImageContainer>
<Styled.Title>
조물주보다,
조물주보다
<br />
생일선물주
</Styled.Title>
Expand Down
2 changes: 1 addition & 1 deletion components/common/modal/BankInput.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Loading

0 comments on commit 0075b64

Please sign in to comment.