diff --git a/android/app/src/main/java/org/fuzue/seasonfood/MainActivity.java b/android/app/src/main/java/org/fuzue/seasonfood/MainActivity.java new file mode 100644 index 0000000..0660a9d --- /dev/null +++ b/android/app/src/main/java/org/fuzue/seasonfood/MainActivity.java @@ -0,0 +1,5 @@ +package org.fuzue.seasonfood; + +import com.getcapacitor.BridgeActivity; + +public class MainActivity extends BridgeActivity {} diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png index fbbea25..8d7dec5 100644 Binary files a/public/android-chrome-192x192.png and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png index 0514421..bc10269 100644 Binary files a/public/android-chrome-512x512.png and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index d48756f..b5fac61 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png index 7cfa709..3eb7cd6 100644 Binary files a/public/favicon-16x16.png and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png index 5102ab3..c47027b 100644 Binary files a/public/favicon-32x32.png and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 60959a0..e009f75 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index b32f7a8..d78dd54 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -12,6 +12,9 @@ "FoodPage_inSeasonText": "Currently in season", "FoodPage_checkMonths": "Check below when it's best to buy it.", "FoodPage_monthsInSeason": "Months in season", + "SideBarList_aboutApp": "About the app", + "SideBarList_contribute": "Contribute", + "SideBarList_contact": "Contact us", "backButton": "back", "month_0": "January", "month_1": "February", diff --git a/public/locales/it/translation.json b/public/locales/it/translation.json index 3e50fbe..61c8580 100644 --- a/public/locales/it/translation.json +++ b/public/locales/it/translation.json @@ -12,6 +12,9 @@ "FoodPage_inSeasonText": "Attualmente è in stagione", "FoodPage_checkMonths": "controllate qui sotto quando è meglio acquistarlo.", "FoodPage_monthsInSeason": "Mesi di stagione", + "SideBarList_aboutApp": "Informazione sull'app", + "SideBarList_contribute": "Contribuisci", + "SideBarList_contact": "Contattaci", "backButton": "indietro", "month_0": "Gennaio", "month_1": "Febbraio", diff --git a/src/components/HeaderBar.tsx b/src/components/HeaderBar.tsx index c1fff77..a4c1c29 100644 --- a/src/components/HeaderBar.tsx +++ b/src/components/HeaderBar.tsx @@ -1,16 +1,16 @@ import type { FoodList, FoodObject } from "../types/food"; -import Fuse from 'fuse.js' -import { useRef, useEffect } from "react" +import Fuse from "fuse.js"; +import { useRef, useEffect } from "react"; import i18next from "i18next"; import { useTranslation } from "react-i18next"; import { Menu, Search } from "@mui/icons-material"; import { AppBar, styled, - alpha, Toolbar, IconButton, - InputBase + InputBase, + Box, } from "@mui/material"; type Props = { @@ -45,17 +45,23 @@ export default function HeaderBar(props: Props) { const options = { threshold: 0.3, keys: [ - { name: 'name-en', getFn: (food: FoodObject) => food.description[0].name }, - { name: 'name-it', getFn: (food: FoodObject) => food.description[1].name } - ] - } + { + name: "name-en", + getFn: (food: FoodObject) => food.description[0].name, + }, + { + name: "name-it", + getFn: (food: FoodObject) => food.description[1].name, + }, + ], + }; - const fuse = new Fuse(food, options) - const searchText = query.current.value.trim().toLowerCase() - const searchLanguage: { [lang: string]: string } = {} - searchLanguage["name-" + i18next.language] = searchText + const fuse = new Fuse(food, options); + const searchText = query.current.value.trim().toLowerCase(); + const searchLanguage: { [lang: string]: string } = {}; + searchLanguage["name-" + i18next.language] = searchText; - return fuse.search(searchLanguage).map((i) => i.item) + return fuse.search(searchLanguage).map((i) => i.item); }; function leftButton() { @@ -72,20 +78,6 @@ export default function HeaderBar(props: Props) { ); } - const SearchBar = styled("div")(({ theme }) => ({ - position: "relative", - borderRadius: theme.shape.borderRadius, - backgroundColor: alpha(theme.palette.common.white, 0.15), - "&:hover": { - backgroundColor: alpha(theme.palette.common.white, 0.25), - }, - "&:focus": { - backgroundColor: alpha(theme.palette.common.white, 0.25), - }, - marginLeft: "auto", - width: "auto", - })); - const SearchIconWrapper = styled("div")(() => ({ height: "100%", aspectRatio: 1, @@ -114,7 +106,12 @@ export default function HeaderBar(props: Props) { {leftButton()} - +
handleSubmit(e)}> -
+
); } - diff --git a/src/components/Item.tsx b/src/components/Item.tsx index e679958..9ac08a1 100644 --- a/src/components/Item.tsx +++ b/src/components/Item.tsx @@ -35,7 +35,7 @@ function Item(props: FoodObject) { top={0} fontSize="max(1rem, min(4.5vw, 3rem))" fontWeight={400} - sx={{ p: "0.25em", transform: "translateY(-20%)" }} + sx={{ p: "0.25em", transform: "translateY(-20%)", overflow: "hidden", textOverflow: "ellipsis" }} > {t(props.description[0].name)} diff --git a/src/components/RenderFoods.tsx b/src/components/RenderFoods.tsx index 4791575..582292c 100644 --- a/src/components/RenderFoods.tsx +++ b/src/components/RenderFoods.tsx @@ -14,9 +14,9 @@ interface RenderFoodProps { //render the grid of foods const RenderFoods:FunctionComponent = (props:RenderFoodProps) => { const foodList = props.foodList - const foodItems = foodList.map((item ) => { + const foodItems = foodList.map((item, key) => { return ( - + ); }); return ( diff --git a/src/components/SearchResult.tsx b/src/components/SearchResult.tsx index 692e53b..953f867 100644 --- a/src/components/SearchResult.tsx +++ b/src/components/SearchResult.tsx @@ -41,6 +41,7 @@ function SearchResult(props: Props) { maxWidth="md" open={ifSearched} onClose={closeModal} + onClick={closeModal} aria-labelledby="search results" aria-describedby="the results of your search are shown here" TransitionComponent={Transition} @@ -51,7 +52,6 @@ function SearchResult(props: Props) { sx={{ml: "auto" }} edge="start" color="inherit" - onClick={closeModal} aria-label="close" > diff --git a/src/components/SideBarList.tsx b/src/components/SideBarList.tsx index 2fd0fd4..f2d5bd0 100644 --- a/src/components/SideBarList.tsx +++ b/src/components/SideBarList.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import SelectLang from "./SelectLang"; /* MUI IMPORTS */ import { @@ -9,6 +10,8 @@ import { } from "@mui/material"; export default function SideBarList(props: any) { + const { t } = useTranslation(); + return ( - SEASONAL FOOD 🇮🇹 + SEASON FOOD 🇮🇹 props.handleClickOpen("about")}> - about the app + {t("SideBarList_aboutApp")} props.handleClickOpen("contribute")}> - contribute + {t("SideBarList_contribute")} props.handleClickOpen("contact")}> - contact us + {t("SideBarList_contact")} diff --git a/src/routes/FoodPage.tsx b/src/routes/FoodPage.tsx index a0d53a4..5eb89cd 100644 --- a/src/routes/FoodPage.tsx +++ b/src/routes/FoodPage.tsx @@ -31,7 +31,7 @@ export default function FoodPage() { if (selectedFood && selectedFood.season[i] === true) { seasonMonths.push(months[i]); seasonStatus = "FoodPage_notInSeasonText"; - if (seasonMonths.includes(months[currentMonth])) { + if (seasonMonths.includes(months[currentMonth - 1])) { seasonStatus = "FoodPage_inSeasonText"; } }