Skip to content

Commit fe667bc

Browse files
authored
fix ContactInfoRenderer, ContactPhoneRenderer locale issue (#890)
* fix ContactInfoRenderer, ContactPhoneRenderer locale issue * ContactDropdownList currentLocale is required
1 parent 768a37a commit fe667bc

File tree

4 files changed

+10
-0
lines changed
  • packages
    • ringcentral-widgets-docs/src/app/pages/Components/ContactDropdownList
    • ringcentral-widgets/components

4 files changed

+10
-0
lines changed

packages/ringcentral-widgets-docs/src/app/pages/Components/ContactDropdownList/Demo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ props.items = [{
1212
phoneType: 'Mobile',
1313
phoneNumber: '+123456789'
1414
}];
15+
props.currentLocale = 'en-US';
1516
props.formatContactPhone = value => value;
1617
props.addToRecipients = () => null;
1718
props.setSelectedIndex = () => null;

packages/ringcentral-widgets/components/ContactDropdownList/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ ContactPhone.defaultProps = {
7373
};
7474

7575
function ContactItem({
76+
currentLocale,
7677
active,
7778
onHover,
7879
onClick,
@@ -100,6 +101,7 @@ function ContactItem({
100101
<li className={className} onMouseOver={onHover}>
101102
<div className={styles.clickable} onClick={onClick}>
102103
<ContactInfoRenderer
104+
currentLocale={currentLocale}
103105
name={name}
104106
entityType={entityType}
105107
phoneType={phoneType}
@@ -109,6 +111,7 @@ function ContactItem({
109111
titleEnabled={titleEnabled}
110112
/>
111113
<ContactPhoneRenderer
114+
currentLocale={currentLocale}
112115
name={name}
113116
entityType={entityType}
114117
phoneType={phoneType}
@@ -122,6 +125,7 @@ function ContactItem({
122125
);
123126
}
124127
ContactItem.propTypes = {
128+
currentLocale: PropTypes.string.isRequired,
125129
onClick: PropTypes.func.isRequired,
126130
formatContactPhone: PropTypes.func.isRequired,
127131
name: PropTypes.string.isRequired,
@@ -167,6 +171,7 @@ class ContactDropdownList extends Component {
167171

168172
render() {
169173
const {
174+
currentLocale,
170175
className,
171176
listRef,
172177
items,
@@ -196,6 +201,7 @@ class ContactDropdownList extends Component {
196201
{
197202
items.map((item, index) => (
198203
<ContactItem
204+
currentLocale={currentLocale}
199205
active={selectedIndex === index}
200206
name={item.name}
201207
entityType={item.entityType}
@@ -218,6 +224,7 @@ class ContactDropdownList extends Component {
218224
}
219225

220226
ContactDropdownList.propTypes = {
227+
currentLocale: PropTypes.string.isRequired,
221228
scrollDirection: PropTypes.string,
222229
visibility: PropTypes.bool.isRequired,
223230
className: PropTypes.string,

packages/ringcentral-widgets/components/RecipientsInput/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ class RecipientsInput extends Component {
334334
{toNumberInput}
335335
</div>
336336
<ContactDropdownList
337+
currentLocale={this.props.currentLocale}
337338
listRef={(ref) => { this.listRef = ref; }}
338339
scrollDirection={this.state.scrollDirection}
339340
selectedIndex={this.state.selectedContactIndex}

packages/ringcentral-widgets/components/ToField/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export default class ToField extends Component {
243243
/>
244244
</div>
245245
<ContactDropdownList
246+
currentLocale={this.props.currentLocale}
246247
scrollDirection={this.state.scrollDirection}
247248
selectedIndex={this.state.selectedContactIndex}
248249
setSelectedIndex={this.setSelectedIndex}

0 commit comments

Comments
 (0)