diff --git a/next-i18next.config.js b/next-i18next.config.js index 2380ae7..83ed78d 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -1,6 +1,6 @@ module.exports = { i18n: { defaultLocale: "en", - locales: ["en", "ar", "tr"], + locales: ["en", "tr"], }, }; diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json deleted file mode 100644 index e089509..0000000 --- a/public/locales/ar/common.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "test": "مرحبا" -} diff --git a/public/locales/en/addmeal.json b/public/locales/en/addmeal.json new file mode 100644 index 0000000..876c70c --- /dev/null +++ b/public/locales/en/addmeal.json @@ -0,0 +1,14 @@ +{ + "fried-chips": "Fried Chips", + "dietary": "Dietary", + "vegeterian": "Vegetarian", + "vegan": "Vegan", + "gluten-free": "Gluten free", + "ingredients": "Ingredients", + "tomatoes": "Tomatoes", + "delivery": "Delivery in", + "price": "Price", + "howmuch": "$30", + "time": "30 min", + "save": "Save" +} diff --git a/public/locales/en/cards.json b/public/locales/en/cards.json new file mode 100644 index 0000000..db5f59a --- /dev/null +++ b/public/locales/en/cards.json @@ -0,0 +1,7 @@ +{ + "card-title": "You've missed homemade food?", + "card-subtitle": "Pick your favorite chef, food or cuisine.", + "card1-text": "order the food and get it when you want", + "card2-text": "Get a 15% discount for your first order!", + "card2-btn": "Order Now" +} diff --git a/public/locales/en/create-account.json b/public/locales/en/create-account.json new file mode 100644 index 0000000..4ee292e --- /dev/null +++ b/public/locales/en/create-account.json @@ -0,0 +1,18 @@ +{ + "create-account": "Create an Account", + "firstname": "First Name", + "lastname": "Last Name", + "password": "Password", + "email": "Email", + "area-code": "Area Code", + "phone": "Phone Number", + "adress": "Adress", + "zip-code": "ZIP Code", + "city": "City", + "country": "Country", + "terms-conditions": "I agree to Terms and Conditions ", + "cancel": "Cancel", + "have-account": "Already Have An Account?", + "register-btn": "Register", + "signin": "Sign In" +} diff --git a/public/locales/en/edit-account.json b/public/locales/en/edit-account.json new file mode 100644 index 0000000..2519a43 --- /dev/null +++ b/public/locales/en/edit-account.json @@ -0,0 +1,7 @@ +{ + "account": "Edit Account", + "phone-num": "Phone Number", + "old-password": "Old Password", + "new-password": "New Password", + "save-btn": "Save" +} diff --git a/public/locales/en/footer.json b/public/locales/en/footer.json new file mode 100644 index 0000000..1ef96d2 --- /dev/null +++ b/public/locales/en/footer.json @@ -0,0 +1,11 @@ +{ + "help": "Get help", + "chef": "Become a chef", + "promotions": "Promotions", + "about": "About Cookiez", + "chef-around": " Chefs near me", + "view-foods": "View all home made foods", + "view-cities": "View all cities", + "view-chefs": "View all chefs", + "copyright": "Cookiez Copyright 2022" +} diff --git a/public/locales/en/hero.json b/public/locales/en/hero.json new file mode 100644 index 0000000..708dceb --- /dev/null +++ b/public/locales/en/hero.json @@ -0,0 +1,6 @@ +{ + "title": " Fast delivery, delicious and cheaper", + "subtitle": "Find your favorite food and order in seconds", + "placeholder": "Enter a food name or location", + "search-button": "Find" +} diff --git a/public/locales/en/landing-meals.json b/public/locales/en/landing-meals.json new file mode 100644 index 0000000..13280eb --- /dev/null +++ b/public/locales/en/landing-meals.json @@ -0,0 +1,6 @@ +{ + "search": "Search", + "categories": "Categories", + "spanish-paella": "Spanish Paella", + "price": "$6" +} diff --git a/public/locales/en/navbar.json b/public/locales/en/navbar.json new file mode 100644 index 0000000..cbc511b --- /dev/null +++ b/public/locales/en/navbar.json @@ -0,0 +1,9 @@ +{ + "signup": "Sign Up", + "login": "Login", + "add-new-food": " Add a new food", + "dashboard": "Dashboard", + "account-settings": "Account Settings", + "logout": "Logout", + "name": "{{name}}" +} diff --git a/public/locales/en/order.json b/public/locales/en/order.json new file mode 100644 index 0000000..d4237e4 --- /dev/null +++ b/public/locales/en/order.json @@ -0,0 +1,24 @@ +{ + "orders": "Orders", + "settings": "Payment settings", + "reviews": "Customer reviews", + "total": "Total orders", + "revenue": "Revenue", + "popular": "Popular orders", + "filter": "Filter", + "search": "Search by food name", + "date-btn": "Date range", + "status-btn": "Status", + "payment-btn": "Payment method", + "ref": "Ref.", + "date": "DATE", + "customer": "CUSTOMER", + "food": "FOOD", + "status": "STATUS", + "payment": "PAYMENT", + "price": "PRICE", + "fried-chips": "Fried Chips", + "sausage": "Sausage", + "preparing": "Preparing", + "credit-card": "Credit Card" +} diff --git a/public/locales/en/profile.json b/public/locales/en/profile.json new file mode 100644 index 0000000..24c043b --- /dev/null +++ b/public/locales/en/profile.json @@ -0,0 +1,8 @@ +{ + "profile": "Profile", + "listed-foods": "Listed foods", + "orders": "Orders", + "payment-settings": "Payment settings", + "edit-profile": "Edit profile", + "logout": "Logout" +} diff --git a/public/locales/en/search-cities.json b/public/locales/en/search-cities.json new file mode 100644 index 0000000..ce34973 --- /dev/null +++ b/public/locales/en/search-cities.json @@ -0,0 +1,5 @@ +{ + "title": "Places where Cookiez is available", + "text": "We are currently providing services for limited cities. We plan to expand services across whole country very soon.Enter a city name", + "placeholder": "Enter a city name" +} diff --git a/public/locales/tr/addmeal.json b/public/locales/tr/addmeal.json new file mode 100644 index 0000000..906b1ef --- /dev/null +++ b/public/locales/tr/addmeal.json @@ -0,0 +1,14 @@ +{ + "fried-chips": "Kızarmış Patates", + "dietary": "Diyet", + "vegeterian": "Vejeteryan", + "vegan": "Vegan", + "gluten-free": "Glutensiz", + "ingredients": "Malzemeler", + "tomatoes": "Domates", + "delivery": "Teslimat", + "price": "Fiyat", + "howmuch": "3 tl", + "time": "30 dk", + "save": "Kaydet" +} diff --git a/public/locales/tr/cards.json b/public/locales/tr/cards.json new file mode 100644 index 0000000..6d3891b --- /dev/null +++ b/public/locales/tr/cards.json @@ -0,0 +1,7 @@ +{ + "card-title": "Ev yapımı yemekleri özlemedin mi?", + "card-subtitle": "Favori şefini, yemeğini veya mutfağını seç", + "card1-text": "Şefini seç ,yemeğini sipariş et ve anında kapında olsun", + "card2-text": "İlk siparişinde %15 indirimi kap!", + "card2-btn": "Sipariş Ver" +} diff --git a/public/locales/tr/create-account.json b/public/locales/tr/create-account.json new file mode 100644 index 0000000..eebbd5c --- /dev/null +++ b/public/locales/tr/create-account.json @@ -0,0 +1,18 @@ +{ + "create-account": "Hesap Oluştur", + "firstname": "İsim", + "lastname": "Soyisim", + "password": "Şifre", + "email": "Mail Adresi", + "adress": "Adres", + "area-code": "Alan Kodu", + "phone": "Telefon Numarası", + "zip-code": "Posta Kodu", + "city": "Şehir", + "country": "Ülke", + "terms-conditions": "Hüküm ve Koşulları kabul ediyorum ", + "cancel": "İptal", + "have-account": "Hesabın Var Mı?", + "register-btn": "Kayıt Ol", + "signin": "Giriş Yap" +} diff --git a/public/locales/tr/edit-account.json b/public/locales/tr/edit-account.json new file mode 100644 index 0000000..3deeb93 --- /dev/null +++ b/public/locales/tr/edit-account.json @@ -0,0 +1,7 @@ +{ + "account": "Hesap Yenileme", + "phone-num": "Telefon Numarası", + "old-password": "Eski Şifre", + "new-password": "Yeni Şifre", + "save-btn": "Kaydet" +} diff --git a/public/locales/tr/footer.json b/public/locales/tr/footer.json new file mode 100644 index 0000000..351ac91 --- /dev/null +++ b/public/locales/tr/footer.json @@ -0,0 +1,11 @@ +{ + "help": "Yardım al", + "chef": "Şef ol", + "promotions": "Promosyonlar", + "about": "Cookiez hakkında", + "chef-around": "Yakınlarımdaki şefler ", + "view-foods": "Tüm ev yapımı yemekleri görüntüle", + "view-cities": "Tüm şehirleri görüntüle", + "view-chefs": "Tüm şefleri görüntüle", + "copyright": "Cookiez Copyright 2022" +} diff --git a/public/locales/tr/hero.json b/public/locales/tr/hero.json new file mode 100644 index 0000000..0259bb9 --- /dev/null +++ b/public/locales/tr/hero.json @@ -0,0 +1,6 @@ +{ + "title": "Lezzetli, ucuz ve hızlı teslimat", + "subtitle": "Favori yemeğini bul ve saniyeler içinde sipariş et", + "placeholder": "Yemek ismi veya konumunu gir", + "search-button": "Ara" +} diff --git a/public/locales/tr/landing-meals.json b/public/locales/tr/landing-meals.json new file mode 100644 index 0000000..be72243 --- /dev/null +++ b/public/locales/tr/landing-meals.json @@ -0,0 +1,6 @@ +{ + "search": "Ara", + "categories": "Kategoriler", + "spanish-paella": "İspanyol Paella", + "price": "60 tl" +} diff --git a/public/locales/tr/navbar.json b/public/locales/tr/navbar.json new file mode 100644 index 0000000..979400d --- /dev/null +++ b/public/locales/tr/navbar.json @@ -0,0 +1,9 @@ +{ + "signup": "Kayıt OL", + "login": "Giriş Yap", + "add-new-food": " Yeni Yemek Ekle", + "dashboard": "Profil", + "account-settings": "Hesap Ayarları", + "logout": "Çıkış", + "name": "{{isim}}" +} diff --git a/public/locales/tr/order.json b/public/locales/tr/order.json new file mode 100644 index 0000000..8ba0766 --- /dev/null +++ b/public/locales/tr/order.json @@ -0,0 +1,25 @@ +{ + "orders": "Siparişler", + "payment-settings": "Ödeme ayarları", + "customer-reviews": "Müşteri yorumları", + "logout": "Çıkış", + "total": "Toplam siparişler", + "revenue": "Kazanç", + "popular": "Popüler siparişler", + "filter": "Filtrele", + "search": "Yemek ismiyle ara", + "date-btn": "Tarih aralığı", + "status-btn": "Sipariş durumu", + "payment-btn": "Ödeme yöntemi", + "ref": "Referans", + "date": "Tarih", + "customer": "Müşteri", + "food": "Yemek", + "status": "Sipariş durumu", + "payment": "Ödeme", + "price": "Fiyat", + "fried-chips": "Kızarmış Patates", + "sausage": "Sosis", + "preparing": "Hazırlanıyor", + "credit-card": "Kredi Kartı" +} diff --git a/public/locales/tr/profile.json b/public/locales/tr/profile.json new file mode 100644 index 0000000..d79f56d --- /dev/null +++ b/public/locales/tr/profile.json @@ -0,0 +1,8 @@ +{ + "profile": "Profil", + "listed-foods": "Listelenmiş Yemekler", + "orders": "Siparişler", + "payment-settings": "Ödeme Ayarları", + "edit-profile": "Profili Düzenle", + "logout": "Çıkış" +} diff --git a/public/locales/tr/search-cities.json b/public/locales/tr/search-cities.json new file mode 100644 index 0000000..6f1f604 --- /dev/null +++ b/public/locales/tr/search-cities.json @@ -0,0 +1,5 @@ +{ + "title": "Cookiez'in hizmet verdiği yerler", + "text": "Şuan sınırlı şehirde hizmet veriyoruz. Yakında tüm ülkede hizmet vermeyi planlıyoruz.", + "placeholder": "Bir şehir ismi gir" +} diff --git a/src/components/AddMeal/AddMeal.jsx b/src/components/AddMeal/AddMeal.jsx index 96d76b0..5ea1680 100644 --- a/src/components/AddMeal/AddMeal.jsx +++ b/src/components/AddMeal/AddMeal.jsx @@ -1,6 +1,8 @@ +import { useTranslation } from "next-i18next"; import { useState } from "react"; import { HiPlusCircle } from "react-icons/hi"; import { IoAddCircleOutline, IoTrashBinOutline } from "react-icons/io5"; + export default function AddMeal() { const [mealImage, setMealImage] = useState("../images/header.jpg"); const [mealName, setMealName] = useState(""); @@ -37,6 +39,8 @@ export default function AddMeal() { isGlutenFree(!glutenFree); glutenFree ? setDietary([...dietary, "gluten free"]) : null; } + const { t } = useTranslation("addmeal"); + return (
-

Dietary

+

{t("dietary")}

-

Ingredients

+

{t("ingredients")}

setIngredient(e.target.value)} @@ -173,19 +181,21 @@ export default function AddMeal() { ))}
-

Delivery in

+

{t("delivery")}

setDeliveryMin(e.target.value)} > -

Price

+

{t("price")}

setPrice(e.target.value)} > @@ -195,7 +205,7 @@ export default function AddMeal() { }} className=' absolute bottom-80 right-0 mr-2 rounded bg-[#004945] px-6 py-1 text-white' > - Save + {t("save")}
); diff --git a/src/components/AddMeal/__test__/AddMeal.test.jsx b/src/components/AddMeal/AddMeal.test.jsx similarity index 56% rename from src/components/AddMeal/__test__/AddMeal.test.jsx rename to src/components/AddMeal/AddMeal.test.jsx index ad0e4e5..d19ae61 100644 --- a/src/components/AddMeal/__test__/AddMeal.test.jsx +++ b/src/components/AddMeal/AddMeal.test.jsx @@ -1,9 +1,10 @@ +import React from "react"; import renderer from "react-test-renderer"; -import AddMeal from "../AddMeal"; +import AddMeal from "@/components/AddMeal/AddMeal"; -// eslint-disable-next-line no-undef -it("renders correctly", () => { +// eslint-disable-next-line +it("Dashboard Component", () => { const tree = renderer.create().toJSON(); // eslint-disable-next-line no-undef expect(tree).toMatchSnapshot(); diff --git a/src/components/AddMeal/__test__/__snapshots__/AddMeal.test.jsx.snap b/src/components/AddMeal/__snapshots__/AddMeal.test.jsx.snap similarity index 94% rename from src/components/AddMeal/__test__/__snapshots__/AddMeal.test.jsx.snap rename to src/components/AddMeal/__snapshots__/AddMeal.test.jsx.snap index 8338425..93d434e 100644 --- a/src/components/AddMeal/__test__/__snapshots__/AddMeal.test.jsx.snap +++ b/src/components/AddMeal/__snapshots__/AddMeal.test.jsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders correctly 1`] = ` +exports[`Dashboard Component 1`] = `
@@ -60,7 +60,7 @@ exports[`renders correctly 1`] = ` - Dietary + + dietary

    - Vegetarian + vegeterian
@@ -113,7 +114,7 @@ exports[`renders correctly 1`] = `
- Vegan + vegan
@@ -135,7 +136,7 @@ exports[`renders correctly 1`] = `
- Gluten Free + gluten-free
@@ -144,7 +145,7 @@ exports[`renders correctly 1`] = `

- Ingredients + ingredients

@@ -197,30 +198,32 @@ exports[`renders correctly 1`] = `

- Delivery in + delivery

- Price + price

`; diff --git a/src/components/Cards/Cards.jsx b/src/components/Cards/Cards.jsx index c0d7dc2..78dc7d0 100644 --- a/src/components/Cards/Cards.jsx +++ b/src/components/Cards/Cards.jsx @@ -1,15 +1,19 @@ import Image from "next/image"; +import { useTranslation } from "next-i18next"; + const Cards = () => { + const { t } = useTranslation("cards"); + return (
{/* title part */}

- You’ve missed home made food? + {t("card-title")}

- Pick your favorite chef, food or cousin. + {t("card-subtitle")}

@@ -26,8 +30,7 @@ const Cards = () => { />
- Pick your chef order the food and get it when - you want + {t("card1-text")}
{

- Get a 15% discount for your first order! + {t("card2-text")}{" "}

diff --git a/src/components/Cards/__test__/Cards.test.jsx b/src/components/Cards/Cards.test.jsx similarity index 74% rename from src/components/Cards/__test__/Cards.test.jsx rename to src/components/Cards/Cards.test.jsx index ab49e5f..9a02285 100644 --- a/src/components/Cards/__test__/Cards.test.jsx +++ b/src/components/Cards/Cards.test.jsx @@ -1,10 +1,10 @@ import React from "react"; import renderer from "react-test-renderer"; -import Cards from "../Cards"; +import Cards from "@/components/Cards/Cards"; // eslint-disable-next-line -it("renders correctly", () => { +it("Dashboard Component", () => { const tree = renderer.create().toJSON(); // eslint-disable-next-line no-undef expect(tree).toMatchSnapshot(); diff --git a/src/components/Cards/__test__/__snapshots__/Cards.test.jsx.snap b/src/components/Cards/__snapshots__/Cards.test.jsx.snap similarity index 98% rename from src/components/Cards/__test__/__snapshots__/Cards.test.jsx.snap rename to src/components/Cards/__snapshots__/Cards.test.jsx.snap index 23f9002..fb84442 100644 --- a/src/components/Cards/__test__/__snapshots__/Cards.test.jsx.snap +++ b/src/components/Cards/__snapshots__/Cards.test.jsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders correctly 1`] = ` +exports[`Dashboard Component 1`] = `
@@ -13,12 +13,12 @@ exports[`renders correctly 1`] = `

- You’ve missed home made food? + card-title

- Pick your favorite chef, food or cousin. + card-subtitle

- Pick your chef order the food and get it when you want + card1-text
- Get a 15% discount for your first order! + card2-text +

diff --git a/src/components/EditAccount/EditAccount.jsx b/src/components/EditAccount/EditAccount.jsx index ccccf09..640423e 100644 --- a/src/components/EditAccount/EditAccount.jsx +++ b/src/components/EditAccount/EditAccount.jsx @@ -1,4 +1,5 @@ import Image from "next/image"; +import { useTranslation } from "next-i18next"; import { useState } from "react"; import { BiUserCircle } from "react-icons/bi"; @@ -7,6 +8,8 @@ export default function EditAccount() { const [oldPass, setOldPass] = useState(""); const [newPass, setNewPass] = useState(""); + const { t } = useTranslation("edit-account"); + // return EditPage component return ( <> @@ -15,7 +18,7 @@ export default function EditAccount() { {/* icon */}
-

Edit Your Account

+

{t("account")}

{/* image, fields */} @@ -38,7 +41,7 @@ export default function EditAccount() { className='rounded border text-sm font-bold leading-tight text-gray-700 shadow focus:outline-none' id='phoneNum' type='text' - placeholder='Phone Number' + placeholder={t("phone-num")} value={phoneNum} onChange={(event) => setPhoneNum(event.target.value) @@ -49,7 +52,7 @@ export default function EditAccount() { className='rounded border text-sm font-bold leading-tight text-gray-700 shadow focus:outline-none' id='oldPass' type='password' - placeholder='Old Password' + placeholder={t("old-password")} value={oldPass} onChange={(event) => setOldPass(event.target.value) @@ -60,7 +63,7 @@ export default function EditAccount() { className='rounded border text-sm font-bold leading-tight text-gray-700 shadow focus:outline-none' id='newPass' type='password' - placeholder='New Password' + placeholder={t("new-password")} value={newPass} onChange={(event) => setNewPass(event.target.value) @@ -68,7 +71,7 @@ export default function EditAccount() { /> {/* save button */}
diff --git a/src/components/EditAccount/__test__/EditAccount.test.jsx b/src/components/EditAccount/EditAccount.test.jsx similarity index 54% rename from src/components/EditAccount/__test__/EditAccount.test.jsx rename to src/components/EditAccount/EditAccount.test.jsx index 26c15b1..a498264 100644 --- a/src/components/EditAccount/__test__/EditAccount.test.jsx +++ b/src/components/EditAccount/EditAccount.test.jsx @@ -1,10 +1,11 @@ +import React from "react"; import renderer from "react-test-renderer"; -import EditAccount from "../EditAccount"; +import EditAccount from "./EditAccount"; // eslint-disable-next-line -it("Edit Account Component", () => { +it("Dashboard Component", () => { const tree = renderer.create().toJSON(); - // eslint-disable-next-line + // eslint-disable-next-line no-undef expect(tree).toMatchSnapshot(); }); diff --git a/src/components/EditAccount/__test__/__snapshots__/EditAccount.test.jsx.snap b/src/components/EditAccount/__snapshots__/EditAccount.test.jsx.snap similarity index 96% rename from src/components/EditAccount/__test__/__snapshots__/EditAccount.test.jsx.snap rename to src/components/EditAccount/__snapshots__/EditAccount.test.jsx.snap index 6f6e9fd..7722057 100644 --- a/src/components/EditAccount/__test__/__snapshots__/EditAccount.test.jsx.snap +++ b/src/components/EditAccount/__snapshots__/EditAccount.test.jsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Edit Account Component 1`] = ` +exports[`Dashboard Component 1`] = `
@@ -31,7 +31,7 @@ exports[`Edit Account Component 1`] = `

- Edit Your Account + account

@@ -180,7 +180,7 @@ exports[`Edit Account Component 1`] = ` className="rounded border text-sm font-bold leading-tight text-gray-700 shadow focus:outline-none" id="oldPass" onChange={[Function]} - placeholder="Old Password" + placeholder="old-password" type="password" value="" /> @@ -188,14 +188,14 @@ exports[`Edit Account Component 1`] = ` className="rounded border text-sm font-bold leading-tight text-gray-700 shadow focus:outline-none" id="newPass" onChange={[Function]} - placeholder="New Password" + placeholder="new-password" type="password" value="" />
diff --git a/src/components/Footer/Footer.jsx b/src/components/Footer/Footer.jsx index 09f33e4..80dc5de 100644 --- a/src/components/Footer/Footer.jsx +++ b/src/components/Footer/Footer.jsx @@ -1,7 +1,9 @@ import Link from "next/link"; +import { useTranslation } from "next-i18next"; import { BsFacebook, BsInstagram, BsTwitter } from "react-icons/bs"; const Footer = () => { + const { t } = useTranslation("footer"); return ( <>
- Cookiez Copyright 2022 + {t("copyright")}
diff --git a/src/components/Footer/Footer.test.jsx b/src/components/Footer/Footer.test.jsx new file mode 100644 index 0000000..d413854 --- /dev/null +++ b/src/components/Footer/Footer.test.jsx @@ -0,0 +1,11 @@ +import React from "react"; +import renderer from "react-test-renderer"; + +import Footer from "./Footer"; + +// eslint-disable-next-line +it("Dashboard Component", () => { + const tree = renderer.create(
).toJSON(); + // eslint-disable-next-line no-undef + expect(tree).toMatchSnapshot(); +}); diff --git a/src/components/Footer/__snapshots__/Footer.test.jsx.snap b/src/components/Footer/__snapshots__/Footer.test.jsx.snap new file mode 100644 index 0000000..36c89e2 --- /dev/null +++ b/src/components/Footer/__snapshots__/Footer.test.jsx.snap @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Dashboard Component 1`] = ` + +`; diff --git a/src/components/Hero/Hero.jsx b/src/components/Hero/Hero.jsx index 9dbd1d5..0c46fe8 100644 --- a/src/components/Hero/Hero.jsx +++ b/src/components/Hero/Hero.jsx @@ -1,18 +1,18 @@ +import { useTranslation } from "next-i18next"; import { useEffect, useState } from "react"; function Hero() { const [search, setSearch] = useState(""); + const { t } = useTranslation("hero"); - useEffect(() => { - console.log(search); - }, [search]); + useEffect(() => {}, [search]); return (

- Fast delivery, delicious and cheaper + {t("title")}

@@ -21,19 +21,19 @@ function Hero() { setSearch(e.target.value)} value={search} />
- Find your favorite home made food and order in seconds + {t("subtitle")}
diff --git a/src/components/Hero/__snapshots__/Hero.test.jsx.snap b/src/components/Hero/__snapshots__/Hero.test.jsx.snap index d806109..9cc0c41 100644 --- a/src/components/Hero/__snapshots__/Hero.test.jsx.snap +++ b/src/components/Hero/__snapshots__/Hero.test.jsx.snap @@ -1,47 +1,34 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Hero Component 1`] = ` -

- Home made - - - healthy - - - food + title

-
- Find your favorite food and order in seconds -
@@ -50,13 +37,18 @@ exports[`Hero Component 1`] = ` className="search-btn" >
+
+ subtitle +
-
+ `; diff --git a/src/components/LandingMeals/LandingMeals.jsx b/src/components/LandingMeals/LandingMeals.jsx index 8876b61..51ba6bf 100644 --- a/src/components/LandingMeals/LandingMeals.jsx +++ b/src/components/LandingMeals/LandingMeals.jsx @@ -1,5 +1,9 @@ import Image from "next/image"; +import { useTranslation } from "next-i18next"; + const LandingMeals = () => { + const { t } = useTranslation("landing-meals"); + return (
@@ -9,12 +13,12 @@ const LandingMeals = () => {

- Categories + {t("categories")}

- Categories + categories

)} diff --git a/src/components/Navbar/__snapshots__/Navbar.test.jsx.snap b/src/components/Navbar/__snapshots__/Navbar.test.jsx.snap index cf6031a..7f9f1f5 100644 --- a/src/components/Navbar/__snapshots__/Navbar.test.jsx.snap +++ b/src/components/Navbar/__snapshots__/Navbar.test.jsx.snap @@ -2,7 +2,7 @@ exports[`Navbar Component 1`] = `