Skip to content

Commit d53f44d

Browse files
authored
Forms: render badges in unread/read column when visible (#45931)
1 parent 0eb80ca commit d53f44d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Forms: render badges in unread/read column when visible

projects/packages/forms/src/dashboard/inbox/dataviews/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* External dependencies
33
*/
44
import jetpackAnalytics from '@automattic/jetpack-analytics';
5+
import { Badge } from '@automattic/ui';
56
import {
67
ExternalLink,
78
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
@@ -352,13 +353,20 @@ export default function InboxView() {
352353
},
353354
{
354355
id: 'read_status',
355-
label: __( 'Read status', 'jetpack-forms' ),
356+
label: __( 'Status', 'jetpack-forms' ),
356357
elements: [
357358
{ label: __( 'Unread', 'jetpack-forms' ), value: 'unread' },
358359
{ label: __( 'Read', 'jetpack-forms' ), value: 'read' },
359360
],
360361
filterBy: { operators: [ 'is' ] },
361362
enableSorting: false,
363+
render: ( { item } ) => {
364+
return (
365+
<Badge intent="default">
366+
{ item.is_unread ? __( 'Unread', 'jetpack-forms' ) : __( 'Read', 'jetpack-forms' ) }
367+
</Badge>
368+
);
369+
},
362370
},
363371
{
364372
id: 'ip',

0 commit comments

Comments
 (0)