Skip to content

Commit

Permalink
ui: refactored and generalized OrganizationsList
Browse files Browse the repository at this point in the history
  • Loading branch information
0einstein0 committed Nov 29, 2024
1 parent 95ab2b5 commit 14613f8
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ const OrganizationsList = ({ organizations }) => {
<i className="building outline icon" aria-hidden="true" />
{organizations[0].id ? (
<a
href={`https://ror.org/${organizations[0].id}`}
aria-label={`${organizations[0].name}'s ROR profile`}
title={`${organizations[0].name}'s ROR profile`}
href={organizations[0].url}
aria-label={`${organizations[0].name}'s ${organizations[0].label} profile`}
title={`${organizations[0].name}'s ${organizations[0].label} profile`}
target="_blank"
rel="noreferrer"
>
{organizations[0].name}
<span>&nbsp;</span>
<img
className="inline-id-icon"
src="/static/images/ror-icon.svg"
alt={`${organizations[0].name}'s ROR profile`}
src={organizations[0].icon}
alt={`${organizations[0].name}'s ${organizations[0].label} profile`}
/>
</a>
) : (
Expand All @@ -50,18 +50,18 @@ const OrganizationsList = ({ organizations }) => {
<div key={org.id || org.name} className="inline-computer mt-5">
{org.id ? (
<a
href={`https://ror.org/${org.id}`}
aria-label={`${org.name}'s ROR profile`}
title={`${org.name}'s ROR profile`}
href={org.url}
aria-label={`${org.name}'s ${org.label} profile`}
title={`${org.name}'s ${org.label} profile`}
target="_blank"
rel="noreferrer"
>
{org.name}
<span>&nbsp;</span>
<img
className="inline-id-icon"
src="/static/images/ror-icon.svg"
alt={`${organizations[0].name}'s ROR profile`}
src={org.icon}
alt={`${org.name}'s ${org.label} profile`}
/>
</a>
) : (
Expand Down Expand Up @@ -89,6 +89,9 @@ OrganizationsList.propTypes = {
PropTypes.shape({
id: PropTypes.string,
name: PropTypes.string.isRequired,
label: PropTypes.string,
icon: PropTypes.string,
url: PropTypes.string,
})
).isRequired,
};
Expand Down

0 comments on commit 14613f8

Please sign in to comment.