Skip to content

Commit

Permalink
Merge pull request #2923 from IntersectMBO/feat/2911-show-drep-metada…
Browse files Browse the repository at this point in the history
…ta-url-and-hash-on-detailed-profile-view

feat(#2911): show drep metadata url and hash on detailed profile view
  • Loading branch information
MSzalowski authored Feb 7, 2025
2 parents 07d521b + d58b8a6 commit b6384f7
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ changes.

### Added

-
- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)

### Fixed

Expand Down
48 changes: 48 additions & 0 deletions govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const DRepDetailsCard = ({
drepId,
votingPower,
isScriptBased,
metadataHash,
} = dRepData;

const groupedReferences = references?.reduce<Record<string, Reference[]>>(
Expand Down Expand Up @@ -235,6 +236,53 @@ export const DRepDetailsCard = ({
/>
)}
</DRepDetailsInfoItem>
{url && (
<DRepDetailsInfoItem
label={t("forms.dRepData.metadataUrl")}
dataTestId="metadata-url"
>
<Link
data-testid="metadata-url-link"
href={url}
target="_blank"
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
display: "flex",
gap: 1,
alignItems: "center",
}}
>
<Typography
color="primary"
fontWeight={400}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{url}
</Typography>
<img
alt="link"
height={16}
src={ICONS.externalLinkIcon}
width={16}
/>
</Link>
</DRepDetailsInfoItem>
)}
{metadataHash && (
<DRepDetailsInfoItem
label={t("forms.dRepData.metadataHash")}
dataTestId="metadata-hash"
>
<CopyableText
value={metadataHash}
dataTestId="copy-metadata-hash"
/>
</DRepDetailsInfoItem>
)}
</>
)}
{/* CIP-119 DATA END */}
Expand Down
4 changes: 3 additions & 1 deletion govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@
"references": "References",
"referenceDescription": "Description",
"referenceDescriptionHelpfulText": "Limit: 80 characters",
"referenceURL": "URL"
"referenceURL": "URL",
"metadataUrl": "Metadata URL",
"metadataHash": "Metadata Hash"
},
"errors": {
"tooLongUrl": "Url must be less than 128 bytes",
Expand Down

0 comments on commit b6384f7

Please sign in to comment.