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

Feat: 리스트 아이템 구현 및 리스트 생성 페이지 합체 #13

Merged
merged 17 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
bda8a76
Chore: 라이브러리 설치 및 이미지 컴포넌트 환경 설정
seoyoung-min Feb 2, 2024
d7c9f02
Design: 글로벌css 설정
seoyoung-min Feb 2, 2024
3b505d9
Feat: 공용 모달 컴포넌트 구현
seoyoung-min Feb 2, 2024
e9d2a49
Feat: 아이템 링크 추가 모달 구현
seoyoung-min Feb 2, 2024
e14241e
Feat: 라벨 공용 컴포넌트 추가
seoyoung-min Feb 2, 2024
73d9227
Feat: 링크 미리보기 컴포넌트 구현
seoyoung-min Feb 2, 2024
2852175
Feat: 아이템 추가 버튼 UI 구현
seoyoung-min Feb 2, 2024
ade51b4
Refactor: 레이아웃에 portal용 div 추가
seoyoung-min Feb 2, 2024
3ee2a27
Feat: 아이템 레이아웃 컴포넌트 구현
seoyoung-min Feb 2, 2024
0c32f94
Feat: 아이템 리스트 컴포넌트 및 상수 파일 추가
seoyoung-min Feb 2, 2024
256a656
Feat: FormProvider 활용 리스트 생성 페이지 추가 및 CreateItem 컴포넌트 구현
seoyoung-min Feb 2, 2024
fd60265
Feat: LinkModal 에러메시지 및 비활성화 기능 추가
seoyoung-min Feb 2, 2024
a0953a4
Design: LinkPreview 박스 커서 포인터 추가
seoyoung-min Feb 2, 2024
9b1b3be
Fix: LinkPreview 삭제 버튼 클릭시 링크 열리는 오류 수정
seoyoung-min Feb 2, 2024
df0c95a
Feat: 코멘트 글자수 초과시 입력 제한 기능 추가 및 타이틀 에러시 플레이스홀더 색상 변경 기능 추가
seoyoung-min Feb 2, 2024
d6f41f5
Fix: git pull merge 에러 해결
seoyoung-min Feb 3, 2024
02c79a0
Refactor: 리스트 생성 페이지 두 컴포넌트 합체
seoyoung-min Feb 3, 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
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
8 changes: 8 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ const nextConfig = {
});
return config;
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*',
},
],
},
};

module.exports = withVanillaExtract(nextConfig);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@
"axios": "^1.6.5",
"next": "14.0.4",
"react": "^18",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18",
"react-hook-form": "^7.49.3",
"react-hook-form": "^7.50.0",
"react-scripts": "^5.0.1",
"zustand": "^4.4.7"
},
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@testing-library/react-hooks": "^8.0.1",
Expand All @@ -48,6 +50,7 @@
"@types/jest": "^29.5.11",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.0.4",
Expand Down
3 changes: 3 additions & 0 deletions public/icons/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/icons/attach_image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/clear_x_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/clear_x_gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/dnd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/app/create/_components/AddItemButton.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { style } from '@vanilla-extract/css';

export const addButton = style({
width: '100%',
height: '60px',

display: 'flex',
justifyContent: 'center',
alignItems: 'center',
gap: '12px',

//body1
fontSize: '1.6rem',
fontWeight: '400',
lineHeight: '1.6rem',
letterSpacing: '-0.48px',
color: '#61646B',

backgroundColor: '#FFF',

border: 'solid 1px #AFB1B6 ',
borderRadius: '15px',
});
14 changes: 14 additions & 0 deletions src/app/create/_components/AddItemButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import AddIcon from '/public/icons/add.svg';
import * as styles from './AddItemButton.css';

interface AddItemButton {
handleAddButtonClick: () => void;
}

export default function AddItemButton({ handleAddButtonClick }: AddItemButton) {
return (
<button className={styles.addButton} type="button" onClick={handleAddButtonClick}>
<AddIcon /> 아이템 추가
</button>
);
}
71 changes: 71 additions & 0 deletions src/app/create/_components/CreateItem.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { style } from '@vanilla-extract/css';

export const header = style({
width: '100%',
height: '90px',
paddingLeft: '20px',
paddingRight: '20px',

position: 'sticky',
top: '0',
left: '0',
zIndex: '10',

display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',

backgroundColor: '#fff',

borderBottom: '1px solid rgba(0, 0, 0, 0.10)',
});

export const headerTitle = style({
fontSize: '2rem',
});

export const headerNextButton = style({
fontSize: '1.6rem',
backgroundColor: 'transparent',
});

export const headerNextButtonDisabled = style([
headerNextButton,
{
color: '#AFB1B6', //활성화 검정, 아닐때는 회색
},
]);

export const article = style({
padding: '16px 20px 30px',
});

//body1
export const label = style({
marginBottom: '1.6rem',

fontSize: '1.6rem',
fontWeight: '600',
letterSpacing: '-0.048rem',
});

export const required = style({
marginLeft: '6px',

fontSize: '1.6rem',
fontWeight: '500',
letterSpacing: '-0.048rem',
color: '#FF5454',
});

//body3
export const description = style({
marginBottom: '1.6rem',

fontSize: '1.4rem',
color: '#8A8A8E',
fontWeight: '400',
lineHeight: '2.5rem',
letterSpacing: '-0.042rem',
});
46 changes: 46 additions & 0 deletions src/app/create/_components/CreateItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useFormContext } from 'react-hook-form';

import BackIcon from '/public/icons/back.svg';
import Items from './Items';
import * as styles from './CreateItem.css';

interface CreateItemProps {
onBackClick: () => void;
}

export default function CreateItem({ onBackClick }: CreateItemProps) {
const {
formState: { isValid },
} = useFormContext();

return (
<div>
<div className={styles.header}>
<button onClick={onBackClick}>
<BackIcon alt="뒤로가기 버튼" />
</button>
<h1 className={styles.headerTitle}>리스트 생성</h1>
<button
onClick={() => {
console.log('제출');
}}
className={isValid ? styles.headerNextButton : styles.headerNextButtonDisabled}
disabled={!isValid ? true : false}
>
완료
</button>
</div>
<div className={styles.article}>
<h3 className={styles.label}>
아이템 추가 <span className={styles.required}>*</span>
</h3>

<p className={styles.description}>
최소 3개, 최대 10개까지 아이템을 추가할 수 있어요. <br />
아이템의 순서대로 순위가 정해져요.
</p>
<Items />
</div>
</div>
);
}
6 changes: 3 additions & 3 deletions src/app/create/_components/CreateList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface UserProfileType {
nickname: string;
}

function CreateList() {
function CreateList({ onNextClick }: { onNextClick: () => void }) {
const { register, getValues, setValue, setError, control, formState } = useFormContext();
const { errors, isValid } = formState;

Expand Down Expand Up @@ -63,9 +63,9 @@ function CreateList() {
<div className={styles.header}>
<CloseButton width={'24'} height={'24'} />
<h1 className={styles.headerTitle}>리스트 생성</h1>
<Link href="/" className={styles.headerNextButton}>
<button className={styles.headerNextButton} onClick={onNextClick}>
다음
</Link>
</button>
</div>

<div className={styles.body}>
Expand Down
76 changes: 76 additions & 0 deletions src/app/create/_components/ItemLayout.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { style } from '@vanilla-extract/css';

export const itemHeader = style({
width: '100%',

display: 'flex',
alignItems: 'center',
gap: '12px',

overflow: 'hidden',
});

export const rankAndTitle = style({
width: '100%',

display: 'flex',
gap: '8px',
});

export const line = style({
width: '100%',
margin: '0px',

border: 'solid 1px #AFB1B6',
});

export const moreInfo = style({
display: 'flex',
flexDirection: 'column',
gap: '8px',
});

export const toolbar = style({
width: '100%',

display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
});

export const fileButtons = style({
height: '18px',

display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '10px',
});

export const previewContainer = style({
display: 'flex',
gap: '10px',
});

export const previewBox = style({
width: '90px',
height: '90px',

display: 'flex',
justifyContent: 'center',
alignItems: 'center',

position: 'relative',

background: '#EBF4FF',

borderRadius: '10px',
whiteSpace: 'pre-wrap',
overflow: 'hidden',
});

export const clearButton = style({
position: 'absolute',
top: '5px',
right: '5px',
});
Loading