diff --git a/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx b/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx index 3dda9eda9..89b802254 100644 --- a/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceActionCard.tsx @@ -11,7 +11,6 @@ import { import { useScreenDimension, useTranslation } from "@hooks"; import { - formatDisplayDate, getFullGovActionId, getProposalTypeLabel, getProposalTypeNoEmptySpaces, @@ -104,8 +103,8 @@ export const GovernanceActionCard: FC = ({ ...props }) => { isSliderCard /> , , @@ -100,7 +104,10 @@ export const GovernanceActionsDatesBox = ({ > , , diff --git a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx index b10d51564..6888484ad 100644 --- a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx @@ -5,7 +5,6 @@ import { Button } from "@atoms"; import { PATHS } from "@consts"; import { useScreenDimension, useTranslation } from "@hooks"; import { - formatDisplayDate, getFullGovActionId, getProposalTypeLabel, getProposalTypeNoEmptySpaces, @@ -94,8 +93,8 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => { isSliderCard /> { abstainVotes={ state ? state.abstainVotes : data.proposal.abstainVotes } - createdDate={ - state - ? formatDisplayDate(state.createdDate) - : formatDisplayDate(data.proposal.createdDate) - } + createdDate={state ? state.createdDate : data.proposal.createdDate} createdEpochNo={ state ? state.createdEpochNo : data.proposal.createdEpochNo } isDataMissing={ state ? state.metadataStatus : data?.proposal.metadataStatus } - expiryDate={ - state - ? formatDisplayDate(state.expiryDate) - : formatDisplayDate(data?.proposal.expiryDate) - } + expiryDate={state ? state.expiryDate : data?.proposal.expiryDate} expiryEpochNo={ state ? state.expiryEpochNo : data.proposal.expiryEpochNo } diff --git a/govtool/frontend/src/models/api.ts b/govtool/frontend/src/models/api.ts index 551733868..3807a926a 100644 --- a/govtool/frontend/src/models/api.ts +++ b/govtool/frontend/src/models/api.ts @@ -28,6 +28,7 @@ export enum DRepListSort { export interface DrepDataDTO { deposit: number; drepId: string; + latestRegistrationDate: string; latestTxHash?: string; metadataHash?: string; status: DRepStatus; @@ -64,8 +65,8 @@ export type ProposalDataDTO = { createdDate: string; createdEpochNo: number; details?: ActionDetailsType; - expiryDate: string; - expiryEpochNo: number; + expiryDate?: string; + expiryEpochNo?: number; id: string; index: number; metadataHash: string; diff --git a/govtool/frontend/src/pages/GovernanceActionDetails.tsx b/govtool/frontend/src/pages/GovernanceActionDetails.tsx index ad1666baa..b6279182a 100644 --- a/govtool/frontend/src/pages/GovernanceActionDetails.tsx +++ b/govtool/frontend/src/pages/GovernanceActionDetails.tsx @@ -17,7 +17,6 @@ import { } from "@hooks"; import { Footer, TopNav, GovernanceActionDetailsCard } from "@organisms"; import { - formatDisplayDate, getProposalTypeLabel, WALLET_LS_KEY, getItemFromLocalStorage, @@ -131,9 +130,7 @@ export const GovernanceActionDetails = () => { state ? state.abstainVotes : data.proposal.abstainVotes } createdDate={ - state - ? formatDisplayDate(state.createdDate) - : formatDisplayDate(data.proposal.createdDate) + state ? state.createdDate : data.proposal.createdDate } createdEpochNo={ state ? state.createdEpochNo : data.proposal.createdEpochNo @@ -142,9 +139,7 @@ export const GovernanceActionDetails = () => { state ? state.metadataStatus : data?.proposal.metadataStatus } expiryDate={ - state - ? formatDisplayDate(state.expiryDate) - : formatDisplayDate(data.proposal.expiryDate) + state ? state.expiryDate : data.proposal.expiryDate } expiryEpochNo={ state ? state.expiryEpochNo : data.proposal.expiryEpochNo diff --git a/govtool/frontend/src/utils/tests/dRep.test.ts b/govtool/frontend/src/utils/tests/dRep.test.ts index d6e026154..26d4cfb7d 100644 --- a/govtool/frontend/src/utils/tests/dRep.test.ts +++ b/govtool/frontend/src/utils/tests/dRep.test.ts @@ -1,10 +1,10 @@ import { isSameDRep } from ".."; -import { DRepStatus } from "@/models"; +import { DRepData, DRepStatus } from "@/models"; type TDRepType = "DRep" | "SoleVoter"; -const EXAMPLE_DREP = { +const EXAMPLE_DREP: DRepData = { drepId: "drep123", view: "view123", url: "url", @@ -19,6 +19,7 @@ const EXAMPLE_DREP = { references: [], metadataStatus: null, metadataValid: true, + latestRegistrationDate: "2024-07-10", }; describe("isSameDRep function", () => {