-
Notifications
You must be signed in to change notification settings - Fork 46
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
[김한샘] week11 #360
Merged
Jay-WKJun
merged 12 commits into
codeit-bootcamp-frontend:part2-김한샘
from
hansaemkim38:part2-김한샘-week11
Apr 29, 2024
The head ref may contain hidden characters: "part2-\uAE40\uD55C\uC0D8-week11"
Merged
[김한샘] week11 #360
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
be97aed
Refactor: 피드백 반영
hansaemkim38 aabd5e3
Refactor: folder일때만 kebob 나오게끔 수정
hansaemkim38 eb6bbb6
Fix: 기본 modal 추가
hansaemkim38 7ddc8da
Fix: 기본 모달 기능 추가
hansaemkim38 67af94c
Fix: modal에 context적용
hansaemkim38 c4e075c
Fix: 모달 type 추가
hansaemkim38 81b1aa1
Feat: 케밥 리스트 클릭시 닫기, url 추가
hansaemkim38 ec32a96
Feat: 버튼 클릭시 각 폴더네임, 카드 url 모달에 추가
hansaemkim38 a83de40
Feat: 각 버튼에 모달 타입에 따라 onclick 이벤트 추가
hansaemkim38 5d06441
Feat: modlaType에 따른 modal 이벤트 추가
hansaemkim38 1960b05
Feat: ShareModal 추가
hansaemkim38 1755e39
Feat: FolderAddModal active 기능 추가
hansaemkim38 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 +1,28 @@ | ||
import "./AddLinkForm.css"; | ||
import LinkIcon from "../../assets/icon/link.png"; | ||
import { useContext } from "react"; | ||
import ModalContext from "../Modal/ModalContext"; | ||
|
||
function AddLinkForm() { | ||
return ( | ||
<div className="link-wrap"> | ||
<form className="link-add-form"> | ||
<div className="link-con-wrap"> | ||
<img src={LinkIcon} alt="" /> | ||
<input className="link-input" type="text" placeholder="링크를 추가해보세요." /> | ||
<button className="link-button">추가하기</button> | ||
</div> | ||
</form> | ||
const { openModal, setModalType } = useContext(ModalContext); | ||
const onClickModalOpen = (e) => { | ||
e.preventDefault(); | ||
openModal(); | ||
setModalType("folderAdd"); | ||
}; | ||
return ( | ||
<div className="link-wrap"> | ||
<form className="link-add-form"> | ||
<div className="link-con-wrap"> | ||
<img src={LinkIcon} alt="" /> | ||
<input className="link-input" type="text" placeholder="링크를 추가해보세요." /> | ||
<button className="link-button" onClick={onClickModalOpen}> | ||
추가하기 | ||
</button> | ||
</div> | ||
); | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default AddLinkForm; |
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,11 @@ | ||
import KebabIcon from "../../assets/svg/kebab.svg"; | ||
|
||
function KebebButton({ onClickKebabButton }) { | ||
return ( | ||
<button className="Kebab" onClick={onClickKebabButton}> | ||
<img src={KebabIcon} alt="메뉴 더보기" /> | ||
</button> | ||
); | ||
} | ||
|
||
export default KebebButton; |
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,20 @@ | ||
.Kebab-list { | ||
position: absolute; | ||
right: 10px; | ||
top: 40px; | ||
background: #fff; | ||
box-shadow: 0px 2px 8px 0px #3332361a; | ||
text-align: center; | ||
font-size: 14px; | ||
line-height: 1.19357142857; | ||
color: #333236; | ||
} | ||
|
||
.Kebab-list > li > button { | ||
padding: 7px 17.5px; | ||
} | ||
|
||
.Kebab-list > li:hover { | ||
background: #e7effb; | ||
color: #6d6afe; | ||
} |
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,35 @@ | ||
import "./KebabList.css"; | ||
import { useContext } from "react"; | ||
import ModalContext from "../Modal/ModalContext"; | ||
|
||
function KebabList({ url, setDisplay }) { | ||
const { openModal, setModalType, setCardUrl } = useContext(ModalContext); | ||
|
||
const onClickDeleteLinkModalOpen = (e) => { | ||
e.preventDefault(); | ||
setModalType("linkDelete"); | ||
setCardUrl(url); | ||
openModal(); | ||
setDisplay(); | ||
}; | ||
|
||
const onClickAddFolderModalOpen = (e) => { | ||
e.preventDefault(); | ||
setModalType("folderAdd"); | ||
setCardUrl(url); | ||
openModal(); | ||
setDisplay(); | ||
}; | ||
return ( | ||
<ul className="Kebab-list"> | ||
<li> | ||
<button onClick={onClickDeleteLinkModalOpen}>삭제하기</button> | ||
</li> | ||
<li> | ||
<button onClick={onClickAddFolderModalOpen}>폴더에 추가</button> | ||
</li> | ||
</ul> | ||
); | ||
} | ||
|
||
export default KebabList; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,29 +1,30 @@ | ||
import React from "react"; | ||
import "./CardList.css"; | ||
import Card from "../Card/Card"; | ||
|
||
function renderCardList(cardData) { | ||
return ( | ||
<ul className="card-list"> | ||
{cardData.map((card) => { | ||
return <Card card={card} key={card.id} />; | ||
})} | ||
</ul> | ||
); | ||
} | ||
|
||
function CardList({ cardListData, userFolderDataList }) { | ||
return ( | ||
<> | ||
{cardListData ? ( | ||
<ul className="card-list"> | ||
{cardListData?.map((card) => { | ||
return <Card card={card} key={card.id} />; | ||
})} | ||
</ul> | ||
) : null} | ||
{userFolderDataList ? ( | ||
userFolderDataList?.data?.length ? ( | ||
<ul className="card-list"> | ||
{userFolderDataList?.data?.map((card) => { | ||
return <Card card={card} key={card.id} />; | ||
})} | ||
</ul> | ||
) : ( | ||
<div className="empty-link">저장된 링크가 없습니다.</div> | ||
) | ||
) : null} | ||
</> | ||
); | ||
return ( | ||
<> | ||
{cardListData && cardListData.length > 0 && renderCardList(cardListData)} | ||
{userFolderDataList && | ||
userFolderDataList.data && | ||
userFolderDataList.data.length > 0 && | ||
renderCardList(userFolderDataList.data)} | ||
{!cardListData && !userFolderDataList && ( | ||
<div className="empty-link">저장된 링크가 없습니다.</div> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default CardList; |
Oops, something went wrong.
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.
이 코드가 반복되고 있네요 해결방법이 없을까요?