Allow rendering array of strings in <Tags>
[MAILPOET-2782]
This commit is contained in:
@@ -4,13 +4,20 @@ import Tag from './tag';
|
|||||||
type Props = {
|
type Props = {
|
||||||
children?: React.ReactNode,
|
children?: React.ReactNode,
|
||||||
dimension?: 'large',
|
dimension?: 'large',
|
||||||
segments: any[]
|
segments?: any[],
|
||||||
|
strings?: string[],
|
||||||
}
|
}
|
||||||
|
|
||||||
const Tags = ({ children, dimension, segments }: Props) => (
|
const Tags = ({
|
||||||
|
children,
|
||||||
|
dimension,
|
||||||
|
segments,
|
||||||
|
strings,
|
||||||
|
}: Props) => (
|
||||||
<div className="mailpoet-tags">
|
<div className="mailpoet-tags">
|
||||||
{children}
|
{children}
|
||||||
{segments.map((segment) => <Tag key={segment.name} dimension={dimension} variant="list">{segment.name}</Tag>)}
|
{segments && segments.map((segment) => <Tag key={segment.name} dimension={dimension} variant="list">{segment.name}</Tag>)}
|
||||||
|
{strings && strings.map((string) => <Tag key={string} dimension={dimension} variant="list">{string}</Tag>)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user