-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge Mara-22 into main #6
Merged
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6ca475d
feat: 냉장고 페이지 컴포넌트 분리
a-honey 978f99f
feat: 현재 탭 전달 및 업데이트
a-honey 396bbf1
chore: 게시판에서 탭상태 생성
a-honey 161af00
feat: 식자재 추가 모달 오픈 추가 및 닫기 전달
a-honey eb7c858
feat: 식자재 추가 organism
a-honey 19f3c8e
feat: 모달-토글 컴포넌트 연결
a-honey c74b22a
feat: 제출 완료시 토스트메시지 추가
a-honey b4a2f8a
feat: 냉장고 페이지 컴포넌트 분리
a-honey f3aca7c
feat: 현재 탭 전달 및 업데이트
a-honey 00e04a3
chore: 게시판에서 탭상태 생성
a-honey ae0107d
feat: 식자재 추가 모달 오픈 추가 및 닫기 전달
a-honey 0cd7c9e
feat: 식자재 추가 organism
a-honey 2a4fb7c
feat: 모달-토글 컴포넌트 연결
a-honey 519661f
feat: 제출 완료시 토스트메시지 추가
a-honey 34f494e
feat: 냉장고 목록 모달 추가
a-honey 22ddcd1
Merge branch 'MARA-22' of https://github.com/DDD-Community/mara-web i…
a-honey 40343a0
Merge branch 'main' into MARA-22
hyeseon-han d064f76
fix: 코드리뷰 Button props 수정 등
a-honey c858010
Merge branch 'MARA-22' of https://github.com/DDD-Community/mara-web i…
a-honey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
|
||
interface BorderTabProps { | ||
tabName: '냉장' | '냉동'; | ||
currentTabName: '냉장' | '냉동'; | ||
handleTabNameChange: (tabName: '냉장' | '냉동') => void; | ||
clickHandler?: () => void; | ||
className?: string; | ||
} | ||
const BorderTab: React.FC<BorderTabProps> = ({ | ||
tabName, | ||
className, | ||
currentTabName, | ||
handleTabNameChange, | ||
}) => { | ||
return ( | ||
<div | ||
className={`bg-white w-full border-2 p-[8px] text-center rounded-[24px] ${className} ${ | ||
currentTabName === tabName ? 'border-primary2 z-10' : 'border-gray-200' | ||
}`} | ||
onClick={() => { | ||
handleTabNameChange(tabName); | ||
}} | ||
> | ||
{tabName} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BorderTab; |
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,18 @@ | ||
import React from 'react'; | ||
|
||
interface GrayBoxProps { | ||
children: React.ReactNode; | ||
className?: string; | ||
} | ||
|
||
const GrayBox: React.FC<GrayBoxProps> = ({ children, className }) => { | ||
return ( | ||
<div | ||
className={`flex ${className ?? 'flex-col'} justify-center items-start bg-[#F5F6F7] gap-22 p-[16px] w-full bg-[#F5F6F7] rounded-12`} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default GrayBox; |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import React from 'react'; | ||
import EnterAllowLightSVG from '@/assets/icons/ICON/COMMON/ic_more-1.svg'; | ||
import Link from 'next/link'; | ||
|
||
interface GreenLinkProps { | ||
text: string; | ||
|
@@ -9,12 +10,13 @@ interface GreenLinkProps { | |
|
||
const GreenLink: React.FC<GreenLinkProps> = ({ text, className }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 버튼 컴포넌트는 저희 디자인에서 많이 사용 될 것 같은 버튼이라서 link로 한정하기 보다는 공통으로 사용 될 수 있고 알아보기 쉽게 Button 컴포넌트에 onClick props로 넘겨줘도 자주 사용 될 것 같아요 🥺🌈 |
||
return ( | ||
<button | ||
<Link | ||
href="/myfridege" | ||
className={`flex items-center justify-center w-full bg-primary2 text-white p-18 gap-12 rounded-12 heading4-semibold ${className}`} | ||
> | ||
{text} | ||
<EnterAllowLightSVG /> | ||
</button> | ||
</Link> | ||
); | ||
}; | ||
|
||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,31 @@ | ||
import React from 'react'; | ||
|
||
interface ModalBoxProps { | ||
children: React.ReactNode; | ||
blackClickHandler: () => void; | ||
} | ||
|
||
const ModalBox: React.FC<ModalBoxProps> = ({ children, blackClickHandler }) => { | ||
const handleWhiteContentClick: (e: React.MouseEvent) => void = (e) => { | ||
if (e.target === e.currentTarget) { | ||
blackClickHandler(); | ||
} | ||
e.stopPropagation(); | ||
}; | ||
|
||
return ( | ||
<div | ||
className="fixed top-0 left-0 w-full h-full flex items-end justify-center bg-black bg-opacity-50 z-[9999]" | ||
onClick={blackClickHandler} | ||
> | ||
<div | ||
className="w-full max-w-[480px] min-h-[500px] pt-[40px] mb-[-24px] bg-white p-[20px] rounded-[24px]" | ||
onClick={handleWhiteContentClick} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ModalBox; |
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,13 @@ | ||
import React from 'react'; | ||
|
||
const ModalCenter: React.FC = () => { | ||
return ( | ||
<div className="fixed top-0 left-0 max-w-[480px] w-full h-full flex items-center justify-center bg-black bg-opacity-50"> | ||
<div className="bg-white p-4"> | ||
<div>hi</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ModalCenter; |
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 React from 'react'; | ||
|
||
interface SearchInputProps { | ||
searchKeyword: string; | ||
onChangeHandler: () => void; | ||
onClickHandler: () => void; | ||
className: string; | ||
} | ||
|
||
const SearchInput: React.FC<SearchInputProps> = ({ | ||
searchKeyword, | ||
onClickHandler, | ||
onChangeHandler, | ||
className, | ||
}) => { | ||
return ( | ||
<div | ||
className={`flex items-center justify-center w-full bg-primary2 text-white p-18 gap-12 rounded-12 heading4-semibold ${className}`} | ||
> | ||
<input onChange={onChangeHandler} value={searchKeyword} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SearchInput; |
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 React, { useEffect } from 'react'; | ||
|
||
interface ToastMessageProps { | ||
text: string; | ||
toggleHandler: () => void; | ||
} | ||
const ToastMessage: React.FC<ToastMessageProps> = ({ text, toggleHandler }) => { | ||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
toggleHandler(); | ||
}, 1000); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="fixed bottom-[90px] left-[20px] right-[20px] p-[16px] rounded-[12px] text-center text-white body1-regular bg-black bg-opacity-70"> | ||
{text} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ToastMessage; |
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,19 @@ | ||
import React from 'react'; | ||
import { ToggleOffSVG, ToggleOnSVG } from './Icon'; | ||
|
||
const Toggle: React.FC<{ | ||
isToggleOn: boolean; | ||
toggleState: (e: React.MouseEvent) => void; | ||
}> = ({ isToggleOn, toggleState }) => { | ||
return isToggleOn ? ( | ||
<div className="mr-[-10px]" onClick={toggleState}> | ||
<ToggleOnSVG /> | ||
</div> | ||
) : ( | ||
<div onClick={toggleState}> | ||
<ToggleOffSVG /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Toggle; |
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
export { default as GreenButton } from './GeenButton'; | ||
export { default as GreenLink } from './GreenLink'; | ||
export { default as WhiteBox } from './WhiteBox'; | ||
export { default as GrayBox } from './GrayBox'; | ||
export { default as IngredientDateTag } from './IngredientDateTag'; | ||
export { default as BorderTab } from './BorderTab'; | ||
export { default as ModalBottom } from './ModalBottom'; | ||
export { default as ModalCenter } from './ModalCenter'; | ||
export { default as Toggle } from './Toggle'; | ||
export { default as ToastMessage } from './ToastMessage'; |
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,22 @@ | ||
import React from 'react'; | ||
import type { CountState } from '@/hooks/useCount'; | ||
|
||
const Counter: React.FC<CountState> = ({ | ||
currentCount, | ||
handleDecreaseCount, | ||
handleIncreaseCount, | ||
}) => { | ||
return ( | ||
<div className="flex items-center h-[32px] bg-white rounded-[6px]"> | ||
<button className="w-[30px] text-center" onClick={handleDecreaseCount}> | ||
- | ||
</button> | ||
<input className="w-[30px] text-center" value={currentCount} /> | ||
<button className="w-[30px] text-center" onClick={handleIncreaseCount}> | ||
+ | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Counter; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
버튼 컴포넌트는 범용적으로 사용 될 가능성이 높아서,☺️
Button 컴포넌트로 생성하고 props로 컬러를 받아서 사용해도 좋을 것 같아요!