diff --git a/CHANGELOG.md b/CHANGELOG.md index e77f1fb49..827cd4ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ changes. ### Changed -- +- Split New constitution on-chain details into tabs ### Removed diff --git a/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index 55b16c656..24d068e3d 100644 --- a/govtool/frontend/package-lock.json +++ b/govtool/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "@govtool/frontend", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@govtool/frontend", - "version": "2.0.1", + "version": "2.0.2", "hasInstallScript": true, "dependencies": { "@emotion/react": "^11.11.1", diff --git a/govtool/frontend/src/components/molecules/GovernanceActionNewConstitutionDetailsTabContent.tsx b/govtool/frontend/src/components/molecules/GovernanceActionNewConstitutionDetailsTabContent.tsx new file mode 100644 index 000000000..82e9e26f5 --- /dev/null +++ b/govtool/frontend/src/components/molecules/GovernanceActionNewConstitutionDetailsTabContent.tsx @@ -0,0 +1,30 @@ +import { Box } from "@mui/material"; + +import { NewConstitutionAnchor, ProposalData } from "@/models"; +import { useScreenDimension } from "@/hooks"; + +import { GovernanceActionCardElement } from "./GovernanceActionCardElement"; + +export const GovernanceActionNewConstitutionDetailsTabContent = ({ + details, +}: Pick) => { + const { screenWidth } = useScreenDimension(); + return ( + + 1600 ? "longText" : "oneLine"} + /> + 1600 ? "longText" : "oneLine"} + /> + + ); +}; diff --git a/govtool/frontend/src/components/molecules/index.ts b/govtool/frontend/src/components/molecules/index.ts index 89005427a..1335d5237 100644 --- a/govtool/frontend/src/components/molecules/index.ts +++ b/govtool/frontend/src/components/molecules/index.ts @@ -28,6 +28,7 @@ export * from "./GovernanceActionDetailsCardLinks"; export * from "./GovernanceActionDetailsCardOnChainData"; export * from "./GovernanceActionDetailsCardVotes"; export * from "./GovernanceActionDetailsDiffView"; +export * from "./GovernanceActionNewConstitutionDetailsTabContent"; export * from "./GovernanceActionNewCommitteeDetailsTabContent"; export * from "./GovernanceActionsDatesBox"; export * from "./GovernanceVotedOnCard"; diff --git a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx index 8928a6566..149eebeb3 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx @@ -11,6 +11,7 @@ import { GovernanceActionDetailsDiffView, GovernanceActionNewCommitteeDetailsTabContent, GovernanceActionCardTreasuryWithdrawalElement, + GovernanceActionNewConstitutionDetailsTabContent, } from "@molecules"; import { useScreenDimension, useTranslation } from "@hooks"; import { @@ -22,11 +23,7 @@ import { mapArrayToObjectByKeys, encodeCIP129Identifier, } from "@utils"; -import { - MetadataValidationStatus, - NewConstitutionAnchor, - ProposalData, -} from "@models"; +import { MetadataValidationStatus, ProposalData } from "@models"; import { GovernanceActionType } from "@/types/governanceAction"; import { useAppContext } from "@/context"; @@ -200,6 +197,19 @@ export const GovernanceActionDetailsCardData = ({ ), visible: type === GovernanceActionType.NewCommittee && !!details, }, + { + label: "Details", + dataTestId: "parameters-tab", + content: ( + + ), + visible: + type === GovernanceActionType.NewConstitution && + !!details && + !!details?.anchor, + }, ].filter((tab) => tab.visible), [ abstract, @@ -307,26 +317,6 @@ export const GovernanceActionDetailsCardData = ({ amount={withdrawal.amount} /> ))} - {details?.anchor && type === GovernanceActionType.NewConstitution && ( - <> - 1600 ? "longText" : "oneLine"} - /> - 1600 ? "longText" : "oneLine"} - /> - - )} );