kávék lekérése
This commit is contained in:
1 parent
55ccd302a9
commit
237750bfef
3 files changed
+24
-3
No files matched your search
@@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"start": "npx json-server coffees.json"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
||||
@@ -2,7 +2,17 @@
|
||||
|
||||
function Coffee({ coffee }) {
|
||||
return (
|
||||
<div>Coffee</div>
|
||||
<div className="card w-96 bg-blue-200 card-md shadow-sm">
|
||||
<div className="card-body">
|
||||
<h2 className="card-title">{coffee.name}</h2>
|
||||
<p>Roast:{coffee.roast}</p>
|
||||
<p>Price:{coffee.price}</p>
|
||||
<div className="justify-end card-actions">
|
||||
<button className="btn btn-primary">Módosítás</button>
|
||||
<button className="btn btn-primary">Törlés</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
|
||||
import Coffee from "./Coffee"
|
||||
import { useState,useEffect } from "react"
|
||||
|
||||
function Coffees() {
|
||||
const[coffees,setCoffees]=useState([]);
|
||||
|
||||
const getCoffees=()=>{
|
||||
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
getCoffees();
|
||||
},[]);
|
||||
|
||||
return (
|
||||
<div>Coffees</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user