Skip to content

Commit a4e2f87

Browse files
Merge pull request #4293 from Codeinwp/feat/pro/2788
Added messenger social media support
2 parents c3270de + dbd3636 commit a4e2f87

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

assets/apps/customizer-controls/src/repeater/RepeaterItemContent.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
TextControl,
55
ToggleControl,
66
TextareaControl,
7+
ExternalLink,
78
} from '@wordpress/components';
89
import IconSelector from './IconSelector';
910
import { getIcons, ColorControl } from '@neve-wp/components';
@@ -67,13 +68,27 @@ const RepeaterItemContent = ({
6768

6869
switch (currentField.type) {
6970
case 'text':
71+
if (
72+
'fb_page_id' === key &&
73+
'messenger' !== value[index]?.social_network
74+
) {
75+
return;
76+
}
7077
return (
71-
<TextControl
72-
label={currentField.label}
73-
value={value[index][key] || currentField.default}
74-
onChange={(newData) => changeContent(key, newData)}
75-
key={key + index}
76-
/>
78+
<>
79+
<TextControl
80+
label={currentField.label}
81+
value={value[index][key] || currentField.default}
82+
onChange={(newData) => changeContent(key, newData)}
83+
key={key + index}
84+
help={currentField.help_text || ''}
85+
/>
86+
{currentField?.help_link && (
87+
<ExternalLink href={currentField?.help_link?.link}>
88+
{currentField?.help_link?.text}
89+
</ExternalLink>
90+
)}
91+
</>
7792
);
7893
case 'textarea':
7994
return (

stories/utils/values.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export const FIELDS = {
220220
whatsapp: 'WhatsApp',
221221
sms: 'SMS',
222222
vk: 'VKontakte'
223+
messenger: 'Messenger'
223224
}
224225
},
225226
display_desktop: {

0 commit comments

Comments
 (0)