-
Notifications
You must be signed in to change notification settings - Fork 29
[최일우] sprint6 #113
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
Open
2ruuuu
wants to merge
11
commits into
codeit-bootcamp-frontend:React-최일우
Choose a base branch
from
2ruuuu:React-최일우-sprint6
base: React-최일우
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
The head ref may contain hidden characters: "React-\uCD5C\uC77C\uC6B0-sprint6"
Open
[최일우] sprint6 #113
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8ac2221
chore: 린터 설정 및 env baseURL 설정
2ruuuu 16499d5
refactor: 로딩 상태값 부모 컴포넌트에서 처리
2ruuuu 62fed24
refactor: DropDown 공통 컴포넌트로 리팩토링
2ruuuu 9cc0ea2
chore: 프리티어 설정
2ruuuu 4e3e69a
chore: husky 설정
2ruuuu c361efc
design: global css 필요한 팔레트 추가
2ruuuu bc8e5c6
design: svg 추가
2ruuuu c92f5c5
feat: 필요 컴포넌트 제작
2ruuuu e70d880
feat: 네브바 useLocation 활용
2ruuuu 2a3e89f
design: 네브바 반응형 작업
2ruuuu 6b0b4fa
feat: 상품 등록 페이지
2ruuuu 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 hidden or 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 @@ | ||
| VITE_BASE_URL=https://panda-market-api.vercel.app |
This file contains hidden or 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,6 @@ | ||
| { | ||
| "trailingComma": "es5", | ||
| "tabWidth": 2, | ||
| "semi": true, | ||
| "singleQuote": true | ||
| } |
This file contains hidden or 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,55 @@ | ||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
| import js from '@eslint/js'; | ||
| import globals from 'globals'; | ||
| import reactHooks from 'eslint-plugin-react-hooks'; | ||
| import reactRefresh from 'eslint-plugin-react-refresh'; | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| export default [ | ||
| { ignores: ['dist', 'node_modules'] }, | ||
| { | ||
| files: ['**/*.{js,jsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| reactHooks.configs.flat.recommended, | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2021, | ||
| ...globals.node, | ||
| }, | ||
| parserOptions: { | ||
| ecmaVersion: 'latest', | ||
| ecmaFeatures: { jsx: true }, | ||
| sourceType: 'module', | ||
| }, | ||
| }, | ||
| plugins: { | ||
| 'react-hooks': reactHooks, | ||
| 'react-refresh': reactRefresh, | ||
| }, | ||
| rules: { | ||
| 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], | ||
| // 1. 리액트 권장 규칙 | ||
| ...js.configs.recommended.rules, | ||
| ...reactHooks.configs.recommended.rules, | ||
|
|
||
| // 2. Vite 전용 규칙 (HMR 유지용) | ||
| 'react-refresh/only-export-components': [ | ||
| 'warn', | ||
| { allowConstantExport: true }, | ||
| ], | ||
|
|
||
| // 3. 실무형 커스텀 규칙 | ||
| 'no-unused-vars': [ | ||
| 'warn', | ||
| { | ||
| varsIgnorePattern: '^[A-Z_]', // 대문자로 시작하는 변수(컴포넌트 등) 무시 | ||
| argsIgnorePattern: '^_', // _로 시작하는 인자 무시 | ||
| }, | ||
| ], | ||
| 'no-console': 'warn', // 배포 전 console.log 체크용 | ||
|
|
||
| // 4. Prettier와 싸우지 않기 위한 설정 | ||
| // 스타일 관련은 에러를 내지 않고 Prettier가 알아서 하게 둡니다. | ||
| indent: 'off', | ||
| quotes: 'off', | ||
| semi: 'off', | ||
| 'comma-dangle': 'off', | ||
| }, | ||
| }, | ||
| ]) | ||
| ]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,7 +1,8 @@ | ||
| import axios from "axios"; | ||
| // src/apis/axiosInstance.js | ||
| import axios from 'axios'; | ||
|
|
||
| const axiosInstance = axios.create({ | ||
| baseURL: "https://panda-market-api.vercel.app", | ||
| baseURL: import.meta.env.VITE_BASE_URL, | ||
| }); | ||
|
|
||
| export default axiosInstance; |
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 hidden or 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,77 @@ | ||
| import styled from 'styled-components'; | ||
| import Tag from './Tag'; | ||
|
|
||
| const AddItemInput = ({ | ||
| children, | ||
| height = 'short', | ||
| placeholder, | ||
| handleTagAdd, | ||
| tag, | ||
| handleTagDelete, | ||
| name, | ||
| value, | ||
| onChange, | ||
| }) => { | ||
| const isLong = height === 'long'; | ||
| const tagInput = children === '태그'; | ||
|
|
||
| return ( | ||
| <InputContainer> | ||
| <Label>{children}</Label> | ||
| <Input | ||
| name={name} | ||
| as={isLong ? 'textarea' : 'input'} | ||
| $height={height} | ||
| placeholder={placeholder} | ||
| onKeyDown={tagInput ? handleTagAdd : null} | ||
| value={value} | ||
| onChange={onChange} | ||
| /> | ||
| {tagInput ? ( | ||
| <TagContainer> | ||
| {tag.map((title) => ( | ||
| <Tag key={title} handleTagDelete={handleTagDelete} tag={tag}> | ||
| {title} | ||
| </Tag> | ||
| ))} | ||
| </TagContainer> | ||
| ) : null} | ||
| </InputContainer> | ||
| ); | ||
| }; | ||
|
|
||
| export default AddItemInput; | ||
|
|
||
| const InputContainer = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 16px; | ||
| margin-bottom: 24px; | ||
| `; | ||
|
|
||
| const Label = styled.label` | ||
| font-weight: 700; | ||
| font-size: 18px; | ||
| line-height: 26px; | ||
| `; | ||
|
|
||
| const Input = styled.input` | ||
| border-radius: 12px; | ||
| padding: 16px 24px; | ||
| border: none; | ||
| color: var(--secondary-800); | ||
| background-color: var(--coolGray-100); | ||
| height: ${({ $height }) => ($height === 'long' ? '282px' : '56px')}; | ||
| outline: none; | ||
|
|
||
| &::placeholder { | ||
| color: var(--secondary-400); | ||
| } | ||
| `; | ||
|
|
||
| const TagContainer = styled.div` | ||
| display: flex; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| gap: 12px; | ||
| `; |
This file contains hidden or 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 hidden or 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 hidden or 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,7 +1,24 @@ | ||
| import styles from "./Button.module.css"; | ||
| import styled from 'styled-components'; | ||
|
|
||
| const Button = ({children}) => { | ||
| return <div className={styles.button}>{children}</div>; | ||
| const Button = ({ children, type = 'button', isActive = false }) => { | ||
| return ( | ||
| <ButtonS type={type} $isActive={isActive}> | ||
| {children} | ||
| </ButtonS> | ||
| ); | ||
| }; | ||
|
|
||
| export default Button; | ||
|
|
||
| const ButtonS = styled.button` | ||
| background-color: ${({ $isActive }) => | ||
| $isActive ? 'var(--primary-100)' : 'var(--coolGray-400)'}; | ||
| color: var(--coolGray-100); | ||
| padding: 12px 23px; | ||
| border-radius: 10px; | ||
| font-weight: 600; | ||
| font-size: 16px; | ||
| line-height: 26px; | ||
| white-space: nowrap; | ||
| flex-shrink: 0; | ||
| `; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,12 +1,17 @@ | ||
| import styles from "./DropDown.module.css"; | ||
| import styles from './DropDown.module.css'; | ||
|
|
||
| const DropDown = ({handleProductsSort}) => { | ||
| const DropDown = ({ handleProductsSort, children }) => { | ||
| return ( | ||
| <select className={styles.select} onChange={handleProductsSort}> | ||
| <option value="recent">최신순</option> | ||
| <option value="favorite">좋아요순</option> | ||
| {children} | ||
| </select> | ||
| ); | ||
| }; | ||
|
|
||
| const Option = ({ value, children }) => { | ||
| return <option value={value}>{children}</option>; | ||
| }; | ||
|
|
||
| DropDown.Option = Option; | ||
|
|
||
| export default DropDown; |
This file contains hidden or 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,67 @@ | ||
| import styled from 'styled-components'; | ||
| import plusIcon from '../assets/plus.svg'; | ||
| import ImgBox from './ImgBox'; | ||
|
|
||
| const ImageRegistration = ({ | ||
| name, | ||
| handleImageRegis, | ||
| preview, | ||
| handleImageDelete, | ||
| handleErrorMessage, | ||
| }) => { | ||
| return ( | ||
| <Container> | ||
| <Label htmlFor="imageRegist"> | ||
| <img src={plusIcon} alt="이미지 추가 아이콘" /> | ||
| <P>이미지 등록</P> | ||
| </Label> | ||
| <HiddenInput | ||
| id="imageRegist" | ||
| name={name} | ||
| type="file" | ||
| onChange={handleImageRegis} | ||
| onClick={handleErrorMessage} | ||
| /> | ||
| <ImgBox preview={preview} handleImageDelete={handleImageDelete} /> | ||
| </Container> | ||
| ); | ||
| }; | ||
|
|
||
| export default ImageRegistration; | ||
|
|
||
| const Container = styled.div` | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 24px; | ||
|
|
||
| @media (max-width: 1199px) { | ||
| gap: 10px; | ||
| } | ||
| `; | ||
|
|
||
| const Label = styled.label` | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| background-color: var(--secondary-100); | ||
| width: 282px; | ||
| height: 282px; | ||
| border-radius: 12px; | ||
| cursor: pointer; | ||
|
|
||
| @media (max-width: 1199px) { | ||
| width: 168px; | ||
| height: 168px; | ||
| } | ||
| `; | ||
|
|
||
| const HiddenInput = styled.input` | ||
| display: none; | ||
| `; | ||
|
|
||
| const P = styled.p` | ||
| font-weight: 400; | ||
| line-height: 26px; | ||
| color: var(--coolGray-400); | ||
| `; |
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.
AddItemInput 에서 모든 프롭으로 넘기는 부분입니다!