diff --git a/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.component.jsx b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.component.jsx index 9e9a559..31cb7da 100644 --- a/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.component.jsx +++ b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.component.jsx @@ -1,16 +1,30 @@ -import React, { Component, useContext, useState } from "react"; +import React, { Component, Fragment, useContext, useState } from "react"; import { ReactComponent as AddMicronutrientsButton } from "../../../../assets/add-micronutrients.svg"; import { ReactComponent as RemoveMicronutrientsButton } from "../../../../assets/close-button.svg"; import FormInput from "../../../shared/form-input/form-input.component"; -import "./add-micronutrients.styles.scss"; +import "./add-micronutrients.styles.jsx"; +import { AddMicronutrientsButtonContainer, + MicronutrientContainer +} from "./add-micronutrients.styles.jsx"; // import { NutritionTrackerContext } from "../../../../contexts/signed-out/nutrition-tracker/nutrition-tracker.context"; import { useDispatch, useSelector } from "react-redux" import { selectFormInputMicronutrients } from "../../../../store/signed-out/nutrition-tracker/nutrition-tracker.selector"; import { addFormInputMicronutrients, updateFormInputMicronutrients, deleteFormInputMicronutrients } from "../../../../store/signed-out/nutrition-tracker/nutrition-tracker.action"; +import { Typography } from "@mui/material"; +import SimplePaper from "../../../shared/mui/paper/paper.component.jsx"; +import { COLOR_CODES } from "../../../../utils/constants/shared.constants.js"; + +const paperStyles = { + display: "flex", + justifyContent: "space-evenly", + alignItems: "center", + backgroundColor: COLOR_CODES.general["5"], + height: 100 +} const AddMicronutrients = () => { // const { formInputMicronutrients, addFormInputMicronutrients, updateFormInputMicronutrients, deleteFormInputMicronutrients } = useContext(NutritionTrackerContext); @@ -54,41 +68,37 @@ const AddMicronutrients = () => { }; return ( -
- -
-

Add micronutrients

+ + + Add micronutrients handleAdd() } className="add-micronutrients-button"> -
+
{ formInputMicronutrients.length !== 0 && formInputMicronutrients.map((micronutrient, micronutrientIndex) => { return ( -
- handleChange(event, micronutrientIndex) } - name="name" value={ micronutrient.name }> - - handleChange(event, micronutrientIndex) } - name="amount" value={ micronutrient.amount }> - - handleChange(event, micronutrientIndex) } - name="unit" value={ micronutrient.unit }> - + handleDelete(micronutrientIndex) } className="remove-micronutrients-button"> -
+ + handleChange(event, micronutrientIndex) } + name="name" value={ micronutrient.name }> + handleChange(event, micronutrientIndex) } + name="amount" value={ micronutrient.amount }> + handleChange(event, micronutrientIndex) } + name="unit" value={ micronutrient.unit }> + + ); }) }
- - -
+ ); }; diff --git a/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.jsx b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.jsx new file mode 100644 index 0000000..bdfd484 --- /dev/null +++ b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.jsx @@ -0,0 +1,33 @@ +import styled from "styled-components"; + +export const AddMicronutrientsButtonContainer = styled.div` + display: flex; + justify-content: center; + align-items: center; + + .add-micronutrients-button:hover { + background-color: #ffea97; + border-radius: 2rem; + border: none; + cursor: pointer; + } +` + +export const MicronutrientContainer = styled.div` + display: block; + justify-content: center; + align-items: center; + margin-bottom: 2%; + + .remove-micronutrients-button { + justify-content: center; + align-items: center; + } + + .remove-micronutrients-button:hover { + background-color: #ff9c9c; + border-radius: 5rem; + border: none; + cursor: pointer; + } +` \ No newline at end of file diff --git a/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.scss b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.scss index 03db425..bf39146 100644 --- a/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.scss +++ b/src/components/signed-out/nutrition-tracker/add-micronutrients/add-micronutrients.styles.scss @@ -18,7 +18,7 @@ } .remove-micronutrients-button { - margin-top: 8%; + margin-top: 5%; } .remove-micronutrients-button:hover { diff --git a/src/components/signed-out/nutrition-tracker/nutrition-tracker-table/nutrition-tracker-table.styles.jsx b/src/components/signed-out/nutrition-tracker/nutrition-tracker-table/nutrition-tracker-table.styles.jsx index 8120ab7..bc3c7d4 100644 --- a/src/components/signed-out/nutrition-tracker/nutrition-tracker-table/nutrition-tracker-table.styles.jsx +++ b/src/components/signed-out/nutrition-tracker/nutrition-tracker-table/nutrition-tracker-table.styles.jsx @@ -4,7 +4,7 @@ export const FilterNutritionTrackerTableContainer = styled.div` display: block; justify-content: center; align-items: center; - margin: 0% 0% 3% 0%; + margin: 0% 0% 4% 0%; padding: 2%; ` diff --git a/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.component.jsx b/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.component.jsx index e009756..ecccb00 100644 --- a/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.component.jsx +++ b/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.component.jsx @@ -1,6 +1,7 @@ import { useState, useContext } from "react"; -import "./update-consumption-form.styles.scss"; +import "./update-consumption-form.styles.jsx"; +import { UpdateConsumptionFormContainer, ConsumptionFormButtonContainer } from "./update-consumption-form.styles.jsx"; import FormInput from "../../../shared/form-input/form-input.component"; import Button from "../../../shared/button/button.component"; @@ -10,6 +11,9 @@ import AddMicronutrients from "../add-micronutrients/add-micronutrients.componen import { useDispatch, useSelector } from "react-redux" import { selectNutritionTrackedDays, selectFormInputMicronutrients } from "../../../../store/signed-out/nutrition-tracker/nutrition-tracker.selector" import { addDayTracked, updateDayTracked, setFormInputMicronutrients } from "../../../../store/signed-out/nutrition-tracker/nutrition-tracker.action"; +import { Typography } from "@mui/material"; +import SimplePaper from "../../../shared/mui/paper/paper.component.jsx"; +import { COLOR_CODES } from "../../../../utils/constants/shared.constants.js"; const defaultFormFields = { dateTracked: "", @@ -24,8 +28,15 @@ const UpdateConsumptionForm = () => { const dispatch = useDispatch() const nutritionTrackedDays = useSelector(selectNutritionTrackedDays) const formInputMicronutrients = useSelector(selectFormInputMicronutrients) - + const [formFields, setFormFields] = useState(defaultFormFields); + + const paperStyles = { + backgroundColor: COLOR_CODES.general["1"], + display: "block", + justifyContent: "center", + alignItems: "center" + } const resetFormFields = () => { setFormFields(defaultFormFields); @@ -76,42 +87,51 @@ const UpdateConsumptionForm = () => { }; return ( -
-

Track some consumption

- -
-
Date tracked
- - - - - - - - - - - - -
- - { - nutritionTrackedDays.length !== 0 && - - } -
- -
- + + + Track some consumption + +
+ Date tracked + + + + + + + + + + + + +
+
+
+ + + +
+ +
+ { + nutritionTrackedDays.length !== 0 && + + + + } +
+
+
+
+
-
+ ); }; diff --git a/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.styles.jsx b/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.styles.jsx new file mode 100644 index 0000000..3c53ef8 --- /dev/null +++ b/src/components/signed-out/nutrition-tracker/update-consumption-form/update-consumption-form.styles.jsx @@ -0,0 +1,13 @@ +import styled from "styled-components"; + +export const UpdateConsumptionFormContainer = styled.div` + display: block; + justify-content: center; + align-items: center; + margin: 0% 2% 0% 2%; + padding: 2%; +` + +export const ConsumptionFormButtonContainer = styled.div` + padding: 2%; +` \ No newline at end of file