From c40839f1f621040cc120c16e18b402ea1ad0e420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Tue, 5 Mar 2024 16:47:41 +0100 Subject: [PATCH] [#379] create the propose a governance action card --- .../public/images/ProposeGovAction.png | Bin 0 -> 10302 bytes govtool/frontend/src/App.tsx | 16 ++--- .../src/components/atoms/ScrollToManage.tsx | 8 +-- .../molecules/GovernanceVotedOnCard.tsx | 2 +- .../components/organisms/DashboardCards.tsx | 29 ++++++++- .../DashboardGovernanceActionDetails.tsx | 6 +- .../organisms/GovernanceActionsToVote.tsx | 4 +- .../src/components/organisms/HomeCards.tsx | 57 ++++++++++++------ .../src/components/organisms/Slider.tsx | 15 ++--- govtool/frontend/src/consts/images.ts | 5 +- govtool/frontend/src/consts/navItems.ts | 4 +- govtool/frontend/src/consts/paths.ts | 16 ++--- .../src/hooks/forms/useVoteActionForm.tsx | 2 +- govtool/frontend/src/i18n/locales/en.ts | 47 ++++++++++----- govtool/frontend/src/pages/Dashboard.tsx | 4 +- .../DashboardGovernanceActionsCategory.tsx | 6 +- .../src/pages/GovernanceActionDetails.tsx | 6 +- .../frontend/src/pages/GovernanceActions.tsx | 2 +- .../src/pages/GovernanceActionsCategory.tsx | 6 +- 19 files changed, 149 insertions(+), 86 deletions(-) create mode 100644 govtool/frontend/public/images/ProposeGovAction.png diff --git a/govtool/frontend/public/images/ProposeGovAction.png b/govtool/frontend/public/images/ProposeGovAction.png new file mode 100644 index 0000000000000000000000000000000000000000..a355503a3a2813ba522dd44bcf3b64fea17ea3bb GIT binary patch literal 10302 zcmV-ED8bi>P)or){`Ygu$&CO(6F{^Hl&Ec`iWnnkt0@JCGOd-VLmh3krPC=oOqsURPO-p@ z#Y$%sOGiYMsUTP`BZP2~5EDX30+Rbl$hrLYeOZ_9^LgI)TYLWrCpqWja6&TUO4jUs z{=N6wYd!0|Jn!?q-xhg>Y~hO`FYkKfZPh&|H=AR-ZU z=Dy7kzBzfhJP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djc4Bh9G z;X>k6a%=;JBoM$p7rPQ9o(LAfO1>=2jBPE z#{1tQ;h%L1oX#sfxNr4&x5#&Jdqx7vtrv>_*i6wSY=vwa_Wpf$m3vC~=HqS8SU~$f z`GWh)X?Z=mq7UeAF@>;`WbR$^H`}>w_rCXrE06xs%^y1c(YszEPlN5R0rSZV|M~R- Q9smFU07*qoM6N<$f`jN9wg3PC literal 0 HcmV?d00001 diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index 13bc34a7d..eb8ce5eb7 100644 --- a/govtool/frontend/src/App.tsx +++ b/govtool/frontend/src/App.tsx @@ -56,8 +56,8 @@ export default function App() { const checkTheWalletIsActive = useCallback(() => { const hrefCondition = window.location.pathname === PATHS.home || - window.location.pathname === PATHS.governance_actions || - window.location.pathname === PATHS.governance_actions_action; + window.location.pathname === PATHS.governanceActions || + window.location.pathname === PATHS.governanceActionsAction; const walletName = getItemFromLocalStorage(`${WALLET_LS_KEY}_name`); if (window.cardano) { @@ -89,29 +89,29 @@ export default function App() { } /> } > } /> } /> }> } /> } /> } /> } /> diff --git a/govtool/frontend/src/components/atoms/ScrollToManage.tsx b/govtool/frontend/src/components/atoms/ScrollToManage.tsx index 49046d36b..1b1ff7e1a 100644 --- a/govtool/frontend/src/components/atoms/ScrollToManage.tsx +++ b/govtool/frontend/src/components/atoms/ScrollToManage.tsx @@ -25,8 +25,8 @@ export const ScrollToManage = () => { window.scrollTo(0, pathMap.get(pathname)!); } else { if ( - pathname === PATHS.dashboard_governance_actions || - pathname === PATHS.governance_actions + pathname === PATHS.dashboardGovernanceActions || + pathname === PATHS.governanceActions ) { pathMap.set(pathname, 0); } @@ -37,8 +37,8 @@ export const ScrollToManage = () => { useEffect(() => { const fn = debounce(() => { if ( - pathname === PATHS.dashboard_governance_actions || - pathname === PATHS.governance_actions + pathname === PATHS.dashboardGovernanceActions || + pathname === PATHS.governanceActions ) { pathMap.set(pathname, window.scrollY); } diff --git a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx index 58ff325a7..f5181769d 100644 --- a/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx @@ -255,7 +255,7 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => { )}-change-your-vote`} onClick={() => navigate( - PATHS.dashboard_governance_actions_action.replace( + PATHS.dashboardGovernanceActionsAction.replace( ":proposalId", getFullGovActionId(proposal.txHash, proposal.index) ), diff --git a/govtool/frontend/src/components/organisms/DashboardCards.tsx b/govtool/frontend/src/components/organisms/DashboardCards.tsx index 64075b3a8..79df4e098 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards.tsx @@ -503,7 +503,7 @@ export const DashboardCards = () => { "https://docs.sanchogov.tools/faqs/what-does-it-mean-to-register-as-a-drep" ) } - secondButtonVariant={"outlined"} + secondButtonVariant="outlined" imageURL={IMAGES.soleVoterImage} /> {/* REGISTARTION AS SOLE VOTER CARD END*/} @@ -511,7 +511,7 @@ export const DashboardCards = () => { navigate(PATHS.dashboard_governance_actions)} + firstButtonAction={() => navigate(PATHS.dashboardGovernanceActions)} firstButtonLabel={t( `dashboard.govActions.${ voter?.isRegisteredAsDRep ? "reviewAndVote" : "view" @@ -521,6 +521,31 @@ export const DashboardCards = () => { title={t("dashboard.govActions.title")} /> {/* GOV ACTIONS LIST CARD END*/} + {/* GOV ACTIONS LIST CARD */} + navigate(PATHS.proposeGovernanceActions)} + firstButtonLabel={t( + `dashboard.proposeGovernanceAction.${ + // TODO: add isPendingGovernanceAction to the context + // isPendingGovernanceAction ? "propose" : "viewGovernanceActions" + `propose` + }` + )} + secondButtonLabel={t("learnMore")} + secondButtonAction={() => + openInNewTab( + "https://docs.sanchogov.tools/faqs/what-is-a-governance-action" + ) + } + secondButtonVariant="outlined" + imageURL={IMAGES.proposeGovActionImage} + title={t("dashboard.proposeGovernanceAction.title")} + /> + {/* GOV ACTIONS LIST CARD END*/} ); }; diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActionDetails.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActionDetails.tsx index 413f76818..815b1f37f 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActionDetails.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActionDetails.tsx @@ -46,7 +46,7 @@ export const DashboardGovernanceActionDetails = () => { const breadcrumbs = [ @@ -87,10 +87,10 @@ export const DashboardGovernanceActionDetails = () => { onClick={() => navigate( state && state.openedFromCategoryPage - ? generatePath(PATHS.dashboard_governance_actions_category, { + ? generatePath(PATHS.dashboardGovernanceActionsCategory, { category: state.type, }) - : PATHS.dashboard_governance_actions, + : PATHS.dashboardGovernanceActions, { state: { isVotedListOnLoad: state && state.vote ? true : false, diff --git a/govtool/frontend/src/components/organisms/GovernanceActionsToVote.tsx b/govtool/frontend/src/components/organisms/GovernanceActionsToVote.tsx index 7058ce106..c457062c5 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionsToVote.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionsToVote.tsx @@ -113,7 +113,7 @@ export const GovernanceActionsToVote = ({ : navigate( onDashboard ? generatePath( - PATHS.dashboard_governance_actions_action, + PATHS.dashboardGovernanceActionsAction, { proposalId: getFullGovActionId( item.txHash, @@ -121,7 +121,7 @@ export const GovernanceActionsToVote = ({ ), } ) - : PATHS.governance_actions_action.replace( + : PATHS.governanceActionsAction.replace( ":proposalId", getFullGovActionId( item.txHash, diff --git a/govtool/frontend/src/components/organisms/HomeCards.tsx b/govtool/frontend/src/components/organisms/HomeCards.tsx index c1ba526ba..4539587c1 100644 --- a/govtool/frontend/src/components/organisms/HomeCards.tsx +++ b/govtool/frontend/src/components/organisms/HomeCards.tsx @@ -35,12 +35,19 @@ export const HomeCards = () => { ); const onClickLearnMoreAboutSoleVoterRegistration = useCallback( - () => openInNewTab("https://www.google.com"), + // TODO: Update the link + () => openInNewTab("https://docs.sanchogov.tools/"), + [] + ); + + const onClickLearnMoreAboutProposingGovAction = useCallback( + // TODO: Update the link + () => openInNewTab("https://docs.sanchogov.tools/"), [] ); const navigateToGovActions = useCallback( - () => navigate(PATHS.governance_actions), + () => navigate(PATHS.governanceActions), [navigate] ); @@ -67,59 +74,75 @@ export const HomeCards = () => { {/* DELEGATE CARD END*/} {/* REGISTER AS DREP CARD */} {/* REGISTER AS DREP CARD END */} {/* REGISTER AS SOLE VOTER CARD */} {/* REGISTER AS SOLE VOTER CARD END */} {/* GOV ACTIONS CARD */} - {/* GOV ACTIONS CARD */} + {/* GOV ACTIONS CARD END*/} + {/* PROPOSE GOV ACTION CARD */} + + {/* PROPOSE GOV ACTION CARD END*/} ); }; diff --git a/govtool/frontend/src/components/organisms/Slider.tsx b/govtool/frontend/src/components/organisms/Slider.tsx index e6024a772..07bf2cd90 100644 --- a/govtool/frontend/src/components/organisms/Slider.tsx +++ b/govtool/frontend/src/components/organisms/Slider.tsx @@ -105,12 +105,12 @@ export const Slider = ({ onClick={() => onDashboard ? navigate( - generatePath(PATHS.dashboard_governance_actions_category, { + generatePath(PATHS.dashboardGovernanceActionsCategory, { category: navigateKey, }) ) : navigate( - generatePath(PATHS.governance_actions_category, { + generatePath(PATHS.governanceActionsCategory, { category: navigateKey, }) ) @@ -157,15 +157,12 @@ export const Slider = ({ onClick={() => onDashboard ? navigate( - generatePath( - PATHS.dashboard_governance_actions_category, - { - category: navigateKey, - } - ) + generatePath(PATHS.dashboardGovernanceActionsCategory, { + category: navigateKey, + }) ) : navigate( - generatePath(PATHS.governance_actions_category, { + generatePath(PATHS.governanceActionsCategory, { category: navigateKey, }) ) diff --git a/govtool/frontend/src/consts/images.ts b/govtool/frontend/src/consts/images.ts index 72f60559d..7f97c824a 100644 --- a/govtool/frontend/src/consts/images.ts +++ b/govtool/frontend/src/consts/images.ts @@ -4,12 +4,13 @@ export const IMAGES = { bgBlue: "/images/BGBlue.png", bgOrange: "/images/BGOrange.png", errorPageImage: "/images/ErrorPageImage.png", - heroImage: "/images/HeroImage.png", - soleVoterImage: "/images/GovActionsSoleVoter.png", govActionDefaultImage: "/images/GovActionDefault.png", govActionDelegateImage: "/images/GovActionDelegate.png", govActionListImage: "/images/GovActionList.png", govActionRegisterImage: "/images/GovActionRegister.png", + heroImage: "/images/HeroImage.png", + proposeGovActionImage: "/images/ProposeGovAction.png", + soleVoterImage: "/images/GovActionsSoleVoter.png", successImage: "/images/Success.png", warningImage: "/images/Warning.png", warningYellowImage: "/images/WarningYellow.png", diff --git a/govtool/frontend/src/consts/navItems.ts b/govtool/frontend/src/consts/navItems.ts index d46bbd6e1..1c3d0ec37 100644 --- a/govtool/frontend/src/consts/navItems.ts +++ b/govtool/frontend/src/consts/navItems.ts @@ -10,7 +10,7 @@ export const NAV_ITEMS = [ }, { dataTestId: "governance-actions-link", - navTo: PATHS.governance_actions, + navTo: PATHS.governanceActions, label: "Governance Actions", newTabLink: null, }, @@ -40,7 +40,7 @@ export const CONNECTED_NAV_ITEMS = [ { dataTestId: "governance-actions-link", label: "Governance Actions", - navTo: PATHS.dashboard_governance_actions, + navTo: PATHS.dashboardGovernanceActions, activeIcon: ICONS.governanceActionsActiveIcon, icon: ICONS.governanceActionsIcon, newTabLink: null, diff --git a/govtool/frontend/src/consts/paths.ts b/govtool/frontend/src/consts/paths.ts index 4ac0cbde2..8d785bddc 100644 --- a/govtool/frontend/src/consts/paths.ts +++ b/govtool/frontend/src/consts/paths.ts @@ -1,18 +1,17 @@ export const PATHS = { - dashboard_governance_actions_action: - "/connected/governance_actions/:proposalId", - dashboard_governance_actions_category: + dashboardGovernanceActionsAction: "/connected/governance_actions/:proposalId", + dashboardGovernanceActionsCategory: "/connected/governance_actions/category/:category", - dashboard_governance_actions: "/connected/governance_actions", + dashboardGovernanceActions: "/connected/governance_actions", dashboard: "/dashboard", delegateTodRep: "/delegate", error: "/error", faqs: "/faqs", - governance_actions_action: "/governance_actions/:proposalId", - governance_actions_category_action: + governanceActionsAction: "/governance_actions/:proposalId", + governanceActionsCategoryAction: "/governance_actions/category/:category/:proposalId", - governance_actions_category: "/governance_actions/category/:category", - governance_actions: "/governance_actions", + governanceActionsCategory: "/governance_actions/category/:category", + governanceActions: "/governance_actions", guides: "/guides", home: "/", registerAsdRep: "/register", @@ -20,4 +19,5 @@ export const PATHS = { retireAsSoleVoter: "/retire_sole_voter", stakeKeys: "/stake_keys", updateMetadata: "/update_metadata", + proposeGovernanceActions: "/propose_governance_actions", }; diff --git a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx index cf1a0cbe0..30fd331aa 100644 --- a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx +++ b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx @@ -110,7 +110,7 @@ export const useVoteActionForm = () => { }); if (result) { addSuccessAlert("Vote submitted"); - navigate(PATHS.dashboard_governance_actions, { + navigate(PATHS.dashboardGovernanceActions, { state: { isVotedListOnLoad: state && state.vote ? true : false, }, diff --git a/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index 3c9d6e006..b89bccc5e 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -80,6 +80,12 @@ export const en = { title: "Governance Actions", view: "View governance actions", }, + proposeGovernanceAction: { + title: "Propose a Governance Action", + description: "Submit your proposal for a Governance Action.", + propose: "Propose", + view: "View governance actions", + }, registration: { changeMetadata: "Change metadata", dRepRegistration: "DRep Registration", @@ -242,21 +248,32 @@ export const en = { }, home: { cards: { - delegateDescription: "Find a DRep to vote on your behalf.", - delegateFirstButtonLabel: "View DRep Direcotry", - delegateTitle: "Delegate your Voting Power", - governaneActionsDescription: - "See all the Governance Actions submitted on chain. ", - governanceActionsFirstButtonLabel: "View Governance Actions", - governaneActionsTitle: "View Governance Actions", - registerAsDRepDescription: - "Accept delegated voting power from other ADA holders, and combine it with your own voting power. Vote with the accumulated Power on Governance Actions.", - registerAsDRepFirstButtonLabel: "Connect to Register", - registerAsDRepTitle: "Become a DRep", - registerAsSoleVoterDescription: - "Vote on Governance Actions using your own voting power", - registerAsSoleVoterFirstButtonLabel: "Connect to Register", - registerAsSoleVoterTitle: "Become a Sole Voter", + delegate: { + description: "Find a DRep to vote on your behalf.", + firstButtonLabel: "View DRep Directory", + title: "Delegate your Voting Power", + }, + governanceActions: { + description: "See all the Governance Actions submitted on chain. ", + firstButtonLabel: "View Governance Actions", + title: "View Governance Actions", + }, + proposeAGovernanceAction: { + description: "Submit your proposal for a Governance Action.", + firstButtonLabel: "Connect to Submit", + title: "Propose a Governance Action", + }, + registerAsDRep: { + description: + "Accept delegated voting power from other ADA holders, and combine it with your own voting power. Vote with the accumulated Power on Governance Actions.", + firstButtonLabel: "Connect to Register", + title: "Become a DRep", + }, + registerAsSoleVoter: { + description: "Vote on Governance Actions using your own voting power", + firstButtonLabel: "Connect to Register", + title: "Become a Sole Voter", + }, }, }, menu: { diff --git a/govtool/frontend/src/pages/Dashboard.tsx b/govtool/frontend/src/pages/Dashboard.tsx index 992897916..cda265b50 100644 --- a/govtool/frontend/src/pages/Dashboard.tsx +++ b/govtool/frontend/src/pages/Dashboard.tsx @@ -20,7 +20,7 @@ export const Dashboard = () => { const getPageTitle = (pathname: string) => { if (pathname === PATHS.dashboard) { return t("dashboard.title"); - } else if (pathname.includes(PATHS.dashboard_governance_actions)) { + } else if (pathname.includes(PATHS.dashboardGovernanceActions)) { return t("dashboard.govActions.title"); } return ""; @@ -28,7 +28,7 @@ export const Dashboard = () => { useEffect(() => { if (divRef.current) { - pathname !== PATHS.dashboard_governance_actions && + pathname !== PATHS.dashboardGovernanceActions && divRef.current.scrollTo({ top: 0 }); } }, [pathname, divRef]); diff --git a/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx b/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx index 1fffa539d..15fd8ed44 100644 --- a/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx +++ b/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx @@ -69,7 +69,7 @@ export const DashboardGovernanceActionsCategory = () => { {t("govActions.title")} @@ -127,7 +127,7 @@ export const DashboardGovernanceActionsCategory = () => { textDecoration: "none", marginBottom: 3, }} - onClick={() => navigate(PATHS.dashboard_governance_actions)} + onClick={() => navigate(PATHS.dashboardGovernanceActions)} > { ) : navigate( generatePath( - PATHS.dashboard_governance_actions_action, + PATHS.dashboardGovernanceActionsAction, { proposalId: getFullGovActionId( item.txHash, diff --git a/govtool/frontend/src/pages/GovernanceActionDetails.tsx b/govtool/frontend/src/pages/GovernanceActionDetails.tsx index 76c26e93b..cabb8b1eb 100644 --- a/govtool/frontend/src/pages/GovernanceActionDetails.tsx +++ b/govtool/frontend/src/pages/GovernanceActionDetails.tsx @@ -51,7 +51,7 @@ export const GovernanceActionDetails = () => { const breadcrumbs = [ @@ -104,10 +104,10 @@ export const GovernanceActionDetails = () => { onClick={() => navigate( state && state.openedFromCategoryPage - ? generatePath(PATHS.governance_actions_category, { + ? generatePath(PATHS.governanceActionsCategory, { category: state.type, }) - : PATHS.governance_actions + : PATHS.governanceActions ) } > diff --git a/govtool/frontend/src/pages/GovernanceActions.tsx b/govtool/frontend/src/pages/GovernanceActions.tsx index ee4c2f561..2867a6ccf 100644 --- a/govtool/frontend/src/pages/GovernanceActions.tsx +++ b/govtool/frontend/src/pages/GovernanceActions.tsx @@ -23,7 +23,7 @@ export const GovernanceActions = () => { useEffect(() => { if (isEnabled && getItemFromLocalStorage(`${WALLET_LS_KEY}_stake_key`)) { - navigate(PATHS.dashboard_governance_actions); + navigate(PATHS.dashboardGovernanceActions); } }, [isEnabled]); diff --git a/govtool/frontend/src/pages/GovernanceActionsCategory.tsx b/govtool/frontend/src/pages/GovernanceActionsCategory.tsx index ef6c40a50..13b9b92e6 100644 --- a/govtool/frontend/src/pages/GovernanceActionsCategory.tsx +++ b/govtool/frontend/src/pages/GovernanceActionsCategory.tsx @@ -66,7 +66,7 @@ export const GovernanceActionsCategory = () => { const breadcrumbs = [ @@ -148,7 +148,7 @@ export const GovernanceActionsCategory = () => { textDecoration: "none", marginBottom: 4.25, }} - onClick={() => navigate(PATHS.dashboard_governance_actions)} + onClick={() => navigate(PATHS.dashboardGovernanceActions)} > { saveScrollPosition(); navigate( - PATHS.governance_actions_action.replace( + PATHS.governanceActionsAction.replace( ":proposalId", getFullGovActionId(item.txHash, item.index) ),