From 9c6a87c5e99102a8047cb674810b713f60069ea0 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Fri, 31 May 2024 16:05:10 +0530 Subject: [PATCH] fix: mb_way ui fix (#407) --- src/Components/DropdownField.res | 4 +- src/Components/PaymentField.res | 149 ++++++++++++--------- src/Components/PhoneNumberPaymentInput.res | 2 +- 3 files changed, 87 insertions(+), 68 deletions(-) diff --git a/src/Components/DropdownField.res b/src/Components/DropdownField.res index aacc0029e..90cee57a9 100644 --- a/src/Components/DropdownField.res +++ b/src/Components/DropdownField.res @@ -104,12 +104,12 @@ let make = (
Option.isSome}>
{React.string(displayValue->Option.getOr(""))}
diff --git a/src/Components/PaymentField.res b/src/Components/PaymentField.res index 8c88e538e..710f88795 100644 --- a/src/Components/PaymentField.res +++ b/src/Components/PaymentField.res @@ -87,22 +87,10 @@ let make = ( let flexDirectionBasedOnType = type_ === "tel" ? "flex-row" : "flex-col" -
- - Option.getOr("")} - setValue={setValueDropDown->Option.getOr(_ => ())} - fieldName={dropDownFieldName->Option.getOr("")} - options={dropDownOptions->Option.getOr([])} - width="w-1/3 mr-2" - displayValue={displayValue->Option.getOr("")} - setDisplayValue={setDisplayValue->Option.getOr(_ => ())} - isDisplayValueVisible=true - /> - +
String.length > 0 && + condition={name === "phone" && + fieldName->String.length > 0 && config.appearance.labels == Above && isSpacedInnerLayout}>
-
-
- ReactDOM.Ref.domRef} - type_ - name - ?maxLength - ?pattern - className={`${inputClassStyles} ${inputClass} ${className} focus:outline-none transition-shadow ease-out duration-200`} - placeholder={config.appearance.labels == Above || config.appearance.labels == Never - ? placeholder - : ""} - value={value.value} - autoComplete="on" - onChange - onBlur=handleBlur - onFocus=handleFocus +
+ + Option.getOr("")} + setValue={setValueDropDown->Option.getOr(_ => ())} + fieldName={dropDownFieldName->Option.getOr("")} + options={dropDownOptions->Option.getOr([])} + width="w-1/3 mr-2" + displayValue={displayValue->Option.getOr("")} + setDisplayValue={setDisplayValue->Option.getOr(_ => ())} + isDisplayValueVisible=true /> - -
+ String.length > 0 && + config.appearance.labels == Above && + isSpacedInnerLayout}> +
+ {React.string(fieldName)} +
+
+
+
+ String.length > 0 ? "" : themeObj.spacingUnit - }, - fontSize: { - inputFocused || value.value->String.length > 0 ? themeObj.fontSizeXs : "" - }, - opacity: "0.6", - }> - {React.string(fieldName)} -
- + background: backgroundClass, + padding: themeObj.spacingUnit, + width: "100%", + } + disabled=readOnly + ref={inputRef->ReactDOM.Ref.domRef} + type_ + name + ?maxLength + ?pattern + className={`${inputClassStyles} ${inputClass} ${className} focus:outline-none transition-shadow ease-out duration-200`} + placeholder={config.appearance.labels == Above || config.appearance.labels == Never + ? placeholder + : ""} + value={value.value} + autoComplete="on" + onChange + onBlur=handleBlur + onFocus=handleFocus + /> + +
String.length > 0 ? "" : themeObj.spacingUnit + }, + fontSize: { + inputFocused || value.value->String.length > 0 ? themeObj.fontSizeXs : "" + }, + opacity: "0.6", + }> + {React.string(fieldName)} +
+
+
+
{rightIcon}
-
{rightIcon}
+ String.length > 0}> +
+ {React.string(value.errorString)} +
+
- String.length > 0}> -
- {React.string(value.errorString)} -
-
} diff --git a/src/Components/PhoneNumberPaymentInput.res b/src/Components/PhoneNumberPaymentInput.res index 9d52efc0f..31ba06cf9 100644 --- a/src/Components/PhoneNumberPaymentInput.res +++ b/src/Components/PhoneNumberPaymentInput.res @@ -92,7 +92,7 @@ let make = () => { type_="tel" name="phone" inputRef=phoneRef - placeholder="+351 200 000 000" + placeholder="000 000 000" maxLength=14 dropDownOptions=phoneNumberCodeOptions valueDropDown