{ isActivityHeaderVisible && (
) }
{ ( isRequesting || isDismissAllUndoRequesting ) && (
) }
{ ! isRequesting &&
! isDismissAllUndoRequesting &&
this.renderNotes( hasNotes ) }
);
}
}
export default compose(
withSelect( ( select ) => {
const {
getCurrentUserData,
getNotes,
getNotesError,
isGetNotesRequesting,
getUndoDismissRequesting,
} = select( 'wc-api' );
const userData = getCurrentUserData();
const inboxQuery = {
page: 1,
per_page: QUERY_DEFAULTS.pageSize,
type: QUERY_DEFAULTS.noteTypes,
orderby: 'date',
order: 'desc',
status: 'unactioned',
_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,
lastRead: userData.activity_panel_inbox_last_read,
};
} ),
withDispatch( ( dispatch ) => {
const { updateCurrentUserData } = dispatch( 'wc-api' );
return {
updateCurrentUserData,
};
} )
)( InboxPanel );