-
-
-
-
-
-
{t(`month_${monthNum}`)}
-
-
-
-
-
-
- {t('FoodOfTheMonth_fruitsNumber', { count: num_fruits, fruits: num_fruits})
- + ' ' + t('FoodOfTheMonth_veggiesNumber', { count: num_veggies, veggies: num_veggies})}
-
-
-
-
handleChange(e, value)}
- sx={{ fontWeight: 700 }}
- aria-label="tabs for the selection of fruits, vegetables or others"
- >
-
-
-
+
+
+
+
+
+ {t(`month_${monthNum}`)}
-
-
-
+
+
+
+
+
handleChange(value)}
+ variant="fullWidth"
+ sx={{ fontWeight: 700 }}
+ aria-label="tabs for the selection of fruits, vegetables or others"
+ >
+
+
+ {t("FoodOfTheMonth_fruitsTabText")}
+
+ }
+ value="Fruits"
+ />
+
+
+ {t("FoodOfTheMonth_vegetablesTabText")}
+
+ }
+ value="Veggies"
+ />
+
+
+
);
-
}
-
diff --git a/src/routes/FoodPage.tsx b/src/routes/FoodPage.tsx
index 1c83ef8..c26d66c 100644
--- a/src/routes/FoodPage.tsx
+++ b/src/routes/FoodPage.tsx
@@ -1,7 +1,7 @@
import { currentMonth } from "../utils/utils";
import { useParams, useNavigate, Link } from "react-router-dom";
import { useEffect } from "react";
-import { Box, Typography, Grid } from "@mui/material";
+import { Box, Typography, Stack } from "@mui/material";
import { styled } from "@mui/material/styles";
import { useTranslation } from "react-i18next";
import { FoodDBContext } from "../contexts/FoodDB"
@@ -65,43 +65,33 @@ export default function FoodPage() {
}));
const ImgBox = styled(Box)(() => ({
- objectFit: "cover",
- margin: "1em",
- width: "40%",
- maxHeight: "160px",
+ position: "relative",
+ overflow: "hidden",
+ width: "8rem",
+ height: "8rem",
+ borderRadius: "1rem",
+ boxShadow: "3px 4px 8px #888888"
}));
const renderMonths = () => {
return months.map((month) => {
let userNumber = Number(month) + 1
return (
-
+ sx={{...monthColor(month), m: 1}}>
{t(`month_${month}`)}
-
);
});
}
return (
-
+
@@ -113,27 +103,28 @@ export default function FoodPage() {
alignItems="left"
justifyContent="center"
width="50%">
- {/* typescript problem */}
- {t(selectedFood?selectedFood.description[0].name:'FOOD NOT FOUND')}:
+ {/* typescript problem */}
+ {t(selectedFood?selectedFood.description[0].name:'FOOD NOT FOUND')}
{t(seasonStatus)}
-
+
{/* BOTTOM GRID WITH MONTHS */}
-
+ {/*
{t('FoodPage_monthsInSeason')}
-
- */}
+
{renderMonths()}
-
+
);
diff --git a/src/routes/Layout.tsx b/src/routes/Layout.tsx
index 563ff76..29fa429 100644
--- a/src/routes/Layout.tsx
+++ b/src/routes/Layout.tsx
@@ -38,25 +38,13 @@ const theme = createTheme({
main: "#ff7664", //red
dark: "#4071d8", //blue
},
- },
- breakpoints: {
- values: {
- xs: 450,
- sm: 600,
- md: 900,
- lg: 1200,
- xl: 1536,
- },
- },
+ }
});
function Layout({ food }: { food: FoodList }) {
const MainBox = styled(Box)(() => ({
width: "100%",
- maxWidth: "450px",
display: "flex",
- alignItems: "center",
- justifyContent: "center",
margin: "0 auto",
paddingBottom: "1em",
minHeight: "100%",
@@ -84,7 +72,7 @@ function Layout({ food }: { food: FoodList }) {
const lngs = {
en: { nativeName: "English" },
it: { nativeName: "Italiano" },
- } as { [key: string]: any };
+ } as { [key: string]: { nativeName: string } };
const SelectLang = (
@@ -97,7 +85,7 @@ function Layout({ food }: { food: FoodList }) {
onChange={(event: SelectChangeEvent) => i18n.changeLanguage(event.target.value)}
>
{Object.keys(lngs).map((lng) => (
-
+
))}