diff --git a/govtool/frontend/public/images/ProposeGovAction.png b/govtool/frontend/public/images/ProposeGovAction.png new file mode 100644 index 000000000..a355503a3 Binary files /dev/null and b/govtool/frontend/public/images/ProposeGovAction.png differ diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index c380c6664..3c6ead960 100644 --- a/govtool/frontend/src/App.tsx +++ b/govtool/frontend/src/App.tsx @@ -57,8 +57,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) { @@ -90,34 +90,34 @@ 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..6f2d1c11d 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.createGovernanceAction)} + 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 f230747d5..679962a36 100644 --- a/govtool/frontend/src/consts/paths.ts +++ b/govtool/frontend/src/consts/paths.ts @@ -1,19 +1,18 @@ export const PATHS = { - create_governance_action: "/create_governance_action", - dashboard_governance_actions_action: - "/connected/governance_actions/:proposalId", - dashboard_governance_actions_category: + createGovernanceAction: "/create_governance_action", + 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: + governanceActions: "/governance_actions", + 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", guides: "/guides", home: "/", registerAsdRep: "/register", 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 5b775de1a..f4066b50f 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", @@ -254,21 +260,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) ),