-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: MenuCard, CategoryList UI 구성, React-Query 적용 (#7)
- Loading branch information
Showing
14 changed files
with
212 additions
and
47 deletions.
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import MenuType from "../../types/menu"; | ||
import { MenuType } from "../../types/menu"; | ||
|
||
export interface menuApi { | ||
getMenuList(): Promise<MenuType[]>; | ||
getCategoryMenuList(categoryIdx: number): Promise<MenuType[]>; | ||
} |
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 +1 @@ | ||
export const API_BASE_URL = "localhost:8080/api/v1"; | ||
export const API_BASE_URL = "http://localhost:8080/api/v1"; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { FC, useEffect, useState } from "react"; | ||
import { ApiClient } from "../../apis/apiClient"; | ||
import { MenuType } from "../../types/menu"; | ||
import { useSession } from "../../context/basketContext"; | ||
|
||
interface IProps { | ||
menuIdx: number; | ||
menuName: string; | ||
menuImage: string; | ||
menuPrice: number; | ||
} | ||
|
||
const Menu: FC<IProps> = ({ menuIdx, menuName, menuImage, menuPrice }) => { | ||
const { addBasket } = useSession(); | ||
|
||
return ( | ||
<div | ||
className="px-2 py-1 h-full" | ||
onClick={() => { | ||
alert("ㅎㅇ"); | ||
}} | ||
> | ||
<img className="rounded-lg w-32 h-32 cursor-pointer" src={menuImage} /> | ||
<div className="flex flex-col justify-between h-20"> | ||
<p className="font-medium text-left line-clamp-2 cursor-pointer"> | ||
{menuName} | ||
</p> | ||
<p className="font-medium inline-block text-left w-full cursor-pointer"> | ||
{menuPrice.toLocaleString() + "원"} | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Menu; |
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,14 @@ | ||
import { FC, useEffect, useState } from "react"; | ||
import { ApiClient } from "../../apis/apiClient"; | ||
import { MenuType } from "../../types/menu"; | ||
|
||
interface IProps { | ||
categoryIdx: number; | ||
categoryName: string; | ||
} | ||
|
||
const CategoryList: FC<IProps> = ({}) => { | ||
return <div></div>; | ||
}; | ||
|
||
export default CategoryList; |
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
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
Oops, something went wrong.