-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from Make-A-Wish-Sopt/feature/163-errorfix
Feature/163 errorfix
- Loading branch information
Showing
104 changed files
with
6,559 additions
and
836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import TextareaBox from '../Common/Input/TextareaBox'; | ||
import styled from 'styled-components'; | ||
import { LIMIT_TEXT } from '@/constant/limitText'; | ||
import SelectCakes from './SelectCakes'; | ||
import Button from '../Common/Button'; | ||
import Input from '../Common/Input/Input'; | ||
import { UseFormReturn } from 'react-hook-form'; | ||
import InputContainer from '../Common/Input/InputContainer'; | ||
import { CakesDataInputType } from '@/types/common/input/cakesInput'; | ||
import { StyledBox } from '../Common/Box'; | ||
import BackBtn from '../Common/Button/BackBtn'; | ||
import { CakeListType } from '@/types/cakes/cakeListType'; | ||
import { useGetPublicWishes } from '@/hooks/queries/public'; | ||
import { UseMutateFunction } from 'react-query'; | ||
import theme from '@/styles/theme'; | ||
|
||
interface CakesFormProps { | ||
methods: UseFormReturn<CakesDataInputType, any, undefined>; | ||
selectedCake: CakeListType; | ||
selectedIndex: number; | ||
selectCake: (index: number) => void; | ||
wishesId: string | string[] | undefined; | ||
postPublicCakesData: UseMutateFunction< | ||
{ | ||
cakeId: number; | ||
imageUrl: string; | ||
hint: string; | ||
initial: string; | ||
contribute: string; | ||
wisher: string; | ||
}, | ||
unknown, | ||
void, | ||
unknown | ||
>; | ||
} | ||
|
||
export default function CakesForm(props: CakesFormProps) { | ||
const { methods, selectedCake, selectedIndex, selectCake, wishesId, postPublicCakesData } = props; | ||
|
||
const { publicWishesData } = useGetPublicWishes(wishesId); | ||
|
||
const handleClickFn = () => { | ||
postPublicCakesData(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Styled.HeaderWrapper> | ||
<BackBtn /> | ||
<span>{`D-${publicWishesData?.dayCount}`}</span> | ||
</Styled.HeaderWrapper> | ||
|
||
<Styled.Title>{publicWishesData?.title}</Styled.Title> | ||
|
||
<InputContainer title={`${publicWishesData?.name}님이 남긴 선물에 대한 힌트`}> | ||
<Styled.HintBox className={'pastelBlue_darkBlue'}>{publicWishesData?.hint}</Styled.HintBox> | ||
</InputContainer> | ||
|
||
<InputContainer title={'본인의 실명 작성하기'}> | ||
<Input | ||
placeholder="이름을 정확하게 작성해주세요. ex. 홍길동" | ||
register={methods.register('giverName')} | ||
/> | ||
</InputContainer> | ||
|
||
<SelectCakes | ||
selectedCake={selectedCake} | ||
selectedIndex={selectedIndex} | ||
selectCake={selectCake} | ||
/> | ||
|
||
<InputContainer title={'친구에게 편지 남기기'}> | ||
<TextareaBox | ||
placeholder={`ex. 너 도대체 원하는 게 모야?\n나 넘 궁금해. 일단 몸보신 한우 케이크 보태겠어`} | ||
inputLength={methods.watch('letter').length} | ||
limitLength={LIMIT_TEXT.DESCRIPTION} | ||
register={methods.register('letter')} | ||
></TextareaBox> | ||
</InputContainer> | ||
|
||
<Styled.ButtonWrapper> | ||
<Button boxType="large" colorSystem="mainBlue_white" handleClickFn={handleClickFn}> | ||
{'케이크 주문하기'} | ||
</Button> | ||
</Styled.ButtonWrapper> | ||
</> | ||
); | ||
} | ||
|
||
const Styled = { | ||
HeaderWrapper: styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
color: ${theme.colors.main_blue}; | ||
${theme.fonts.headline20}; | ||
`, | ||
|
||
Title: styled.h1` | ||
${theme.fonts.headline24_100}; | ||
color: ${theme.colors.main_blue}; | ||
margin: 2.4rem 0 3rem; | ||
`, | ||
|
||
HintBox: styled(StyledBox)` | ||
width: 100%; | ||
height: 12.6rem; | ||
${theme.fonts.body14}; | ||
padding: 1.2rem 1rem 1.2rem 1.2rem; | ||
`, | ||
|
||
ButtonWrapper: styled.div` | ||
padding-bottom: 4.6rem; | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
components/cakes/Result/contribution.tsx → components/Cakes/Result/Contribution.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
components/cakes/SelectCakes.tsx → components/Cakes/SelectCakes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
18 changes: 7 additions & 11 deletions
18
components/common/box/imageBox.tsx → components/Common/Box/ImageBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
components/common/box/itemImageBox.tsx → components/Common/Box/ItemImageBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ReactNode } from 'react'; | ||
import { BoxTypes, ColorSystemType } from '@/types/common/box/boxStyleType'; | ||
import styled from 'styled-components'; | ||
import { StyledBox } from '../Box'; | ||
import theme from '@/styles/theme'; | ||
|
||
interface ButtonProps { | ||
boxType: BoxTypes; | ||
colorSystem: ColorSystemType; | ||
handleClickFn?: (parameter?: unknown) => void | unknown; | ||
children: ReactNode; | ||
} | ||
|
||
export default function Button(props: ButtonProps) { | ||
const { boxType, colorSystem, handleClickFn, children } = props; | ||
|
||
return ( | ||
<StyledBtnBox as="button" className={`${boxType} ${colorSystem} `} onClick={handleClickFn}> | ||
{children} | ||
</StyledBtnBox> | ||
); | ||
} | ||
|
||
const StyledBtnBox = styled(StyledBox)<{ width?: number }>` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 5rem; | ||
${theme.fonts.button18}; | ||
`; |
Oops, something went wrong.
59e1ba9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
make-a-wish-client-test – ./
make-a-wish-client-test-git-develop-makeawish.vercel.app
make-a-wish-client-test-makeawish.vercel.app
make-a-wish-client-test.vercel.app