Skip to content

Commit

Permalink
fix(networks): citations badge only for publications
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Feb 5, 2025
1 parent e135e20 commit b24a702
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions client/src/pages/networks/components/clusters/items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ClusterItemArgs = {
function ClusterItem({ currentModel, community }: ClusterItemArgs) {
const intl = useIntl()
const currentYear = new Date().getFullYear()
const { currentSource } = useOptions()
const [showNodesModal, setShowNodesModal] = useState(false)
const [showPublicationsModal, setShowPublicationsModal] = useState(false)
const { setFocusItem } = useNetworkContext()
Expand Down Expand Up @@ -71,11 +72,15 @@ function ClusterItem({ currentModel, community }: ClusterItemArgs) {
<Badge size="sm" color="yellow-tournesol">
{`${intl.formatMessage({ id: "networks.section.clusters.last-activity" })}: ${community?.maxYear || "N/A"}`}
</Badge>
<Badge size="sm" color="blue-cumulus">{`${intl.formatMessage(
{ id: "networks.section.clusters.citations" },
{ count: community.citationsRecent }
)} (${currentYear - 1}-${currentYear})`}</Badge>
<Badge size="sm" color="blue-ecume">{`Citation score: ${community.citationsScore.toFixed(1)}`}</Badge>
{currentSource === "publications" && (
<>
<Badge size="sm" color="blue-cumulus">{`${intl.formatMessage(
{ id: "networks.section.clusters.citations" },
{ count: community.citationsRecent }
)} (${currentYear - 1}-${currentYear})`}</Badge>
<Badge size="sm" color="blue-ecume">{`Citation score: ${community.citationsScore.toFixed(1)}`}</Badge>
</>
)}
</BadgeGroup>
</Col>
</Row>
Expand Down

0 comments on commit b24a702

Please sign in to comment.