kávék lekérése
This commit is contained in:
1 parent
55ccd302a9
commit
237750bfef
3 files changed
+25
-4
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"start": "npx json-server coffees.json"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
function Coffee({coffee}) {
|
function Coffee({ coffee }) {
|
||||||
return (
|
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() {
|
function Coffees() {
|
||||||
|
const[coffees,setCoffees]=useState([]);
|
||||||
|
|
||||||
|
const getCoffees=()=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
getCoffees();
|
||||||
|
},[]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>Coffees</div>
|
<div>Coffees</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user