diff --git a/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.styled.tsx b/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.styled.tsx new file mode 100644 index 0000000..4f210a9 --- /dev/null +++ b/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.styled.tsx @@ -0,0 +1 @@ +import styled from 'styled-components'; diff --git a/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.tsx b/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.tsx new file mode 100644 index 0000000..927c957 --- /dev/null +++ b/src/components/AddRecipe/AddRecipeForm/AddRecipeForm.tsx @@ -0,0 +1,33 @@ +import RecipeDescriptionFields from 'components/AddRecipe/RecipeDescriptionFields'; +import RecipeIngredientsFields from 'components/AddRecipe/RecipeIngredientsFields'; +import RecipePreparationFields from 'components/AddRecipe/RecipePreparationFields'; +import { FC, FormEvent } from 'react'; +import { useNavigate } from 'react-router-dom'; + +//TODO install React-Select +// містить стейт => зберігаються заповнені у формі дані +// всі поля required, валідуються. Інфа якщо значення невалідне +const AddRecipeForm: FC = () => { + const inputValues = 'test'; + const navigate = useNavigate(); + + const handleFormSubmit = (e: FormEvent) => { + e.preventDefault(); + + navigate('/my'); + }; + + return ( +
+ + + + + + ); +}; + +export default AddRecipeForm; diff --git a/src/components/AddRecipe/AddRecipeForm/index.ts b/src/components/AddRecipe/AddRecipeForm/index.ts new file mode 100644 index 0000000..dcc7501 --- /dev/null +++ b/src/components/AddRecipe/AddRecipeForm/index.ts @@ -0,0 +1 @@ +export { default } from './AddRecipeForm'; diff --git a/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.styled.tsx b/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.styled.tsx new file mode 100644 index 0000000..4f210a9 --- /dev/null +++ b/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.styled.tsx @@ -0,0 +1 @@ +import styled from 'styled-components'; diff --git a/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.tsx b/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.tsx new file mode 100644 index 0000000..ea05142 --- /dev/null +++ b/src/components/AddRecipe/RecipeDescriptionFields/RecipeDescriptionFields.tsx @@ -0,0 +1,28 @@ +import { FC, FormEvent } from 'react'; + +interface RecipeDescriptionFieldsProps { + value: string; + onSubmit: (e: FormEvent, data: unknown) => void; +} + +// time 5mins-120mins. Interval 5mins +// selects must have visible 6 options, other scroll +const RecipeDescriptionFields: FC = ({ + value, + onSubmit, +}) => { + return ( +
+ +
+ + + + + + + + + + + ); +}; + +export default RecipeIngredientsFields; diff --git a/src/components/AddRecipe/RecipeIngredientsFields/index.ts b/src/components/AddRecipe/RecipeIngredientsFields/index.ts new file mode 100644 index 0000000..9a72fa9 --- /dev/null +++ b/src/components/AddRecipe/RecipeIngredientsFields/index.ts @@ -0,0 +1 @@ +export { default } from './RecipeIngredientsFields'; diff --git a/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.styled.tsx b/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.styled.tsx new file mode 100644 index 0000000..4f210a9 --- /dev/null +++ b/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.styled.tsx @@ -0,0 +1 @@ +import styled from 'styled-components'; diff --git a/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.tsx b/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.tsx new file mode 100644 index 0000000..00b6f45 --- /dev/null +++ b/src/components/AddRecipe/RecipePreparationFields/RecipePreparationFields.tsx @@ -0,0 +1,10 @@ +const RecipePreparationFields = () => { + return ( + <> +

Recipe Preparation

+