Skip to content

Commit 671106b

Browse files
committed
filters seem ok
1 parent b98d3bb commit 671106b

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

Diff for: src/App.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { BrowserRouter, Routes, Route } from "react-router-dom";
66
import "./i18n";
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();
@@ -18,8 +19,8 @@ function App() {
1819
</Headline>
1920
</Inset>
2021
<Routes>
21-
<Route path="/" element={<Home />} />
22-
{/* <Route path="/" element={<Restaurant />} /> */}
22+
<Route path="/home" element={<Home />} />
23+
{/* <Route path="/restaurat-detail" element={<RestaurantDetail />} /> */}
2324
</Routes>
2425
</BrowserRouter>
2526
</BentoProvider>

Diff for: src/components/RestaurantPreview.tsx

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
2-
import { Card, Stack, Title, Body, Label } from "@buildo/bento-design-system";
1+
import {
2+
Card,
3+
Stack,
4+
Title,
5+
Body,
6+
Label,
7+
Button,
8+
} from "@buildo/bento-design-system";
39
import { useTranslation } from "react-i18next";
10+
import { useNavigate } from "react-router-dom";
411

512
export interface PreviewProps {
613
name: string;
@@ -11,17 +18,24 @@ export interface PreviewProps {
1118

1219
function RestaurantPreview({ name, imageUrl, rating, address }: PreviewProps) {
1320
const { t } = useTranslation();
21+
const navigate = useNavigate();
1422
return (
15-
<Card elevation="small" borderRadius={8} paddingX={24} paddingY={40}>
16-
<Stack space={8}>
23+
<Card elevation="small" borderRadius={8} padding={16} paddingTop={24}>
24+
<Stack space={8} align={"center"}>
1725
<img src={imageUrl} width="70%" height="100%" />
1826
<Title size="medium">{name}</Title>
1927
<Body size="medium">
2028
{address}
2129
<Label size="small" color="default">
22-
{t('Card.Rating', { rating })}
30+
{t("Card.Rating", { rating })}
2331
</Label>
2432
</Body>
33+
<Button
34+
onPress={() => navigate("//restaurat-detail")}
35+
kind="transparent"
36+
label={t("Card.ButtonLabel")}
37+
hierarchy="primary"
38+
></Button>
2539
</Stack>
2640
</Card>
2741
);

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)