Skip to content
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

[이주안] Week13 #457

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
93a0e93
chore: 머지 후 브랜치 삭제 github action 추가
withyj-codeit Sep 3, 2023
17be37c
Initial commit from Create Next App
withyj-codeit Sep 8, 2023
b2e37bd
reset
hanseulhee Oct 10, 2023
6f8bbb0
Merge branch 'codeit-bootcamp-frontend:main' into main
hanseulhee Oct 10, 2023
e11e25f
fix: 머지 후 브랜치 삭제 github action 수정
hanseulhee Oct 10, 2023
212e864
env: workflows 폴더로 이동
hanseulhee Oct 10, 2023
4dc5dd0
Merge pull request #237 from hanseulhee/fix-github-actions
withyj-codeit Nov 6, 2023
4dbede7
fix: 머지 후 브랜치 삭제 github action 수정
hanseulhee Oct 10, 2023
a5cd5f5
env: workflows 폴더로 이동
hanseulhee Oct 10, 2023
09c3f4d
리액트테스트
Mar 29, 2024
96f3fc8
리액트테스트
Mar 29, 2024
2e40d62
리액트테스트
Mar 29, 2024
d0acde9
네이게이션 바, 컨텐츠 기초 틀 제작
Mar 29, 2024
28a72af
api수정, 기존 컨텐츠 틀 전체 변경
Mar 30, 2024
e8b56b0
메인 프로필, 검색바 추가
Mar 30, 2024
198dd00
네비게이션 바에서 로그인 버튼, footer 추가
Mar 30, 2024
95d31da
정보가 있을 경우 네비게이션 바에 프로필 추가
Mar 31, 2024
17e60b1
Merge branch 'codeit-bootcamp-frontend:main' into part2-이주안-week7
Mar 31, 2024
cdfa28e
Merge branch 'part2-이주안' into part2-이주안-week7
Mar 31, 2024
affcdbb
Merge pull request #293 from juan0444/part2-이주안-week7
devym-37 Apr 1, 2024
f12881f
test: git
Apr 3, 2024
f7721bf
feat: 반응형 추가
Apr 4, 2024
0335f9f
feat: 폴더 페이지 추가
Apr 7, 2024
f8ecd59
Merge branch 'part2-이주안' into part2-이주안-week8
Apr 7, 2024
9ca9c22
test: git
Apr 7, 2024
0fb099d
Merge branch 'part2-이주안-week8' of https://github.com/juan0444/5-Weekl…
Apr 7, 2024
72847c0
test: git
Apr 7, 2024
b5e71ba
Feat: 폴더 구조 변경
Apr 29, 2024
8362c94
Feat: 폴더 제목 추가
Apr 29, 2024
a03af65
Feat: 폴더 버튼 클릭시 해당하는 링크 카드를 나타냄
Apr 29, 2024
71940d1
Feat: 케밥 버튼 추가
May 4, 2024
fce377b
Feat: 케밥 버튼 추가
May 4, 2024
366fb18
Feat: 모달 추가
May 4, 2024
a0286a1
Feat: 추가한 모달 버튼에 추가
May 5, 2024
09fb67c
style: 클래스명 변경
May 5, 2024
4bcf2ab
Feat: 공유 모달 추가
May 5, 2024
1439709
Test: Next.js 테스트
May 19, 2024
02dc494
Feat: 컴포넌트 원래대로 배치
May 19, 2024
ef7fb12
Feat: 타입 추가
May 19, 2024
66cd7b8
Style: 모달 변경
May 19, 2024
ff5be4e
Merge branch 'part3-이주안' into part3-이주안-week13
May 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/pull_request_template.md

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
Expand Down
109 changes: 109 additions & 0 deletions components/AddFolderModal/AddFolderModal.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@import "/styles/globals.scss";

.container {
z-index: 4;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: $modal-gray;
}

.content {
position: absolute;
top: 50%;
left: 50%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
transform: translate(-50%, -50%);
gap: 1.5rem;

padding: 2.2rem 2.5rem;

width: 25rem;
height: 26rem;

border-radius: 0.9375rem;
border: 1px solid $color-gray-light;
background: $color-white;

h2 {
@include font(1.5rem, $color-gray100, 700);
}
}

.title {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;

@include font(1.2rem, $color-gray60, 400);

p {
width: 20rem;
margin-top: 0.8rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
}

.input-text {
border: 1px solid $color-primary;
}

.folder-block {
display: flex;
margin-top: 1rem;
width: 20rem;
height: 12rem;
flex-direction: column;
align-items: baseline;
overflow: scroll;
overflow-x: hidden;

button {
width: 100%;
text-align: left;
padding: 0.8rem;
@include font(1.2rem, $color-black, 400);

&:hover {
border-radius: 0.5rem;
background: $color-light-blue;
@include font(1.2rem, $color-primary, 400);
}
}
}

.button-click {
border-radius: 0.5rem;
background: $color-light-blue;
@include font(1.4rem, $color-primary, 400);
}

.add-button {
display: flex;
width: 100%;
margin-top: 1.4rem;
padding: 1rem 1.25rem;
justify-content: center;
align-items: center;
gap: 0.625rem;

border-radius: 0.5rem;
background: $color-linear-gradient;

@include font(1.2rem, $color-gray-light, 600);
}

.button {
border: none;
background-color: #fff;
}
54 changes: 54 additions & 0 deletions components/AddFolderModal/AddFolderModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { useEffect, useRef } from "react";
import styles from "./AddFolderModal.module.scss";
import classNames from "classnames/bind";
import { COLSE_ICON } from "./constant";

const cx = classNames.bind(styles);

export const AddFolderModal = ({ modal, setModal, url, folders }) => {
const modalRef = useRef(null);

// 모달 영역 밖 클릭 시 닫기
useEffect(() => {
const handleModal = (event) => {
if (modal && !modalRef.current?.contains?.(event.target)) {
setModal(false);
}
};

document.addEventListener("mousedown", handleModal);

return () => {
document.removeEventListener("mousedown", handleModal);
};
}, [modal, setModal, modalRef]);

return (
<div className={cx("container")}>
<div className={cx("content")} ref={modalRef}>
<div className={cx("title")}>
<h2>폴더에 추가</h2>
<p>{url}</p>
<div className={cx("folder-block")}>
{folders.map((item) => {
return (
<button
key={item.id}
className={cx("button")}
// onClick={() => clickButton(item, index)}
type="button"
>
<span>{item.name}</span>
</button>
);
})}
</div>

<button className={cx("add-button")} type="button">
추가하기
</button>
</div>
</div>
</div>
);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 작성해주셨습니다! 👍

1 change: 1 addition & 0 deletions components/AddFolderModal/constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const COLSE_ICON = "/closeIcon.svg";
1 change: 1 addition & 0 deletions components/AddFolderModal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./AddFolderModal";
89 changes: 89 additions & 0 deletions components/AddModal/AddModal.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@import "/styles/globals.scss";

.container {
z-index: 4;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: $modal-gray;
}

.content {
position: absolute;
top: 50%;
left: 50%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
transform: translate(-50%, -50%);
gap: 1.5rem;
padding: 2.2rem 2.5rem;
width: 25rem;
height: 16rem;
border-radius: 0.9375rem;
border: 1px solid $color-gray-light;
background: $color-white;

h2 {
@include font(1.5rem, $color-gray100, 700);
}
}

.title {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;

@include font(1.2rem, $color-gray60, 400);

input {
width: 20rem;
margin-top: 0.8rem;
padding: 1.2rem;
border-radius: 0.5rem;
background: $color-white;
border: 1px solid $color-gray20;
@include font(1.2rem, $color-gray100, 400);

&:hover {
border: 1px solid $color-primary;
}
}

button {
display: flex;
width: 100%;
margin-top: 1.4rem;
padding: 1rem 1.25rem;
justify-content: center;
align-items: center;
gap: 0.625rem;

border-radius: 0.5rem;
background: $color-linear-gradient;

@include font(1.2rem, $color-gray-light, 600);
}

p {
width: 20rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
}

.input-text {
border: 1px solid $color-primary;
}

.image {
width: 1rem;
height: 1rem;
}
36 changes: 36 additions & 0 deletions components/AddModal/AddModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useEffect, useRef } from "react";
import styles from "./AddModal.module.scss";
import classNames from "classnames/bind";
import { COLSE_ICON } from "./constant";
import Image from "next/image";

const cx = classNames.bind(styles);

export const AddModal = ({ modal, setModal, children }) => {
const modalRef = useRef(null);

// 모달 영역 밖 클릭 시 닫기
useEffect(() => {
const handleModal = (event) => {
if (modal && !modalRef.current?.contains?.(event.target)) {
setModal(false);
}
};

document.addEventListener("mousedown", handleModal);

return () => {
document.removeEventListener("mousedown", handleModal);
};
}, [modal, setModal, modalRef]);

return (
<div className={cx("container")}>
<Image className={cx("image")} src={COLSE_ICON} alt="모달 닫기 아이콘" width={100} height={100}/>

<div className={cx("content")} ref={modalRef}>
<div className={cx("title")}>{children}</div>
</div>
</div>
);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classnames 가독성이 있고 해당 스타일명만으로도 코드 구조가 읽혀서 잘 작성해주신 것 같습니다

1 change: 1 addition & 0 deletions components/AddModal/constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const COLSE_ICON = "/closeIcon.svg";
1 change: 1 addition & 0 deletions components/AddModal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./AddModal";
Loading
Loading