Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: 🐛 Bug Report
about: 버그를 보고합니다
title: "[Bug] "
labels: bug
assignees: ''
---

## 🐞 버그 설명
- 버그에 대해 간단히 설명해주세요.

## ✅ 재현 방법
- 버그를 재현하려면 다음 단계를 따르세요:
1. [예: 페이지 이동 경로]
2. [예: 특정 버튼 클릭]
3. [예: 기대되는 결과]

## 🖥 환경 정보
- OS: [Windows, macOS, Linux 등]
- Browser: [Chrome, Firefox 등]
- Version: [앱/브라우저 버전]

## 📸 스크린샷
- 버그를 보여주는 스크린샷을 추가해주세요 (필요한 경우).
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: ✨ Feature Request
about: 새로운 기능을 요청합니다
title: "[Feature] "
labels: enhancement
assignees: ''
---

## 🌟 기능 설명
- 추가하고 싶은 기능이나 변경 사항을 간략히 설명해주세요.

## 🤔 이유
- 이 기능이 왜 필요한지, 어떤 문제를 해결하는지 설명해주세요.

## 📋 추가 정보
- 기능과 관련된 참고 자료나 추가 정보를 포함해주세요.
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 📋 요약
- 이 Pull Request의 목적과 주요 변경 사항을 간략히 설명해주세요.

## 🛠 변경 사항
- 이번 Pull Request에서 작업한 주요 변경 사항은 다음과 같습니다:
- [x] 새로운 기능 추가 또는 버그 수정
- [x] 코드 리팩토링 또는 최적화
- [x] 문서 업데이트

## 🔗 관련 이슈
- 이 PR로 해결되는 이슈: #[이슈 번호]
- 관련된 이슈: #[이슈 번호]

## 📸 스크린샷 또는 GIF (해당되는 경우)
- UI 변경이 있는 경우 변경 사항을 보여주는 스크린샷이나 GIF를 추가해주세요.

## ✅ 체크리스트
- [ ] 코드가 정상적으로 동작하는지 테스트했습니다.
- [ ] 관련 문서를 작성하거나 업데이트했습니다. (해당되는 경우)
- [ ] 변경 사항을 반영한 테스트 코드를 추가했습니다.
- [ ] 모든 테스트가 성공적으로 통과했습니다.

## 🛡 테스트 방법
- 변경 사항을 확인하기 위한 테스트 방법을 단계별로 작성해주세요:
1. 브랜치를 로컬로 가져옵니다.
2. 아래 명령어를 사용해 애플리케이션 또는 테스트를 실행합니다:
```
# 예시 명령어
./run_tests.sh
```
3. 예상 동작이나 출력 결과를 확인합니다.

## 📚 추가 참고 사항
- 이 PR과 관련해 리뷰어가 알아야 할 추가 내용이 있다면 작성해주세요.
34 changes: 20 additions & 14 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { BrowserRouter, Routes, Route } from "react-router-dom"
import Layout from "./pages/layouts/Layout"
import Ingredient from "./pages/ingredient/Ingregdient"
import Recipe from "./pages/recipe/Recipe"
import {AddRecipe} from "./pages/recipe/AddRecipe"
import UsersIngredientItem from "./components/ingredient/UsersIngredientItem"

function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Layout/>}>
<Route path="ingredient">
<Route index element={<Ingredient/>}/>
{/* <Route path=':ingredientMyRefrigeratorPk' element={<UsersIngredientItem/>} /> */}
</Route>
</Route>
</Routes>
</BrowserRouter>
)
}
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Layout/>}>
<Route path="ingredient">
<Route index element={<Ingredient/>}/>
{/* <Route path=':ingredientMyRefrigeratorPk' element={<UsersIngredientItem/>} /> */}
</Route>
<Route path="recipe" >
<Route index element={<Recipe/>} />
<Route path='create' element={<AddRecipe/>} />
</Route>
</Route>

export default App
</Routes>
</BrowserRouter>
)
}
export default App
Binary file added src/assets/image/noimage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
40 changes: 40 additions & 0 deletions src/pages/recipe/Recipe.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useEffect, useState,useCallback } from "react"
import { getRecipeList } from "../../sources/api/recipeAPI.jsx";
import {Route, useNavigate} from "react-router-dom";
import { AddRecipe} from "./addRecipe.jsx";

function Recipe() {
const [recipeList, setRecipeList] = useState([])
const navigate = useNavigate();

useEffect(() => {
const fetchRecipes = async () => {
try {
const data = await getRecipeList();
setRecipeList(data); // 상태 업데이트
console.log(recipeList); // 가져온 데이터 확인
} catch (err) {
console.error(err);
}
};

fetchRecipes(); // 비동기 작업 호출
}, []);

const handleAdd = useCallback(() => {
navigate("/recipe/create");
},[navigate])

return (
<>
<h1>레시피 페이지</h1>
<ul>
<li>
<button onClick={handleAdd}>add button</button>
</li>
</ul>
</>
)
}

export default Recipe
Loading