-
Notifications
You must be signed in to change notification settings - Fork 26
[ 김현화 ] sprint6 #120
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
The head ref may contain hidden characters: "React-\uAE40\uD604\uD654-sprint6"
[ 김현화 ] sprint6 #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,7 @@ dist-ssr | |
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
|
|
||
|
|
||
|
|
||
| .env | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| //axios instance | ||
|
|
||
| import axios from "axios"; | ||
| const BASE_URL=import.meta.env.VITE_PRODUCT_BASE_URL; | ||
| const instance=axios.create({ | ||
| baseURL: BASE_URL, | ||
| }); | ||
|
|
||
| export default instance; | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,11 +1,21 @@ | ||||
| import axios from "axios"; | ||||
| import instance from "./axios_instance"; | ||||
|
|
||||
| //베스트 상품 | ||||
| const BASE_URL = "https://panda-market-api.vercel.app/products?page="; | ||||
| export async function getProductBest({ pageSize = 4 }) { | ||||
| const BASE_URL = import.meta.env.VITE_PRODUCT_BASE_URL; | ||||
|
Collaborator
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. 이제 각 API 함수 파일들은
|
||||
| const BASE_URL = import.meta.env.VITE_PRODUCT_BASE_URL; |
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.
URLSearchParams를 사용하셨군요 ! 👍👍
훌륭합니다 ! 아무래도 문자열은 휴먼에러가 많이 발생할 수 밖에 없으므로 이렇게 처리해두시면 휴먼 에러를 줄이는 데에 분명 도움이 될거예요 😉
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| .formWrap { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 2.4rem 0; | ||
| padding: 1rem 0; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .inputGroup { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 1.6rem 0; | ||
| padding-bottom: 0.8rem; | ||
| } | ||
|
|
||
| .inputTitle { | ||
| font-size: var(--medium); | ||
| } | ||
|
|
||
| .inputBox { | ||
| display: flex; | ||
| align-items: center; | ||
| position: relative; | ||
| width: 100%; | ||
| height: fit-content; | ||
| background-color: var(--gray100); | ||
| border: 1px solid var(--gray50); | ||
| border-radius: 1.2rem; | ||
| -webkit-border-radius: 1.2rem; | ||
| -moz-border-radius: 1.2rem; | ||
| -ms-border-radius: 1.2rem; | ||
| -o-border-radius: 1.2rem; | ||
| } | ||
| .inputBox input:not([type=checkbox]) { | ||
| padding: 1.6rem 2.4rem 1.4rem; | ||
| flex: 1 1 0; | ||
| height: 5.6rem; | ||
| font-size: var(--common); | ||
| font-weight: 400; | ||
| outline: 0 none; | ||
| } | ||
| .inputBox input:not([type=checkbox]).err { | ||
| border: 1px solid var(--red) !important; | ||
| } | ||
| .inputBox input:not([type=checkbox]).focus { | ||
| border: 1px solid var(--blue200); | ||
| } | ||
| .inputBox input:not([type=checkbox])::placeholder { | ||
| font-size: inherit; | ||
| font-weight: 400; | ||
| color: var(--gray400); | ||
| } | ||
| .inputBox textarea { | ||
| padding: 1.6rem 2.4rem 1.4rem; | ||
| width: 100%; | ||
| height: 28.2rem; | ||
| line-height: 1.7; | ||
| font-size: var(--common); | ||
| font-weight: 400; | ||
| outline: 0 none; | ||
| } | ||
| .inputBox textarea::placeholder { | ||
| font-size: inherit; | ||
| font-weight: 400; | ||
| color: var(--gray400); | ||
| } | ||
|
|
||
| .imageFileGroup { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 1.6rem 2.4rem; | ||
| } | ||
| .imageFileGroup .box { | ||
| overflow: hidden; | ||
| display: flex; | ||
| justify-content: center; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| gap: 1.2rem 0; | ||
| position: relative; | ||
| width: 28.2rem; | ||
| height: 28.2rem; | ||
| font-weight: 400; | ||
| color: var(--gray400); | ||
| background-color: var(--gray100); | ||
| border-radius: 1.6rem; | ||
| -webkit-border-radius: 1.6rem; | ||
| -moz-border-radius: 1.6rem; | ||
| -ms-border-radius: 1.6rem; | ||
| -o-border-radius: 1.6rem; | ||
| cursor: pointer; | ||
| } | ||
| .imageFileGroup .box input { | ||
| display: none; | ||
| position: absolute; | ||
| } | ||
| .imageFileGroup .errorMessage { | ||
| width: 100%; | ||
| font-weight: 400; | ||
| color: var(--red); | ||
| } | ||
|
|
||
| input[type=file] { | ||
| overflow: hidden; | ||
| margin: -1px; | ||
| width: 0; | ||
| height: 0; | ||
| } | ||
| input[type=file]::file-selector-button { | ||
| display: none; | ||
| } | ||
|
|
||
| .imagePreview img { | ||
| width: auto; | ||
| height: 100%; | ||
| object-fit: cover; | ||
| } | ||
| .imagePreview .deleteButton { | ||
| z-index: 10; | ||
| position: absolute; | ||
| top: 1rem; | ||
| right: 1rem; | ||
| padding: 1rem; | ||
| font-size: var(--large); | ||
| color: var(--withe100); | ||
| } | ||
|
|
||
| @media all and (max-width: 74.9375rem) { | ||
| .imageFileGroup { | ||
| gap: 1.6rem 1rem; | ||
| } | ||
| .imageFileGroup .box { | ||
| width: 16.8rem; | ||
| height: 16.8rem; | ||
| } | ||
| .imagePreview .deleteButton { | ||
| top: 0.5rem; | ||
| right: 0.5rem; | ||
| } | ||
| } | ||
| @media all and (max-width: 47.9375rem) { | ||
| .imageFileGroup { | ||
| gap: 1.6rem 1rem; | ||
| } | ||
| .imageFileGroup .box { | ||
| width: calc(50% - 0.5rem); | ||
| max-width: 16.8rem; | ||
| } | ||
| } | ||
| .tagWrap { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 1.4rem 0; | ||
| }/*# sourceMappingURL=form.module.css.map */ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
굿굿 ~! Axios를 사용하셨군요 ! 👍
또한 Base URL을 환경 변수로 설정하셨네요 ! 훌륭합니다.
이제 현화님의 프로덕트는 환경에 유연하게 대처할 수 있는 프로덕트로 거듭났네요 👍👍