Skip to content

DrinkDB is a React-based website that serves as a comprehensive drink catalog, powered by TheCocktailDB free drink api.

Notifications You must be signed in to change notification settings

neptoo/DrinksDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrinksDB 饮品数据库

Features

  • React Routes 路由

  • Error Page 自定义错误页面

  • Home Page:主页

    • search form: type the text and search what we get in database 搜索
    • a list of drinks, each drink will be respresent by the card 卡片式列表
  • SingleDrinkPage 单个饮品详情页

  • useCallback优化多次渲染的函数

    将fetchDrinks函数(从API根据关键词拉取数据)进行缓存,判断每次searchTerm这个依赖项是否改变,然后决定是否渲染

效果预览:

search page

detail page

error page

API

提供开放API的网页:https://www.thecocktaildb.com/api.php

用到的接口:

Search cocktail by name www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita

Lookup full cocktail details by id www.thecocktaildb.com/api/json/v1/1/lookup.php?i=11007

类似接口:The Meal DB

About

DrinkDB is a React-based website that serves as a comprehensive drink catalog, powered by TheCocktailDB free drink api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published