-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PR 리뷰 반영 및 Product 스타일 개선 (#23) * Refactor: StrictMode 활성화 및 reducer 수정 - 전위연산자를 -1로 수정 - 일부는 스프레드 연산자로 state를 복사하도록 수정 Related to: #22 * Refactor: OrderLog 컴포넌트 리턴문 개선 - if문을 리턴문 안으로 이동함 Related to: #22 * Style: Children이 없는 컴포넌트 수정 * Design: Product 컴포넌트 스타일 개선 - isAvailable이 false이면 하얀 동그라미가 되도록 수정 - prop에 대한 조건문 수정 * 반환 기능 추가 및 리렌더링 개선 (#24) * Fix: 반환 버튼과 관련된 컴포넌트를 파일로 분리 * Feat: 반환 버튼 클릭시 투입한 돈 반환하기 구현 Related to: #13 * Style: 중복된 case문 병합 * Refactor: input에 돈 투입하는 함수를 컴포넌트와 분리 * Feat: 로그 메세지가 길어지면 스크롤이 자동으로 내려가는 기능 추가 - logMessage 함수 분리 * Feat: 전역 타이머값을 위한 TimerContext 생성 - 타이머의 남은 시간을 나타내는 UI 추가 Related to: #13 * Refactor: MoneyContext 개선 및 일부 컴포넌트에 memo 적용 - dispatch와 관련된 함수를 hook으로 분리 - dispatch 함수 내부로 logContext의 dispatch 함수를 호출하도록 수정 * Refactor: LogContext 개선 - MoneyProvider 내부의 dispatch를 사용한 함수를 hook으로 분리 * Style: OrderContainer 관련 컴포넌트에 고정된 width값 추가 * Refactor: ProductContext 개선 및 memo 적용 * Fix: 스크롤 개선 - scrollIntoView를 scrollTop으로 개선
- Loading branch information
1 parent
cc27e6c
commit 153e80e
Showing
18 changed files
with
441 additions
and
297 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
44 changes: 18 additions & 26 deletions
44
src/components/VendingMachine/OrderContainer/OrderLog.jsx
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,25 @@ | ||
import { useMoneyState } from 'context/MoneyContext'; | ||
|
||
import styled from 'styled-components'; | ||
import exchangeMoney from 'utils/exchangeMoney'; | ||
|
||
export default function ReturnCost() { | ||
const { insertMoneyData, returnMoney } = useMoneyState(); | ||
|
||
const handleClick = () => { | ||
const exchangeLog = exchangeMoney(insertMoneyData); | ||
returnMoney(exchangeLog); | ||
}; | ||
|
||
return <ReturnBtn onClick={handleClick}>반환</ReturnBtn>; | ||
} | ||
|
||
const ReturnBtn = styled.button` | ||
padding: 4px 24px; | ||
margin-bottom: 24px; | ||
border-radius: 4px; | ||
background: ${({ theme }) => theme.colors.gray1}; | ||
box-shadow: 0 2px 2px 0 rgba(38, 38, 135, 0.3); | ||
color: ${({ theme }) => theme.colors.gray3}; | ||
${({ theme }) => theme.fontStyles.xSmallBold}; | ||
`; |
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
Oops, something went wrong.