Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: added verify icon in community list #1236

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PropTypes from "prop-types";
import _truncate from "lodash/truncate";

import { Image, InvenioPopup } from "react-invenio-forms";
import { Icon, Label, Item } from "semantic-ui-react";
import { Icon, Label, Item, Popup } from "semantic-ui-react";
import { CommunityTypeLabel, RestrictedLabel } from "../labels";

export const CommunityCompactItemComputer = ({
Expand Down Expand Up @@ -46,7 +46,18 @@ export const CommunityCompactItemComputer = ({
rel="noreferrer"
aria-label={`${metadata.title} (${i18next.t("opens in new tab")})`}
>
{metadata.title}
{metadata.title}{" "}
{result.is_verified && (
<p className="ml-5 display-inline-block">
<Popup
content="Verified community"
trigger={
<Icon size="small" color="green" name="check circle outline" />
}
position="top center"
/>
</p>
)}
</a>
<i className="small icon external primary" aria-hidden="true" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { RestrictedLabel } from "../labels";
import _truncate from "lodash/truncate";
import React from "react";
import { Image, InvenioPopup } from "react-invenio-forms";
import { Icon, Label } from "semantic-ui-react";
import { Icon, Label, Popup } from "semantic-ui-react";
import PropTypes from "prop-types";

export const CommunityCompactItemMobile = ({
Expand Down Expand Up @@ -44,7 +44,18 @@ export const CommunityCompactItemMobile = ({
rel="noreferrer"
aria-label={`${metadata.title} (${i18next.t("opens in new tab")})`}
>
{metadata.title}
{metadata.title}{" "}
{result.is_verified && (
<p className="ml-5 display-inline-block">
<Popup
content="Verified community"
trigger={
<Icon size="small" color="green" name="check circle outline" />
}
position="top center"
/>
</p>
)}
</a>
<i className="small icon external primary" aria-hidden="true" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CommunityTypeLabel } from "../labels";
import { RestrictedLabel } from "../labels";
import React from "react";
import { Image } from "react-invenio-forms";
import { Button, Grid, Icon } from "semantic-ui-react";
import { Button, Grid, Icon, Popup, Header } from "semantic-ui-react";
import PropTypes from "prop-types";
import OrganizationsList from "../../organizations/OrganizationsList";

Expand Down Expand Up @@ -39,14 +39,33 @@ export const CommunityItemComputer = ({ result }) => {
<RestrictedLabel access={result.access.visibility} />
</div>
)}
<a className="ui medium header mb-0" href={result.links.self_html}>
<Header as="a" className="ui medium header" href={result.links.self_html}>
{result.metadata.title}
</a>
{result.is_verified && (
<p className="ml-5 display-inline-block">
<Popup
content="Verified community"
trigger={
<Icon size="small" color="green" name="check circle outline" />
}
position="top center"
/>
</p>
)}
</Header>
{result.metadata.description && (
<p className="truncate-lines-1 text size small text-muted mt-5">
{result.metadata.description}
</p>
)}
{result.parent && (
<div className="sub header">
Part of{" "}
<a href={`/communities/${result.parent.slug}`}>
{result.parent.metadata.title}
</a>
</div>
)}

{(communityType ||
result.metadata.website ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CommunityTypeLabel } from "../labels";
import { RestrictedLabel } from "../labels";
import React from "react";
import { Image } from "react-invenio-forms";
import { Button, Grid, Icon } from "semantic-ui-react";
import { Button, Grid, Icon, Popup, Header } from "semantic-ui-react";
import PropTypes from "prop-types";
import OrganizationsList from "../../organizations/OrganizationsList";

Expand Down Expand Up @@ -41,12 +41,20 @@ export const CommunityItemMobile = ({ result, index }) => {
alt=""
/>
<div>
<a
className="truncate-lines-2 ui medium header m-0"
href={result.links.self_html}
>
<Header as="a" className="ui medium header" href={result.links.self_html}>
{result.metadata.title}
</a>
{result.is_verified && (
<p className="ml-5 display-inline-block">
<Popup
content="Verified community"
trigger={
<Icon size="small" color="green" name="check circle outline" />
}
position="top center"
/>
</p>
)}
</Header>
</div>
</div>
</Grid.Column>
Expand Down Expand Up @@ -80,6 +88,14 @@ export const CommunityItemMobile = ({ result, index }) => {
</Grid.Column>
</Grid.Row>
)}
{result.parent && (
<div className="pl-0 sub header">
Part of{" "}
<a href={`/communities/${result.parent.slug}`}>
{result.parent.metadata.title}
</a>
</div>
)}

{(communityType || result.metadata.website || result.metadata.organizations) && (
<Grid.Row className="pt-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
{% endif %}
{% if community.parent %}
<div class="inline-computer mt-5 rel-mr-1">
<i class="sitemap icon" aria-hidden="true"></i>
<span class="ui tiny header">Part of </span>
<a
href="{{ url_for('invenio_app_rdm_communities.communities_home', pid_value=community.parent.slug) }}">
{{community.parent.metadata.title}}
Expand Down
Loading