-
Notifications
You must be signed in to change notification settings - Fork 3
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
[adv-1단계] 송혜정 미션 제출합니다. #2
Open
Songhyejeong
wants to merge
2
commits into
greedy-team:Songhyejeong
Choose a base branch
from
Songhyejeong:step1
base: Songhyejeong
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.
+824
−20
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,27 @@ | ||
* { | ||
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; | ||
} | ||
This file contains 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,40 @@ | ||
|
||
import './App.css' | ||
import './App.css'; | ||
import { useState, useEffect } from 'react'; | ||
import Main from './components/main/main/Main'; | ||
import Aside from './components/aside/Aside'; | ||
import { getRestaurant } from './api/restaurant'; | ||
|
||
function App() { | ||
const [isModalOpen, setIsModalOpen] = useState(); | ||
const [isAddModalOpen, setIsAddModalOpen] = useState(false); | ||
const [selectedRestaurant, setSelectedRestaurant] = useState({ | ||
name: '', | ||
description: '', | ||
}); | ||
const [restaurantsList, setRestaurantsList] = useState([]); | ||
|
||
useEffect(() => { | ||
getRestaurant(setRestaurantsList); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
Code It.. | ||
</> | ||
) | ||
<div> | ||
<Main | ||
restaurantsList={restaurantsList} | ||
setIsModalOpen={setIsModalOpen} | ||
setSelectedRestaurant={setSelectedRestaurant} | ||
setIsAddModalOpen={setIsAddModalOpen} | ||
/> | ||
<Aside | ||
isModalOpen={isModalOpen} | ||
isAddModalOpen={isAddModalOpen} | ||
selectedRestaurant={selectedRestaurant} | ||
setIsModalOpen={setIsModalOpen} | ||
setIsAddModalOpen={setIsAddModalOpen} | ||
setRestaurantsList={setRestaurantsList} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file contains 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,26 @@ | ||
export const getRestaurant = async (setRestaurantsList) => { | ||
try { | ||
const response = await fetch('http://localhost:3000/restaurants'); | ||
const jsonData = await response.json(); | ||
|
||
if (response.ok) { | ||
setRestaurantsList(jsonData); | ||
} else { | ||
console.error('Failed to fetch restaurants:', response.statusText); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching restaurants:', error); | ||
} | ||
}; | ||
|
||
export const postRestaurant = async (newRestaurant) => { | ||
const response = await fetch('http://localhost:3000/restaurants', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify(newRestaurant), | ||
}); | ||
|
||
return response; | ||
}; |
Empty file.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
요구사항 명세에 아래처럼 나와있었어요. 그대로 잘 적용해주셨네요!
:root 에서 color styling선언을 통해 전역으로 색 해시값을 문자로 나타내게 할 수 있었는데요. 만약 이것을
styled-components
의 기능 중 하나를 사용해서 전역으로 선언할 수 있다면 어떤 기능을 사용하면 될까요? 🤔Note
힌트는 저희 스터디 시간에 공유했던 내용중에 있습니다! 답을 찾으신 후 시간이 괜찮으시다면 그걸 토대로 리팩토링해주셔도 되고 다음미션과 현생이슈로 할일이 너무 많다면 이대로 해주셔도 무방해요😆