Skip to content

Commit

Permalink
Merge pull request #1032 from IntersectMBO/1031-update-ga-links-type
Browse files Browse the repository at this point in the history
[#1031] Update GA links type
  • Loading branch information
JanJaroszczak authored May 15, 2024
2 parents d7545cb + 4d6ab36 commit 7242721
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LinkWithIcon } from "@molecules";
export const GovernanceActionDetailsCardLinks = ({
links,
}: {
links?: string[];
links?: GovernanceActionLink[];
}) => {
const { isMobile } = useScreenDimension();
const { t } = useTranslation();
Expand Down Expand Up @@ -43,13 +43,13 @@ export const GovernanceActionDetailsCardLinks = ({
>
{links.map((link) => (
<LinkWithIcon
key={link}
label={link}
key={link.uri}
label={link.uri}
onClick={() => {
openModal({
type: "externalLink",
state: {
externalLink: link,
externalLink: link.uri,
},
});
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type GovernanceActionDetailsCardProps = {
motivation?: string;
rationale?: string;
yesVotes: number;
links?: string[];
links?: GovernanceActionLink[];
govActionId: string;
isDataMissing: boolean | MetadataValidationStatus;
isDashboard?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type GovernanceActionDetailsCardDataProps = {
isInProgress?: boolean;
isOneColumn: boolean;
isSubmitted?: boolean;
links?: string[];
links?: GovernanceActionLink[];
motivation?: string;
rationale?: string;
title?: string;
Expand Down
6 changes: 6 additions & 0 deletions govtool/frontend/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ declare global {

type ArrayElement<ArrayType extends readonly unknown[]> =
ArrayType extends readonly (infer ElementType)[] ? ElementType : never;

type GovernanceActionLink = {
"@type": string;
label: string;
uri: string;
};
}

0 comments on commit 7242721

Please sign in to comment.