Skip to content

Commit b8d4b04

Browse files
committed
filters seem ok
1 parent 00d7abf commit b8d4b04

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

Diff for: src/App.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { BentoProvider, Headline, Inset } from "@buildo/bento-design-system";
66
import { BrowserRouter, Routes, Route } from "react-router-dom";
77
import { useTranslation } from "react-i18next";
88
import Home from "./pages/Home";
9+
// import RestaurantDetail from "./pages/RestaurantDetail";
910

1011
function App() {
1112
const { t } = useTranslation();
@@ -19,8 +20,8 @@ function App() {
1920
</Headline>
2021
</Inset>
2122
<Routes>
22-
<Route path="/" element={<Home />} />
23-
{/* <Route path="/" element={<Restaurant />} /> */}
23+
<Route path="/home" element={<Home />} />
24+
{/* <Route path="/restaurat-detail" element={<RestaurantDetail />} /> */}
2425
</Routes>
2526
</BrowserRouter>
2627
</BentoProvider>

Diff for: src/components/RestaurantPreview.tsx

+15-9
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import {
44
Title,
55
Body,
66
Label,
7-
Box,
7+
Button,
88
} from "@buildo/bento-design-system";
99
import { useTranslation } from "react-i18next";
1010
import { PreviewProp } from "../models";
11+
import { useNavigate } from "react-router-dom";
1112

1213
function RestaurantPreview(props: PreviewProp) {
1314
const { t } = useTranslation();
@@ -17,20 +18,25 @@ function RestaurantPreview(props: PreviewProp) {
1718
? "https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Barbieri_-_ViaSophia25668.jpg/1200px-Barbieri_-_ViaSophia25668.jpg"
1819
: props.imageUrl;
1920

21+
const navigate = useNavigate();
2022
return (
21-
<Card elevation="small" borderRadius={8} paddingX={24} paddingY={40}>
22-
<Stack space={8}>
23-
<Box height="full" justifyContent="center" alignItems="center">
24-
<img src={imagePrev} width="70%" height="100px" />
25-
</Box>
26-
27-
<Title size="small">{props.name}</Title>
28-
<Body size="small">
23+
<Card elevation="small" borderRadius={8} padding={16} paddingTop={24}>
24+
<Stack space={8} align={"center"}>
25+
<img src={imagePrev} width="70%" height="100%" />
26+
<Title size="medium">{props.name}</Title>
27+
<Body size="medium">
2928
{props.address}
29+
3030
<Label size="small" color="default">
3131
{t("Card.Rating", { rating })}
3232
</Label>
3333
</Body>
34+
<Button
35+
onPress={() => navigate("//restaurat-detail")}
36+
kind="transparent"
37+
label={t("Card.ButtonLabel")}
38+
hierarchy="primary"
39+
></Button>
3440
</Stack>
3541
</Card>
3642
);

Diff for: src/locales/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"title": "YelpLike",
33
"Card": {
4-
"Rating": "Rating: {{rating}} ★"
4+
"Rating": "Rating: {{rating}} ★",
5+
"ButtonLabel":"See details"
56
},
67
"priceRangefilter":"Filter by average price : ",
78
"Location":{

0 commit comments

Comments
 (0)