{ isActivityHeaderVisible && (
) }
{ ( isRequesting || isDismissAllUndoRequesting ) && (
) }
{ ! isRequesting &&
! isDismissAllUndoRequesting &&
renderNotes( {
hasNotes,
isDismissUndoRequesting,
isDismissAllUndoRequesting,
lastRead,
notes,
} ) }
);
};
export default compose(
withSelect( ( select ) => {
const {
getNotes,
getNotesError,
isGetNotesRequesting,
getUndoDismissRequesting,
} = select( 'wc-api' );
const inboxQuery = {
page: 1,
per_page: QUERY_DEFAULTS.pageSize,
status: 'unactioned',
type: QUERY_DEFAULTS.noteTypes,
orderby: 'date',
order: 'desc',
_fields: [
'id',
'name',
'title',
'content',
'type',
'status',
'actions',
'date_created',
'date_created_gmt',
'layout',
'image',
'is_deleted',
],
};
const notes = getNotes( inboxQuery );
const isError = Boolean( getNotesError( inboxQuery ) );
const isRequesting = isGetNotesRequesting( inboxQuery );
const {
isUndoRequesting,
isDismissUndoRequesting,
isDismissAllUndoRequesting,
} = getUndoDismissRequesting();
return {
notes,
isError,
isRequesting,
isUndoRequesting,
isDismissUndoRequesting,
isDismissAllUndoRequesting,
};
} )
)( InboxPanel );