mirror of
https://github.com/lowdefy/lowdefy.git
synced 2024-11-21 01:14:48 +08:00
chore(blocks-antd): Use conditional chain instead of ternary.
This commit is contained in:
parent
e4ec43505f
commit
0f781e7d2b
@ -17,7 +17,6 @@
|
||||
import React from 'react';
|
||||
import { Input, Select } from 'antd';
|
||||
import { blockDefaultProps } from '@lowdefy/block-utils';
|
||||
// import { type } from '@lowdefy/helpers';
|
||||
import regions from './regions.js';
|
||||
|
||||
import Label from '../Label/Label.js';
|
||||
@ -76,9 +75,7 @@ function AddOnSelect({
|
||||
onChange={(newVal) => {
|
||||
const input = value?.input ?? '';
|
||||
const region = uniqueValueOptions[newVal]?.value ?? {};
|
||||
const phone_number = region?.dial_code ? `${region.dial_code}${input}` : input;
|
||||
//? another implementation
|
||||
// const phone_number = `${type.isObject(region) ? region.dial_code ?? '' : ''}${input}`;
|
||||
const phone_number = `${region?.dial_code ?? ''}${input}`;
|
||||
|
||||
methods.setValue({
|
||||
input,
|
||||
@ -211,11 +208,7 @@ const PhoneNumberInput = ({
|
||||
}
|
||||
|
||||
const region = value?.region ?? {};
|
||||
const phone_number = region?.dial_code ? `${region.dial_code}${input}` : input;
|
||||
//? another implementation
|
||||
// const phone_number = `${
|
||||
// type.isObject(region) ? region.dial_code ?? '' : ''
|
||||
// }${input}`;
|
||||
const phone_number = `${region?.dial_code ?? ''}${input}`;
|
||||
|
||||
methods.setValue({
|
||||
input,
|
||||
|
Loading…
Reference in New Issue
Block a user