Skip to content

Commit

Permalink
feat: add help text
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Aug 30, 2024
1 parent 6a522ce commit dbd3636
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
TextControl,
ToggleControl,
TextareaControl,
ExternalLink,
} from '@wordpress/components';
import IconSelector from './IconSelector';
import { getIcons, ColorControl } from '@neve-wp/components';
Expand Down Expand Up @@ -68,18 +69,26 @@ const RepeaterItemContent = ({
switch (currentField.type) {
case 'text':
if (
'page_name' === key &&
'fb_page_id' === key &&
'messenger' !== value[index]?.social_network
) {
return;
}
return (
<TextControl
label={currentField.label}
value={value[index][key] || currentField.default}
onChange={(newData) => changeContent(key, newData)}
key={key + index}
/>
<>
<TextControl
label={currentField.label}
value={value[index][key] || currentField.default}
onChange={(newData) => changeContent(key, newData)}
key={key + index}
help={currentField.help_text || ''}
/>
{currentField?.help_link && (
<ExternalLink href={currentField?.help_link?.link}>
{currentField?.help_link?.text}
</ExternalLink>
)}
</>
);
case 'textarea':
return (
Expand Down

0 comments on commit dbd3636

Please sign in to comment.