diff --git a/client/src/assets/styles/components/Button.scss b/client/src/assets/styles/components/Button.scss index 0058dc5d..2dde81c4 100644 --- a/client/src/assets/styles/components/Button.scss +++ b/client/src/assets/styles/components/Button.scss @@ -15,6 +15,12 @@ font-weight: 500; } + &:disabled, + &[disabled] { + cursor: not-allowed; + opacity: 0.7; + } + &--primary { background-color: var(--primary-100); color: var(--grey-900); diff --git a/client/src/assets/styles/components/Inputs.scss b/client/src/assets/styles/components/Inputs.scss index 448be953..d89f3fd1 100644 --- a/client/src/assets/styles/components/Inputs.scss +++ b/client/src/assets/styles/components/Inputs.scss @@ -21,7 +21,8 @@ input[type="number"], input[type="tel"], input[type="date"], - input[type="time"] { + input[type="time"], + select { width: 100%; outline: none; border-radius: 4px; diff --git a/client/src/components/common/Button.jsx b/client/src/components/common/Button.jsx index 861f338c..f0f018ca 100644 --- a/client/src/components/common/Button.jsx +++ b/client/src/components/common/Button.jsx @@ -5,16 +5,16 @@ import { PropTypes } from "prop-types"; import "../../assets/styles/components/Button.scss"; export default function Button(props) { - const { children, className, linkTo, ...rest } = props; + const { children, className, linkTo, disabled, ...rest } = props; return ( <> - {linkTo ? ( + {linkTo && !disabled ? ( {children} ) : ( - )} @@ -26,4 +26,5 @@ Button.propTypes = { children: PropTypes.node.isRequired, className: PropTypes.string, linkTo: PropTypes.string, + disabled: PropTypes.bool, }; diff --git a/client/src/components/common/CustomCheckbox.jsx b/client/src/components/common/CustomCheckbox.jsx new file mode 100644 index 00000000..bb221134 --- /dev/null +++ b/client/src/components/common/CustomCheckbox.jsx @@ -0,0 +1,43 @@ +import PropTypes from "prop-types"; + +export default function CustomCheckbox(props) { + const { labels, values, checkedValues, onChange, name, required, className } = + props; + return ( +
+ {labels.map((label, index) => ( + + ))} +
+ ); +} + +CustomCheckbox.propTypes = { + labels: PropTypes.array.isRequired, + values: PropTypes.array.isRequired, + checkedValues: PropTypes.array, + onChange: PropTypes.func, + name: PropTypes.string, + required: PropTypes.bool, + className: PropTypes.string, +}; diff --git a/client/src/components/common/CustomSelect.jsx b/client/src/components/common/CustomSelect.jsx new file mode 100644 index 00000000..b9e5ff4b --- /dev/null +++ b/client/src/components/common/CustomSelect.jsx @@ -0,0 +1,63 @@ +import PropTypes from "prop-types"; + +//---------------------------------------------------------------- +// Usage: +// setSelectedLanguage(e.target.value)} +// /> +//---------------------------------------------------------------- + +export default function CustomSelect(props) { + const { + data, + displayMember, + valueMember, + defaultValue, + selectedValue, + onChange, + name, + label, + required, + } = props; + + return ( + + ); +} + +CustomSelect.propTypes = { + data: PropTypes.array.isRequired, + displayMember: PropTypes.string.isRequired, + valueMember: PropTypes.string.isRequired, + defaultValue: PropTypes.string, + selectedValue: PropTypes.any, + onChange: PropTypes.func, + name: PropTypes.string, + label: PropTypes.string, + required: PropTypes.bool, +}; diff --git a/client/src/components/common/UserActions.jsx b/client/src/components/common/UserActions.jsx index 72fcf201..dd6a82f2 100644 --- a/client/src/components/common/UserActions.jsx +++ b/client/src/components/common/UserActions.jsx @@ -29,66 +29,77 @@ export default function UserActions() { return ( <>