Skip to content

Commit

Permalink
fix: getipfsurl on the attachedfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Jun 12, 2024
1 parent 660154d commit 99675d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/components/PreviewCard/Terms/AttachedFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import styled from "styled-components";
import { responsiveSize } from "styles/responsiveSize";
import AttachmentIcon from "svgs/icons/attachment.svg";
import { getIpfsUrl } from "utils/getIpfsUrl";

const StyledA = styled.a`
display: flex;
Expand All @@ -17,7 +18,7 @@ interface IAttachedFile {
}

const AttachedFile: React.FC<IAttachedFile> = ({ extraDescriptionUri }) => {
const href = extraDescriptionUri?.replace(/^ipfs:\/\//, "https://cdn.kleros.link/ipfs/");
const href = extraDescriptionUri && getIpfsUrl(extraDescriptionUri);

return extraDescriptionUri ? (
<StyledA href={href} target="_blank" rel="noreferrer">
Expand Down

0 comments on commit 99675d8

Please sign in to comment.