-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
…, UI fixes
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { Component } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { Button, Header, Icon, Segment, Grid } from "semantic-ui-react"; | ||
import { withState } from "react-searchkit"; | ||
import { i18next } from "@translations/invenio_communities/i18next"; | ||
import { InvitationsContextProvider } from "../../api/invitations/InvitationsContextProvider"; | ||
import { InvitationsMembersModalWithSearchKit } from "./invitationsModal/InvitationsMembersModal"; | ||
|
||
class InvitationsEmptyResultsCmp extends Component { | ||
render() { | ||
const { | ||
resetQuery, | ||
extraContent, | ||
queryString, | ||
community, | ||
communityGroupsEnabled, | ||
rolesCanInvite | ||
Check failure on line 17 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.7, pypi, postgresql13, opensearch2)
Check failure on line 17 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.7, pypi, postgresql13, elasticsearch7)
Check failure on line 17 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7)
Check failure on line 17 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2)
Check failure on line 17 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7)
|
||
} = this.props; | ||
|
||
return ( | ||
<Segment.Group> | ||
<Segment as={Grid} className="computer only"> | ||
<Grid.Column width="13" /> | ||
<Grid.Column width="3"> | ||
<InvitationsContextProvider community={community}> | ||
<InvitationsMembersModalWithSearchKit | ||
rolesCanInvite={rolesCanInvite} | ||
groupsEnabled={communityGroupsEnabled} | ||
community={community} | ||
/> | ||
</InvitationsContextProvider> | ||
</Grid.Column> | ||
</Segment> | ||
<Segment placeholder textAlign="center"> | ||
<Header icon> | ||
<Icon name="search" /> | ||
{i18next.t("No matching members found.")} | ||
</Header> | ||
<p> | ||
{queryString && ( | ||
<em> | ||
{i18next.t("Current search")} "{queryString}" | ||
</em> | ||
)} | ||
</p> | ||
<Button primary onClick={() => resetQuery()}> | ||
{i18next.t("Clear query")} | ||
</Button> | ||
{extraContent} | ||
</Segment> | ||
</Segment.Group> | ||
); | ||
} | ||
} | ||
|
||
InvitationsEmptyResultsCmp.propTypes = { | ||
resetQuery: PropTypes.func.isRequired, | ||
queryString: PropTypes.string.isRequired, | ||
rolesCanInvite: PropTypes.object.isRequired, | ||
community: PropTypes.object.isRequired, | ||
communityGroupsEnabled: PropTypes.bool.isRequired, | ||
extraContent: PropTypes.node, | ||
}; | ||
|
||
InvitationsEmptyResultsCmp.defaultProps = { | ||
extraContent: null, | ||
} | ||
Check failure on line 67 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.7, pypi, postgresql13, opensearch2)
Check failure on line 67 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.7, pypi, postgresql13, elasticsearch7)
Check failure on line 67 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7)
Check failure on line 67 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2)
Check failure on line 67 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/invitations/InvitationsEmptyResults.js GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7)
|
||
|
||
export const InvitationsEmptyResults = withState(InvitationsEmptyResultsCmp); |