Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1031] Update GA links type #1032

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.label}
MSzalowski marked this conversation as resolved.
Show resolved Hide resolved
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;
};
}
Loading