Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mirak55 committed Jun 9, 2024
1 parent afa511a commit 82f1141
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion frontend/src/components/recipeUpload/recipeUpload.css
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ body {
top: -35px;
left: 10px;
text-transform: uppercase;
width: 5%;
}

.form-container .form-groupIngredient input {
Expand Down Expand Up @@ -580,7 +581,6 @@ body {
font-weight: 700;
font-size: 16px;
text-transform: uppercase;

}

.form-container .form-groupCategory input {
Expand Down Expand Up @@ -662,3 +662,9 @@ body {
justify-content: right;
}

#stepsLabel{
z-index: 1;
float: left;
width: 10%;
max-width: 10%;
}
9 changes: 5 additions & 4 deletions frontend/src/components/recipeUpload/recipeUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ export default function Body(){
const [timeEffort, settimeeffort] = useState('');
const [stars, setstars] = useState('');
const [description, setdescription] = useState('');
const [ingredients, setIngredients] = useState(Array(10).fill(''));
const [steps, setSteps] = useState(Array(10).fill(''));
//const [calories, setcalories] = useState('');
const [ingredients, setIngredients] = useState<string[]>([]);
const [steps, setSteps] = useState<string[]>([]);
const [file, setFile] = useState<File | null>(null);

const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -81,6 +80,8 @@ export default function Body(){
formData.append('recipetimeeffort', timeEffort);
formData.append('recipestars', stars);
formData.append('recipedescription', description);
formData.append('recipeingredients', JSON.stringify(ingredients));
formData.append('recipesteps', JSON.stringify(steps));
if (file) {
formData.append('recipepicture', file);
}
Expand Down Expand Up @@ -202,7 +203,7 @@ return (
<div id='blocker1'></div>

<div className="form-groupIngredient">
<label htmlFor="ingredientInput">Steps</label>
<label className="stepsLabel" htmlFor="ingredientInput">Steps</label>
{[...Array(stepCounter)].map((_, index) => (
<div key={index}>
<input
Expand Down

0 comments on commit 82f1141

Please sign in to comment.