diff --git a/apps/OpenSign/examples/tailwind-usage-examples.js b/apps/OpenSign/examples/tailwind-usage-examples.js index 97ac61ae64..b92bb5ed04 100644 --- a/apps/OpenSign/examples/tailwind-usage-examples.js +++ b/apps/OpenSign/examples/tailwind-usage-examples.js @@ -21,9 +21,7 @@ const DisabledButtonExamples = () => { {/* Option C: Conditional styling */} diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.jsx b/apps/OpenSign/src/components/pdf/PlaceholderType.jsx index 146238e0ac..e764031c92 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.jsx +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.jsx @@ -42,10 +42,10 @@ function PlaceholderType(props) { // prefer the latest response value over any default value const widgetData = props.pos?.options?.response ?? props.pos?.options?.defaultValue ?? ""; - const widgetTypeTranslation = t(`widgets-name.${props?.pos?.type}`); + // const widgetTypeTranslation = t(`widgets-name.${props?.pos?.type}`); const [widgetValue, setwidgetValue] = useState(); const [selectedCheckbox, setSelectedCheckbox] = useState([]); - const [hint, setHint] = useState(""); + // const [hint, setHint] = useState(""); const [imgUrl, setImgUrl] = useState(""); const fontSize = props.calculateFont(props.pos.options?.fontSize); const fontColor = props.pos.options?.fontColor || "black"; @@ -72,11 +72,11 @@ function PlaceholderType(props) { // keep displayed value in sync with the stored response setwidgetValue(widgetData); } - if (props.pos?.options?.hint) { - setHint(props.pos?.options.hint); - } else if (props.pos?.options?.validation?.type) { - checkRegularExpress(props.pos?.options?.validation?.type, setHint); - } + // if (props.pos?.options?.hint) { + // setHint(props.pos?.options.hint); + // } else if (props.pos?.options?.validation?.type) { + // checkRegularExpress(props.pos?.options?.validation?.type, setHint); + // } } // eslint-disable-next-line react-hooks/exhaustive-deps }, [props.pos, widgetData, type]); @@ -130,6 +130,14 @@ function PlaceholderType(props) { loadImage(); }, [props.pos.SignUrl]); + const formatWidgetName = () => { + const widgetName = props?.pos?.options?.name; + const name = widgetName ? widgetName?.split(`-`) : ["-", "-", "-"]; + const lastWord = name.length > 1 ? `-${name[name.length - 1]}` : ""; + const title = + props?.pos?.type === name[0] ? `${name[0]}${lastWord}` : widgetName; + return props?.pos?.options?.hint || title; + }; switch (type) { case "signature": return props.pos.SignUrl ? ( @@ -150,7 +158,7 @@ function PlaceholderType(props) { }} className="font-medium" > - {hint || widgetTypeTranslation} + {formatWidgetName()} )} @@ -174,7 +182,7 @@ function PlaceholderType(props) { }} className="font-medium" > - {hint || widgetTypeTranslation} + {formatWidgetName()} )} @@ -221,9 +229,11 @@ function PlaceholderType(props) { case textInputWidget: return props.isSignYourself || iswidgetEnable ? (