diff --git a/README.md b/README.md index ade2e85..022fdaa 100644 --- a/README.md +++ b/README.md @@ -95,13 +95,16 @@ address: [link](https://mood2food.netlify.app/). ## Built With - [Nuxt](https://nuxt.com/) - The Intuitive Vue Framework -- [Tailwindcss](https://tailwindcss.com) -Rapidly build modern websites without ever leaving your HTML. -- [TheMealDb](https://www.themealdb.com/api.php) - An open, crowd-sourced database of Recipes from around the world +- [Tailwindcss](https://tailwindcss.com) -Rapidly build modern websites without + ever leaving your HTML. +- [TheMealDb](https://www.themealdb.com/api.php) - An open, crowd-sourced database + of Recipes from around the world ## Contributing -Please read [CONTRIBUTING.md](https://github.com/rjNemo/meal_planner/contributors) for details on our code of conduct, -and the process for submitting pull requests to us. +Please read [CONTRIBUTING.md](https://github.com/rjNemo/meal_planner/contributors) +for details on our code of conduct, and the process for submitting pull requests +to us. ## Versioning @@ -112,9 +115,10 @@ the [tags on this repository](https://github.com/rjNemo/meal_planner/tags). - **Ruidy Nemausat** - _Initial work_ - [GitHub](https://github.com/rjNemo) -See also the list of [contributors](https://github.com/rjNemo/meal_planner/contributors) who participated in this -project. +See also the list of [contributors](https://github.com/rjNemo/meal_planner/contributors) +who participated in this project. ## License -This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) +file for details diff --git a/docs/homepage.png b/docs/homepage.png index fb0d41f..0dbdad3 100644 Binary files a/docs/homepage.png and b/docs/homepage.png differ diff --git a/docs/mealpage.png b/docs/mealpage.png index cd22473..82021ac 100644 Binary files a/docs/mealpage.png and b/docs/mealpage.png differ diff --git a/pages/[id].vue b/pages/[id].vue index 16197e6..3e5d7cb 100644 --- a/pages/[id].vue +++ b/pages/[id].vue @@ -24,6 +24,7 @@ if (error.value) { message: error.value.message, }); } + const url = useRequestURL(); useSeoMeta({ title: `${recipe.value!.title} | Mood2Food`, diff --git a/src/App.tsx b/src/App.tsx deleted file mode 100644 index e02cfb6..0000000 --- a/src/App.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import "./index.css"; -import MainLayout from "./layouts/MainLayout"; -import { AppRouter, Router } from "./router"; - -export const App = () => ( - - - - - -); diff --git a/src/components/CardEntry.tsx b/src/components/CardEntry.tsx deleted file mode 100644 index bbe6195..0000000 --- a/src/components/CardEntry.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Link } from "react-router-dom"; -import { MealSummary } from "../types/meal"; - -type Props = { - meal: MealSummary; - className?: string; -}; - -export const CardEntry = ({ - meal: { idMeal, strMeal, strMealThumb }, - className = "col s12 m6", -}: Props) => ( - -
  • -
    -
    -
    - {strMeal} -
    -
    -

    {strMeal}

    -
    -
    -
    -
  • - -); diff --git a/src/components/CopyrightText.tsx b/src/components/CopyrightText.tsx deleted file mode 100644 index 8fd001f..0000000 --- a/src/components/CopyrightText.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export const CopyrightText = () => ( - - © {new Date().getFullYear()} - Chef's - Made with{" "} - - ❤️ - - -); diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx deleted file mode 100644 index 82de02f..0000000 --- a/src/components/Footer.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { links } from "../constants"; -import { CopyrightText } from "./CopyrightText"; -import { FooterLink } from "./FooterLink"; -import { GitHubLink } from "./GitHubLink"; - -export const Footer = () => { - const footerLinks = [...links, "random"]; - return ( - - ); -}; diff --git a/src/components/FooterLink.tsx b/src/components/FooterLink.tsx deleted file mode 100644 index 381517c..0000000 --- a/src/components/FooterLink.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Link } from "react-router-dom"; -import { upFirstChar } from "../utils/string"; - -type Props = { - link: string; - textColor?: string; -}; - -export const FooterLink = ({ link, textColor = "" }: Props) => { - const textColorClass = `${textColor}-text`; - return ( -
  • - - {upFirstChar(link)} - -
  • - ); -}; diff --git a/src/components/GitHubLink.tsx b/src/components/GitHubLink.tsx deleted file mode 100644 index 8e346a6..0000000 --- a/src/components/GitHubLink.tsx +++ /dev/null @@ -1,10 +0,0 @@ -export const GitHubLink = () => ( - - GitHub - -); diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx deleted file mode 100644 index b01b14a..0000000 --- a/src/components/Logo.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Link } from "react-router-dom"; - -export const Logo = () => ( - - chef's logo - Chef's - -); diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx deleted file mode 100644 index 5a68086..0000000 --- a/src/components/Navbar.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { MouseEventHandler } from "react"; -import { Link } from "react-router-dom"; -import { buttonURL, links } from "../constants"; -import { FooterLink } from "./FooterLink"; -import { Logo } from "./Logo"; -import { RandomButton } from "./RandomButton"; - -type Props = { openNavClick: MouseEventHandler }; - -export const Navbar = ({ openNavClick }: Props) => ( -
    - -
    -); diff --git a/src/components/PreLoader.tsx b/src/components/PreLoader.tsx deleted file mode 100644 index c7eab78..0000000 --- a/src/components/PreLoader.tsx +++ /dev/null @@ -1,15 +0,0 @@ -export const PreLoader = () => ( -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -); diff --git a/src/components/RandomButton.tsx b/src/components/RandomButton.tsx deleted file mode 100644 index 5f97c7d..0000000 --- a/src/components/RandomButton.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Link } from "react-router-dom"; -import { useMeal } from "../store/meal"; -import { fetchRandomMeal } from "../store/meal/async"; - -type Props = { - url: string; - size?: string; - color?: string; -}; - -export const RandomButton = ({ url, size = "large", color }: Props) => { - const classString = `waves-effect waves-light btn-${size} ${color}`; - const { dispatch } = useMeal(); - return ( - - - - ); -}; diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx deleted file mode 100644 index 78a156b..0000000 --- a/src/components/SearchBar.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { ChangeEvent, MouseEventHandler, useState } from "react"; -import { Link } from "react-router-dom"; -import { useMeal } from "../store/meal"; -import { fetchSearchResults } from "../store/meal/async"; - -export const SearchBar = () => { - const { dispatch } = useMeal(); - const [searchString, setSearchString] = useState(""); - const getSearchResults: MouseEventHandler = (e) => { - searchString === "" ? e.preventDefault() : fetchSearchResults(dispatch, searchString); - }; - - const clearSearchBar = () => { - setSearchString(""); - dispatch({ type: "clearSearchResults" }); - }; - - const handleChange = ({ target: { value } }: ChangeEvent) => - setSearchString(value); - - return ( -
    -
    -
    -
    -
    -
    - - - - close - -
    -
    - - - -
    -
    -
    -
    -
    -
    - ); -}; diff --git a/src/components/SideNav.tsx b/src/components/SideNav.tsx deleted file mode 100644 index 6c1d390..0000000 --- a/src/components/SideNav.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { MouseEventHandler } from "react"; -import { Link } from "react-router-dom"; -import { buttonURL, links } from "../constants"; -import SpecialEventImage from "../images/special_event.svg"; -import { FooterLink } from "./FooterLink"; -import { RandomButton } from "./RandomButton"; - -type Props = { - showNav: boolean; - closeNavClick: MouseEventHandler; -}; - -export const SideNav = ({ showNav, closeNavClick }: Props) => { - let transformStyle = { - transform: showNav ? "translateX(0%)" : "translateX(-105%)", - transition: "0.5s", - }; - - return ( -
      -
    • -
      -
      - sidenav_background -
      - - - close - -
      -
    • - -
    • - -
    • -
    • -
      -
    • -
    • - - Navigation - -
    • - {links.map((link, i) => ( - - ))} -
    - ); -}; diff --git a/src/constants.ts b/src/constants.ts deleted file mode 100644 index ec872f8..0000000 --- a/src/constants.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const apiRoot = "https://www.themealdb.com/api/json/v1/1/"; -export const buttonURL = "/random"; -export const links = ["categories", "contact"]; diff --git a/src/containers/Categories/components/CategoriesEntry.tsx b/src/containers/Categories/components/CategoriesEntry.tsx deleted file mode 100644 index 94a1f2c..0000000 --- a/src/containers/Categories/components/CategoriesEntry.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Link, useRouteMatch } from "react-router-dom"; - -type Props = { - strCategory: string; - strCategoryThumb: string; -}; - -const CategoriesEntry = ({ strCategory, strCategoryThumb }: Props) => { - const { url } = useRouteMatch(); - - return ( - -
  • -
    -
    -
    -
    - {strCategory} -
    -
    -
    -

    {strCategory}

    -
    -
    -
    -
    -
    -
  • - - ); -}; - -export default CategoriesEntry; diff --git a/src/containers/Categories/components/CategoriesPage.tsx b/src/containers/Categories/components/CategoriesPage.tsx deleted file mode 100644 index cff5920..0000000 --- a/src/containers/Categories/components/CategoriesPage.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import PageLayout from "../../../layouts/PageLayout"; -import CategoriesEntry from "./CategoriesEntry"; - -type Props = { - categories: { strCategory: string; strCategoryThumb: string }[]; -}; - -export const CategoriesPage = ({ categories }: Props) => ( - -
      - {categories.map(({ strCategory, strCategoryThumb }, i) => ( - - ))} -
    -
    -); diff --git a/src/containers/Categories/index.tsx b/src/containers/Categories/index.tsx deleted file mode 100644 index 8b16888..0000000 --- a/src/containers/Categories/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { useEffect, useState } from "react"; -import { PreLoader } from "../../components/PreLoader"; -import { getData } from "../../services/api"; -import { CategoriesPage } from "./components/CategoriesPage"; - -export const Categories = () => { - const [categories, setCategories] = useState({ categories: [] }); - - const getCategories = () => getData("categories").then((data) => setCategories(data)); - - useEffect(() => { - getCategories(); - }, []); - - return categories.categories.length === 0 ? ( - - ) : ( - - ); -}; diff --git a/src/containers/Category/components/CategoryPage.tsx b/src/containers/Category/components/CategoryPage.tsx deleted file mode 100644 index 29d68b5..0000000 --- a/src/containers/Category/components/CategoryPage.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { CardEntry } from "../../../components/CardEntry"; -import PageLayout from "../../../layouts/PageLayout"; -import { MealSummary } from "../../../types/meal"; - -type Props = { - meals: { meals: MealSummary[] }; - strCategory: string; -}; - -export const CategoryPage = ({ meals, strCategory }: Props) => ( - -
      -
      - {meals.meals.map((meal) => ( - - ))} -
      -
    -
    -); diff --git a/src/containers/Category/index.tsx b/src/containers/Category/index.tsx deleted file mode 100644 index d1f931a..0000000 --- a/src/containers/Category/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { useEffect, useState } from "react"; -import { Redirect, useParams } from "react-router-dom"; -import { getData } from "../../services/api"; -import { CategoryPage } from "./components/CategoryPage"; - -export const Category = () => { - const { strCategory } = useParams<{ strCategory: string }>(); - const [meals, setMeals] = useState({ meals: [] }); - - useEffect(() => { - const getMeals = () => getData(strCategory, "filter"); - getMeals().then((data) => setMeals(data)); - }, [strCategory]); - - return !meals.meals ? ( - - ) : ( - - ); -}; diff --git a/src/containers/Contact/components/ContactForm.tsx b/src/containers/Contact/components/ContactForm.tsx deleted file mode 100644 index 5d7c554..0000000 --- a/src/containers/Contact/components/ContactForm.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { useState, FormEvent } from "react"; -import { ContactFormInput } from "./ContactFormInput"; -import { ContactFormSubmitButton } from "./ContactFormSubmitButton"; -import { ContactFormTextArea } from "./ContactFormTextArea"; - -type Props = { - setIsSubmitted: (value: boolean) => void; -}; - -export const ContactForm = ({ setIsSubmitted }: Props) => { - const [firstName, setFirstName] = useState(""); - const [lastName, setLastName] = useState(""); - const [email, setEmail] = useState(""); - const [phone, setPhone] = useState(""); - const [message, setMessage] = useState(""); - - const handleSubmit = (e: FormEvent) => { - e.preventDefault(); - setIsSubmitted(true); - }; - - return ( -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - - -
    -
    -
    -
    - ); -}; diff --git a/src/containers/Contact/components/ContactFormInput.tsx b/src/containers/Contact/components/ContactFormInput.tsx deleted file mode 100644 index 031df55..0000000 --- a/src/containers/Contact/components/ContactFormInput.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { ChangeEventHandler, Dispatch, SetStateAction } from "react"; - -type Props = { - id: string; - type?: string; - value: string; - dispatch: Dispatch>; -}; - -export const ContactFormInput = ({ id, type = "text", value, dispatch }: Props) => { - const handleChange: ChangeEventHandler = (e) => { - e.preventDefault(); - dispatch(e.target.value); - }; - - return ( -
    - {/* account_circle */} - - -
    - ); -}; diff --git a/src/containers/Contact/components/ContactFormSubmitButton.tsx b/src/containers/Contact/components/ContactFormSubmitButton.tsx deleted file mode 100644 index 42fcdde..0000000 --- a/src/containers/Contact/components/ContactFormSubmitButton.tsx +++ /dev/null @@ -1,10 +0,0 @@ -type Props = { - text: string; - color: string; -}; - -export const ContactFormSubmitButton = ({ text, color }: Props) => ( - -); diff --git a/src/containers/Contact/components/ContactFormSubmitted.tsx b/src/containers/Contact/components/ContactFormSubmitted.tsx deleted file mode 100644 index 916e9e9..0000000 --- a/src/containers/Contact/components/ContactFormSubmitted.tsx +++ /dev/null @@ -1,11 +0,0 @@ -export const ContactFormSubmitted = () => ( -
    - mail_sent -

    Thank you for your message

    -
    -); diff --git a/src/containers/Contact/components/ContactFormTextArea.tsx b/src/containers/Contact/components/ContactFormTextArea.tsx deleted file mode 100644 index c4c6e6f..0000000 --- a/src/containers/Contact/components/ContactFormTextArea.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { ChangeEventHandler, Dispatch, FC, SetStateAction } from "react"; - -type Props = { - id: string; - value: string; - dispatch: Dispatch>; -}; - -export const ContactFormTextArea: FC = ({ id, value, dispatch }) => { - const handleChange: ChangeEventHandler = (e) => { - e.preventDefault(); - dispatch(e.target.value); - }; - - return ( -
    - -