Skip to content

Commit

Permalink
fix: barrier inputs (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv authored Aug 6, 2024
1 parent d6de3fe commit efc4598
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@binary-com/binary-document-uploader": "^2.4.4",
"@binary-com/binary-style": "^0.2.26",
"@binary-com/webtrader-charts": "^0.6.1",
"@deriv-com/quill-ui": "^1.13.32",
"@deriv-com/quill-ui": "^1.13.37",
"@deriv/deriv-api": "^1.0.15",
"@deriv/quill-icons": "^1.23.1",
"@livechat/customer-sdk": "4.0.2",
Expand Down
12 changes: 6 additions & 6 deletions src/javascript/app/pages/form/barrier-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ const BarrierFields = ({ formName, handleAmountChange }) => {
barrier_error,
} = barrierData;

const barrierRegex = '[+-]?(d+(.d*)?|.d+)';

const getMessage = (indicative, type) => {
const tooltipContent = localize('This is an indicative barrier. Actual barrier will be the entry spot plus the barrier offset.');
let description;
Expand Down Expand Up @@ -84,12 +82,12 @@ const BarrierFields = ({ formName, handleAmountChange }) => {
onChange={(e) =>
handleAmountChange(
e,
'barrier',
barrier_data?.isOffset ? barrierRegex : null
'barrier'
)
}
status={barrier_error ? 'error' : 'neutral'}
message={getMessage(barrier_indicator)}
customType='barrier'
/>
</div>
</div>
Expand All @@ -108,10 +106,11 @@ const BarrierFields = ({ formName, handleAmountChange }) => {
allowDecimals
rightIcon={barrier_data?.isOffsetHightLow && barrierIcon}
onChange={(e) => handleAmountChange(
e, 'barrier_high', barrier_data?.isOffsetHightLow ? barrierRegex : null
e, 'barrier_high'
)}
status={barrier_error ? 'error' : 'neutral'}
message={getMessage(barrier_indicator_high, 'high')}
customType='barrier'
/>
</div>
</div>
Expand All @@ -124,9 +123,10 @@ const BarrierFields = ({ formName, handleAmountChange }) => {
allowDecimals
rightIcon={barrier_data?.isOffsetHightLow && barrierIcon}
onChange={(e) => handleAmountChange(
e, 'barrier_low', barrier_data?.isOffsetHightLow ? barrierRegex : null
e, 'barrier_low'
)}
message={getMessage(barrier_indicator_low)}
customType='barrier'
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/javascript/app/pages/portal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Portal = ({ children }) => {

useEffect(() => {
const el = elRef.current;
document.body.appendChild(el);
document.body?.appendChild(el);

return () => {
if (document.body.contains(el)) {
Expand Down

0 comments on commit efc4598

Please sign in to comment.