Advertisement
bac1lla

Untitled

Jun 2nd, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1.  
  2. export default function MenuItem ({meal, setModal}) {
  3. return (
  4. <button key={meal.id} style={styles.mealCard} onClick={() => setModal({visible: true, data: meal})}>
  5. <div style={{...styles.mealImg, backgroundImage: `url(${meal.img})`}}/>
  6. <div style={styles.mealInfo}>
  7. <span style={styles.cafeTitle}>{meal.name}</span>
  8. <strong style={styles.mealPrice}>{meal.price}&#8381;</strong>
  9. </div>
  10. </button>
  11. )
  12. }
  13.  
  14. const styles = {
  15. mealCard: {
  16. border: "none",
  17. background: "#fff",
  18. margin: 10,
  19. boxSizing: 'border-box',
  20. borderRadius: 16,
  21. boxShadow: '0 8px 8px 0 rgb(0 0 0 / 4%), 0px -2px 8px 0px rgb(0 0 0 / 4%)',
  22. width: 360,
  23. },
  24. mealImg: {
  25. height: 164,
  26. backgroundPosition: 'center',
  27. backgroundSize: 'contain',
  28. backgroundRepeat: 'no-repeat',
  29. borderRadius: "16px 16px 0px 0px",
  30. },
  31. mealInfo: {
  32. display: "flex",
  33. alignContent: "left",
  34. justifyContent: "space-between",
  35. margin: 20,
  36. },
  37. mealPrice: {
  38. fontSize: 22,
  39. fontWeight: 500,
  40. },
  41. cafeTitle: {
  42. fontSize: 22,
  43. fontWeight: 500,
  44. textAlign: "left",
  45. },
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement