web client v0.10 (restaurant view)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import Pictograms from "./Pictograms";
|
||||
import { fetchRestaurant } from "../../actions";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { getTodayHours } from "../../Services.js";
|
||||
|
||||
function extractTags(tags) {
|
||||
var results = [];
|
||||
@@ -15,12 +15,12 @@ function extractTags(tags) {
|
||||
}
|
||||
|
||||
export default function CardRestaurant(props) {
|
||||
const dispatch = useDispatch();
|
||||
const history = useHistory();
|
||||
const img = props.imgUrl;
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={() => dispatch(fetchRestaurant(props.id))}
|
||||
onClick={() => history.push(`/restaurant/${props.id}`)}
|
||||
className="card-restaurant"
|
||||
>
|
||||
<div
|
||||
@@ -32,7 +32,7 @@ export default function CardRestaurant(props) {
|
||||
<h1>{props.name}</h1>
|
||||
<hr />
|
||||
<h3>Miasto: {props.city}</h3>
|
||||
<h3>Otwarte: {props.hours}</h3>
|
||||
<h3>Dziś otwarte: {getTodayHours(props.hours)}</h3>
|
||||
</div>
|
||||
<div className="card-description">
|
||||
<p>{props.description}</p>
|
||||
|
||||
Reference in New Issue
Block a user