From 58fc687de113e21025817333f65bc29a24e2deb2 Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Fri, 24 May 2024 22:17:12 +0330 Subject: [PATCH] Adding JSDoc --- Client/src/Components/Check/Check.jsx | 13 ++++++++++ .../TextFields/Email/EmailTextField.jsx | 26 ++++++++++++------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Client/src/Components/Check/Check.jsx b/Client/src/Components/Check/Check.jsx index 061600405..6daf90aa1 100644 --- a/Client/src/Components/Check/Check.jsx +++ b/Client/src/Components/Check/Check.jsx @@ -2,6 +2,19 @@ import "./check.css"; import React from "react"; import CheckGrey from "../../assets/Images/Check-icon-grey.png"; +/** + * `Check` is a functional React component that displays a check icon and a label. + * + * @component + * @param {Object} props - The properties that define the `Check` component. + * @param {string} props.text - The text to be displayed as the label next to the check icon. + * + * @example + * // To use this component, import it and use it in your JSX like this: + * + * + * @returns {React.Element} The `Check` component with a check icon and a label, defined by the `text` prop. + */ const Check = ({ text }) => { return (
diff --git a/Client/src/Components/TextFields/Email/EmailTextField.jsx b/Client/src/Components/TextFields/Email/EmailTextField.jsx index 3aabdc924..5273ba74b 100644 --- a/Client/src/Components/TextFields/Email/EmailTextField.jsx +++ b/Client/src/Components/TextFields/Email/EmailTextField.jsx @@ -6,17 +6,25 @@ import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import { useTheme } from "@mui/material"; /** + * `EmailTextField` is a functional React component that renders a text field for email input. + * * @component - * @param {Object} props - * @param {string} props.id - Unique ID for the text field (optional) - * @param {string} props.label - The label text displayed above the text field (optional) - * @param {"standard" | "outlined" | "filled"} props.variant - The variant of the text field (e.g., "outlined") (optional) - * @param {string} props.placeholder - The placeholder text displayed within the text field (optional) - * @param {"error" | "help"} [props.icon] - The type of icon to display (error or help) (optional) - * @param {string} props.helperText - The helper text displayed below the text field (optional) - * @param {boolean} props.error - A flag indicating if the text field has an error (required) - * @returns {JSX.Element} - Renders the email text field component with dynamic icon display + * @param {Object} props - The properties that define the `EmailTextField` component. + * @param {string} props.id - The id of the text field. + * @param {string} [props.label="Email"] - The label of the text field. + * @param {string} props.variant - The variant of the text field. + * @param {string} props.placeholder - The placeholder of the text field. + * @param {React.Element} props.icon - The icon to be displayed in the text field. + * @param {string} props.helperText - The helper text to be displayed below the text field. + * @param {boolean} props.error - If true, the text field will indicate an error state. + * + * @example + * // To use this component, import it and use it in your JSX like this: + * + * + * @returns {React.Element} The `EmailTextField` component with a text field for email input. */ + const EmailTextField = ({ id, label = "Email",