Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aaradhya-egov committed Sep 16, 2024
1 parent 17dff87 commit 3a6cf15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {
name="mobileNumber"
placeholder="Enter a valid Mobile No."
onChange={(value) => setUserMobileNumber(value)}
disable={true}
disable={Digit.Utils.getMultiRootTenant()?false : true}
{...{
required: true,
pattern: "[6-9]{1}[0-9]{9}",
Expand Down Expand Up @@ -759,7 +759,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {
name="email"
value={email}
onChange={(e) => setUserEmailAddress(e.target.value)}
disabled={editScreen}
disabled={Digit.Utils.getMultiRootTenant()?true : editScreen}
/>
{errors?.emailAddress && (
<ErrorMessage
Expand All @@ -776,7 +776,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {

<LabelFieldPair>
<div style={{ width: "100%" }}>
{changepassword == false ? (
{changepassword == false && !Digit.Utils.getMultiRootTenant()? (
<Button
label={t("CORE_COMMON_CHANGE_PASSWORD")}
variation={"teritiary"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SingleInput = ({ isFocus, onChange, onFocus, value, ...rest }) => {
onChange={onChange}
onFocus={onFocus}
ref={inputRef}
type="number"
type="text"
value={value ? value : ""}
{...rest}
/>
Expand All @@ -29,7 +29,7 @@ const OTPInput = (props) => {
const [activeInput, setActiveInput] = useState(0);

const isInputValueValid = (value) => {
return typeof value === "string" && value.trim().length === 1;
return /^[0-9]$/.test(value);
};

const changeCodeAtFocus = (value) => {
Expand Down Expand Up @@ -60,9 +60,12 @@ const OTPInput = (props) => {

function inputChange(event) {
const { value } = event.target;
changeCodeAtFocus(value);

if (isInputValueValid(value)) {
changeCodeAtFocus(value);
focusNextInput();
} else if (value === "") {
changeCodeAtFocus(""); // Handle clearing the input
}
}

Expand Down

0 comments on commit 3a6cf15

Please sign in to comment.