Link segment tags to filtered subscribers page
MAILPOET-4244
This commit is contained in:
committed by
Veljko V
parent
7e59ad7f90
commit
56bc60024d
@@ -3,6 +3,7 @@ import { Tag } from './tag';
|
|||||||
|
|
||||||
type Segment = {
|
type Segment = {
|
||||||
name: string;
|
name: string;
|
||||||
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -17,11 +18,21 @@ function Tags({ children, dimension, segments, strings }: Props) {
|
|||||||
<div className="mailpoet-tags">
|
<div className="mailpoet-tags">
|
||||||
{children}
|
{children}
|
||||||
{segments &&
|
{segments &&
|
||||||
segments.map((segment) => (
|
segments.map((segment) =>
|
||||||
<Tag key={segment.name} dimension={dimension} variant="list">
|
segment.id ? (
|
||||||
{segment.name}
|
<a
|
||||||
</Tag>
|
href={`admin.php?page=mailpoet-subscribers#/filter[segment=${segment.id}]`}
|
||||||
))}
|
>
|
||||||
|
<Tag key={segment.name} dimension={dimension} variant="list">
|
||||||
|
{segment.name}
|
||||||
|
</Tag>
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<Tag key={segment.name} dimension={dimension} variant="list">
|
||||||
|
{segment.name}
|
||||||
|
</Tag>
|
||||||
|
),
|
||||||
|
)}
|
||||||
{strings &&
|
{strings &&
|
||||||
strings.map((string) => (
|
strings.map((string) => (
|
||||||
<Tag key={string} dimension={dimension} variant="list">
|
<Tag key={string} dimension={dimension} variant="list">
|
||||||
|
Reference in New Issue
Block a user