forked from woowapark/self-paced-react
-
Notifications
You must be signed in to change notification settings - Fork 24
[1단계 미션] 신석민 미션 제출합니다. #48
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
seokmin111
wants to merge
1
commit into
cho-log:seokmin111
Choose a base branch
from
seokmin111:seokmin111
base: seokmin111
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.
Open
Changes from all commits
Commits
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,303 @@ | ||
| * { | ||
| padding: 0; | ||
| margin: 0; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| ul, | ||
| li { | ||
| list-style: none; | ||
| } | ||
|
|
||
| html, | ||
| body { | ||
| font-family: sans-serif; | ||
| font-size: 16px; | ||
| } | ||
|
|
||
| /* Colors *****************************************/ | ||
| :root { | ||
| --primary-color: #ec4a0a; | ||
| --lighten-color: #f6a88a; | ||
| --grey-100: #ffffff; | ||
| --grey-200: #d0d5dd; | ||
| --grey-300: #667085; | ||
| --grey-400: #344054; | ||
| --grey-500: #000000; | ||
| } | ||
|
|
||
| /* Typography *************************************/ | ||
| .text-title { | ||
| font-size: 20px; | ||
| line-height: 24px; | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| .text-subtitle { | ||
| font-size: 18px; | ||
| line-height: 28px; | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| .text-body { | ||
| font-size: 16px; | ||
| line-height: 24px; | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| .text-caption { | ||
| font-size: 14px; | ||
| line-height: 20px; | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| /* Header ********************************************/ | ||
| .gnb { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| height: 64px; | ||
|
|
||
| padding: 0 16px; | ||
|
|
||
| background-color: var(--primary-color); | ||
| } | ||
|
|
||
| .gnb__title { | ||
| color: #fcfcfd; | ||
| } | ||
|
|
||
| .gnb__button { | ||
| height: 40px; | ||
|
|
||
| border: none; | ||
| border-radius: 8px; | ||
| background: transparent; | ||
|
|
||
| font-size: 24px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .gnb__button img { | ||
| display: block; | ||
| width: 40px; | ||
| height: 40px; | ||
| object-fit: contain; | ||
| } | ||
|
|
||
| /* 음식점 목록 *****************************************/ | ||
|
|
||
| /* 카테고리/정렬 필터 */ | ||
| .restaurant-filter-container { | ||
| display: flex; | ||
| justify-content: space-between; | ||
|
|
||
| padding: 0 16px; | ||
| margin-top: 24px; | ||
| } | ||
|
|
||
| .restaurant-filter-container select { | ||
| height: 44px; | ||
| min-width: 125px; | ||
|
|
||
| border: 1px solid #d0d5dd; | ||
| border-radius: 8px; | ||
| background: transparent; | ||
|
|
||
| font-size: 16px; | ||
| } | ||
|
|
||
| .restaurant-filter { | ||
| padding: 8px; | ||
| } | ||
|
|
||
| /* 음식점 목록 */ | ||
| .restaurant-list-container { | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| padding: 0 16px; | ||
| margin: 16px 0; | ||
| } | ||
|
|
||
| .restaurant { | ||
| display: flex; | ||
| align-items: flex-start; | ||
|
|
||
| padding: 16px 8px; | ||
|
|
||
| border-bottom: 1px solid #e9eaed; | ||
| } | ||
|
|
||
| .restaurant__category { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| width: 64px; | ||
| height: 64px; | ||
| min-width: 64px; | ||
| min-height: 64px; | ||
|
|
||
| margin-right: 16px; | ||
|
|
||
| border-radius: 50%; | ||
| background: var(--lighten-color); | ||
| } | ||
|
|
||
| .category-icon { | ||
| width: 36px; | ||
| height: 36px; | ||
| } | ||
|
|
||
| .restaurant__info { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: flex-start; | ||
| } | ||
|
|
||
| .restaurant__name { | ||
| margin: 0; | ||
| } | ||
|
|
||
| .restaurant__distance { | ||
| color: var(--primary-color); | ||
| } | ||
|
|
||
| .restaurant__description { | ||
| display: -webkit-box; | ||
|
|
||
| padding-top: 8px; | ||
|
|
||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| -webkit-line-clamp: 2; | ||
| -webkit-box-orient: vertical; | ||
| } | ||
|
|
||
| /* 음식점 정보/추가 모달 *****************************************/ | ||
| .modal { | ||
| display: none; | ||
| } | ||
|
|
||
| .modal--open { | ||
| display: block; | ||
| } | ||
|
|
||
| .modal-backdrop { | ||
| position: fixed; | ||
| top: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| left: 0; | ||
|
|
||
| background: rgba(0, 0, 0, 0.35); | ||
| } | ||
|
|
||
| .modal-container { | ||
| position: fixed; | ||
| bottom: 0; | ||
| width: 100%; | ||
|
|
||
| padding: 32px 16px; | ||
|
|
||
| border-radius: 8px 8px 0px 0px; | ||
| background: var(--grey-100); | ||
| } | ||
|
|
||
| .modal-title { | ||
| margin-bottom: 36px; | ||
| } | ||
|
|
||
| .form-item { | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| margin-bottom: 36px; | ||
| } | ||
|
|
||
| .form-item label { | ||
| color: var(--grey-400); | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .form-item--required label::after { | ||
| padding-left: 4px; | ||
|
|
||
| color: var(--primary-color); | ||
| content: "*"; | ||
| } | ||
|
|
||
| .form-item .help-text { | ||
| color: var(--grey-300); | ||
| } | ||
|
|
||
| .form-item input, | ||
| .form-item textarea, | ||
| .form-item select { | ||
| padding: 8px; | ||
| margin: 6px 0; | ||
|
|
||
| border: 1px solid var(--grey-200); | ||
| border-radius: 8px; | ||
|
|
||
| font-size: 16px; | ||
| } | ||
|
|
||
| .form-item textarea { | ||
| resize: none; | ||
| } | ||
|
|
||
| .form-item select { | ||
| height: 44px; | ||
|
|
||
| padding: 8px; | ||
|
|
||
| border: 1px solid var(--grey-200); | ||
| border-radius: 8px; | ||
|
|
||
| color: var(--grey-300); | ||
| } | ||
|
|
||
| input[name="name"], | ||
| input[name="link"] { | ||
| height: 44px; | ||
| } | ||
|
|
||
| .button-container { | ||
| display: flex; | ||
| } | ||
|
|
||
| .button { | ||
| width: 100%; | ||
| height: 44px; | ||
|
|
||
| margin-right: 16px; | ||
|
|
||
| border: none; | ||
| border-radius: 8px; | ||
|
|
||
| font-weight: 600; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .button:last-child { | ||
| margin-right: 0; | ||
| } | ||
|
|
||
| .button--secondary { | ||
| border: 1px solid var(--grey-300); | ||
| background: transparent; | ||
|
|
||
| color: var(--grey-300); | ||
| } | ||
|
|
||
| .button--primary { | ||
| background: var(--primary-color); | ||
|
|
||
| color: var(--grey-100); | ||
| } | ||
|
|
||
| .restaurant-info { | ||
| margin-bottom: 24px; | ||
| } | ||
|
|
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,23 @@ | ||
| import "./App.css"; | ||
|
|
||
| import Header from "./assets/components/Header.jsx"; | ||
| import CategoryFilter from "./assets/components/CategoryFilter.jsx"; | ||
| import RestaurantList from "./assets/components/RestaurantList.jsx"; | ||
| function App() { | ||
| return <h1>Self-Paced React</h1>; | ||
| return ( | ||
| <div> | ||
| {/* GNB */} | ||
| <Header /> | ||
|
|
||
| <main> | ||
| {/* 카테고리/정렬 필터 */} | ||
| <CategoryFilter /> | ||
|
|
||
| {/* 음식점 목록 */} | ||
| <RestaurantList /> | ||
| </main> | ||
|
|
||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default 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,55 @@ | ||
| {/* 음식점 정보 모달 */} | ||
| <div class="modal modal--open"> | ||
| <div class="modal-backdrop"></div> | ||
| <div class="modal-container"> | ||
| <h2 class="modal-title text-title">음식점 이름</h2> | ||
| <div class="restaurant-info"> | ||
| <p class="restaurant-info__description text-body">음식점 소개 문구</p> | ||
| </div> | ||
| {/* 닫기 버튼 */} | ||
| <div class="button-container"> | ||
| <button class="button button--primary text-caption">닫기</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* 음식점 추가 모달 */} | ||
| <div class="modal modal--open"> | ||
| <div class="modal-backdrop"></div> | ||
| <div class="modal-container"> | ||
| <h2 class="modal-title text-title">새로운 음식점</h2> | ||
| <form> | ||
| {/* 카테고리 */} | ||
| <div class="form-item form-item--required"> | ||
| <label for="category text-caption">카테고리</label> | ||
| <select name="category" id="category" required> | ||
| <option value="">선택해 주세요</option> | ||
| <option value="한식">한식</option> | ||
| <option value="중식">중식</option> | ||
| <option value="일식">일식</option> | ||
| <option value="양식">양식</option> | ||
| <option value="아시안">아시안</option> | ||
| <option value="기타">기타</option> | ||
| </select> | ||
| </div> | ||
|
|
||
| {/* 음식점 이름 */} | ||
| <div class="form-item form-item--required"> | ||
| <label for="name text-caption">이름</label> | ||
| <input type="text" name="name" id="name" required /> | ||
| </div> | ||
|
|
||
| {/* 설명 */} | ||
| <div class="form-item"> | ||
| <label for="description text-caption">설명</label> | ||
| <textarea name="description" id="description" cols="30" rows="5"></textarea> | ||
| <span class="help-text text-caption">메뉴 등 추가 정보를 입력해 주세요.</span> | ||
| </div> | ||
|
|
||
| {/* 추가 버튼 */} | ||
| <div class="button-container"> | ||
| <button class="button button--primary text-caption">추가하기</button> | ||
| </div> | ||
| </form> | ||
|
Comment on lines
+21
to
+53
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. The form is missing an onSubmit handler. Add an onSubmit handler to the form to handle the submission of the new restaurant data. Also, consider adding onChange handlers to the input fields to manage the form data. |
||
| </div> | ||
| </div> | ||
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.
The modal is currently always open due to the
modal--openclass. This should be controlled by a state variable to allow for dynamic opening and closing. Consider usinguseStatehook to manage the modal's visibility.