Wrapped login and register in forms

This commit is contained in:
Alex Holliday committed 2024-06-12 13:49:38 -07:00
1 parent 08565c9eda
commit 3cc01db55f
6 files changed
+92 -81

No files matched your search

+5 -2
View File
@@ -36,6 +36,7 @@ const levelConfig = {
* @component
* @param {Object} props
* @param {'primary' | 'secondary' | 'tertiary' | 'error' | 'imagePrimary' | 'imageSecondary' | 'imageTertiary'} props.level - The level of the button
* @param {string} props.type - The type of the button
* @param {string} props.label - The label of the button
* @param {React.ReactNode} props.img - Image for button
* @param {boolean} [props.disabled] - Whether the button is disabled
@@ -44,13 +45,14 @@ const levelConfig = {
* @returns {JSX.Element}
* @example
* // Render an error button
* <Button level="error" label="Error" disabled sx={{marginTop: "1rem"}}/>
* <Button type="submit" level="error" label="Error" disabled sx={{marginTop: "1rem"}}/>
*/
const Button = ({ level, label, disabled, img, onClick, sx }) => {
const Button = ({ type, level, label, disabled, img, onClick, sx }) => {
const { variant, color } = levelConfig[level];
return (
<MuiButton
type={type}
variant={variant}
color={color}
disabled={disabled}
@@ -67,6 +69,7 @@ const Button = ({ level, label, disabled, img, onClick, sx }) => {
};
Button.propTypes = {
type: PropTypes.string,
level: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
img: PropTypes.node,
@@ -32,6 +32,7 @@ const EmailTextField = ({
label = "Email",
variant,
placeholder,
autoComplete,
icon,
helperText,
error,
@@ -60,6 +61,7 @@ const EmailTextField = ({
id={id}
variant={variant}
placeholder={placeholder}
autoComplete={autoComplete}
InputProps={{
endAdornment: (
<InputAdornment position="end">
@@ -22,6 +22,7 @@ const PasswordTextField = ({
onChange,
id,
label = "Password",
autoComplete,
variant,
placeholder,
icon,
@@ -48,6 +49,7 @@ const PasswordTextField = ({
<TextField
onChange={onChange}
type="password"
autoComplete={autoComplete}
error={error}
className="password-text-field-input"
id={id}
@@ -19,6 +19,7 @@ import { useTheme } from "@mui/material";
*/
const StringTextField = ({
onChange,
autoComplete,
id,
label,
variant,
@@ -51,6 +52,7 @@ const StringTextField = ({
id={id}
variant={variant}
placeholder={placeholder}
autoComplete={autoComplete}
InputProps={{
endAdornment: (
<InputAdornment position="end">