diff --git a/client/src/assets/styles/components/Inputs.scss b/client/src/assets/styles/components/Inputs.scss new file mode 100644 index 00000000..448be953 --- /dev/null +++ b/client/src/assets/styles/components/Inputs.scss @@ -0,0 +1,34 @@ +.input { + display: flex; + flex-direction: column; + gap: 0.5rem; + color: var(--grey-100); + font-size: 1rem; + direction: rtl; + width: 100%; + + .radio-buttons { + display: flex; + flex-direction: row; + gap: 0.5rem; + width: 100%; + margin: 0.5rem 0; + } + + input[type="text"], + input[type="password"], + input[type="email"], + input[type="number"], + input[type="tel"], + input[type="date"], + input[type="time"] { + width: 100%; + outline: none; + border-radius: 4px; + border: 1px solid var(--grey-600, #4b5563); + background: var(--grey-700, #374151); + padding: 0 4px; + line-height: 1rem; + color: var(--grey-100); + } +} diff --git a/client/src/components/common/Inputs.jsx b/client/src/components/common/Inputs.jsx new file mode 100644 index 00000000..5e4c69e8 --- /dev/null +++ b/client/src/components/common/Inputs.jsx @@ -0,0 +1,67 @@ +import "./../../assets/styles/components/Inputs.scss"; + +import PropTypes from "prop-types"; + +function TextInput({ + label, + type, + name, + value, + onChange, + placeholder, + required, +}) { + return ( + + ); +} +TextInput.propTypes = { + label: PropTypes.string.isRequired, + type: PropTypes.string, + name: PropTypes.string, + value: PropTypes.string, + onChange: PropTypes.func, + placeholder: PropTypes.string, + required: PropTypes.bool, +}; +function RadioInput({ label, name, required, valuesArr, onChange }) { + return ( + + ); +} +RadioInput.propTypes = { + label: PropTypes.string.isRequired, + name: PropTypes.string, + valuesArr: PropTypes.array, + onChange: PropTypes.func, + required: PropTypes.bool, +}; + +export { RadioInput }; +export default TextInput; diff --git a/client/src/components/signup/signUp.jsx b/client/src/components/signup/signUp.jsx index c6829821..7e7c74ef 100644 --- a/client/src/components/signup/signUp.jsx +++ b/client/src/components/signup/signUp.jsx @@ -1,7 +1,14 @@ +import { useState } from "react"; import Button from "../common/Button"; +import TextInput, { RadioInput } from "../common/Inputs"; import "./signUp.scss"; export default function SignUp() { + const [firstName, setFirstName] = useState(""); + const [lastName, setLastName] = useState(""); + const [middleName, setMiddleName] = useState(""); + const [gender, setGender] = useState(""); + return (
@@ -9,6 +16,21 @@ export default function SignUp() {
الاسم
+ setFirstName(e.target.value)} + /> + setGender(e.target.value) } + />