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,