diff --git a/client/src/Pages/Settings/SettingsEmail.jsx b/client/src/Pages/Settings/SettingsEmail.jsx new file mode 100644 index 000000000..ecc2a51f2 --- /dev/null +++ b/client/src/Pages/Settings/SettingsEmail.jsx @@ -0,0 +1,126 @@ +import Box from "@mui/material/Box"; +import Typography from "@mui/material/Typography"; +import ConfigBox from "../../Components/ConfigBox"; +import TextInput from "../../Components/Inputs/TextInput"; +import Button from "@mui/material/Button"; +import Stack from "@mui/material/Stack"; +// Utils +import { useTheme } from "@emotion/react"; +import { PropTypes } from "prop-types"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; +const SettingsEmail = ({ + HEADER_SX, + handleChange, + settingsData, + setSettingsData, + isPasswordSet, +}) => { + const { t } = useTranslation(); + const theme = useTheme(); + + const [password, setPassword] = useState(""); + const [hasBeenReset, setHasBeenReset] = useState(false); + + const handlePasswordChange = (e) => { + setPassword(e.target.value); + setSettingsData({ + ...settingsData, + settings: { ...settingsData.settings, systemEmailPassword: e.target.value }, + }); + }; + + return ( + + + {t("settingsEmail")} + {t("settingsEmailDescription")} + + + + + {t("settingsEmailHost")} + + + + {t("settingsEmailPort")} + + + + {t("settingsEmailUser")} + + + + {t("settingsEmailAddress")} + + + {(isPasswordSet === false || hasBeenReset === true) && ( + + {t("settingsEmailPassword")} + } + /> + + )} + {isPasswordSet === true && hasBeenReset === false && ( + + {t("settingsEmailFieldResetLabel")} + + + )} + + + + ); +}; + +SettingsEmail.propTypes = { + settingsData: PropTypes.object, + setSettingsData: PropTypes.func, + handleChange: PropTypes.func, + HEADER_SX: PropTypes.object, + isPasswordSet: PropTypes.bool, +}; + +export default SettingsEmail;