diff --git a/govtool/frontend/.env.example b/govtool/frontend/.env.example
index 2489d65a0..5050248ee 100644
--- a/govtool/frontend/.env.example
+++ b/govtool/frontend/.env.example
@@ -7,6 +7,7 @@ VITE_GTM_ID=""
VITE_IS_DEV=true
VITE_USERSNAP_SPACE_API_KEY=""
VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
+VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED='true'
VITE_PDF_API_URL=""
VITE_IPFS_GATEWAY=""
VITE_IPFS_PROJECT_ID=""
\ No newline at end of file
diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json
index 35c3ddbfa..5dd40099f 100644
--- a/govtool/frontend/package.json
+++ b/govtool/frontend/package.json
@@ -27,6 +27,7 @@
"@emotion/styled": "^11.11.0",
"@emurgo/cardano-serialization-lib-asmjs": "^12.1.1",
"@hookform/resolvers": "^3.3.1",
+ "@intersect.mbo/govtool-outcomes-pillar-ui": "^1.0.0-beta.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.5.6",
"@mui/icons-material": "^5.14.3",
diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx
index 553d5295f..38fa605a5 100644
--- a/govtool/frontend/src/App.tsx
+++ b/govtool/frontend/src/App.tsx
@@ -2,7 +2,7 @@ import { useCallback, useEffect } from "react";
import { Route, Routes, useNavigate } from "react-router-dom";
import { Modal, ScrollToTop } from "@atoms";
-import { PATHS, PDF_PATHS } from "@consts";
+import { PATHS, PDF_PATHS, OUTCOMES_PATHS, USER_PATHS } from "@consts";
import { useCardano, useFeatureFlag, useModal } from "@context";
import { useWalletConnectionListener } from "@hooks";
import {
@@ -39,9 +39,13 @@ import {
import { PublicRoute } from "./pages/PublicRoute";
import { TopBanners } from "./components/organisms/TopBanners";
import { DashboardHome } from "./pages/DashboardHome";
+import { GovernanceActionOutComesPillar } from "./pages/GovernanceActionOutComes";
export default () => {
- const { isProposalDiscussionForumEnabled } = useFeatureFlag();
+ const {
+ isProposalDiscussionForumEnabled,
+ isGovernanceOutcomesPillarEnabled,
+ } = useFeatureFlag();
const { enable, isEnabled } = useCardano();
const navigate = useNavigate();
const { modal, openModal, modals } = useModal();
@@ -111,6 +115,18 @@ export default () => {
element={}
/>
)}
+ {isGovernanceOutcomesPillarEnabled && (
+ <>
+ }
+ />
+ }
+ />
+ >
+ )}
}
diff --git a/govtool/frontend/src/components/organisms/DashboardDrawerMobile.tsx b/govtool/frontend/src/components/organisms/DashboardDrawerMobile.tsx
index 00bb80cec..ac88387cc 100644
--- a/govtool/frontend/src/components/organisms/DashboardDrawerMobile.tsx
+++ b/govtool/frontend/src/components/organisms/DashboardDrawerMobile.tsx
@@ -18,7 +18,7 @@ export const DashboardDrawerMobile = ({
isDrawerOpen,
setIsDrawerOpen,
}: DashboardDrawerMobileProps) => {
- const { isProposalDiscussionForumEnabled } = useFeatureFlag();
+ const { isProposalDiscussionForumEnabled, isGovernanceOutcomesPillarEnabled } = useFeatureFlag();
const { screenWidth } = useScreenDimension();
const { voter } = useGetVoterInfo();
@@ -75,26 +75,60 @@ export const DashboardDrawerMobile = ({
{CONNECTED_NAV_ITEMS.map((navItem) => {
- if (
- !isProposalDiscussionForumEnabled &&
- navItem.dataTestId === "proposal-discussion-link"
- ) {
- return null;
- }
-
return (
{
- // TODO: Refine if it is needed to remove this eslint-disable
- // eslint-disable-next-line no-unused-expressions
- navItem.newTabLink && openInNewTab(navItem.newTabLink);
+ if (navItem.newTabLink) {
+ openInNewTab(navItem.newTabLink);
+ }
setIsDrawerOpen(false);
}}
isConnectWallet
/>
+ {navItem.childNavItems && (
+
+ {navItem.childNavItems.map((childItem) => {
+ if (
+ !isProposalDiscussionForumEnabled &&
+ childItem.dataTestId === "proposal-discussion-link"
+ ) {
+ return null;
+ }
+
+ if (
+ !isGovernanceOutcomesPillarEnabled &&
+ (childItem.dataTestId === "governance-actions-voted-by-me-link" ||
+ childItem.dataTestId === "governance-actions-outcomes-link")
+ ) {
+ return null;
+ }
+
+ return (
+ {
+ if (childItem.newTabLink) {
+ openInNewTab(childItem.newTabLink);
+ }
+ setIsDrawerOpen(false);
+ }}
+ isConnectWallet
+ />
+ );
+ })}
+
+ )}
);
})}
diff --git a/govtool/frontend/src/components/organisms/Drawer.tsx b/govtool/frontend/src/components/organisms/Drawer.tsx
index 02b74ae1e..87a8d50ab 100644
--- a/govtool/frontend/src/components/organisms/Drawer.tsx
+++ b/govtool/frontend/src/components/organisms/Drawer.tsx
@@ -9,7 +9,7 @@ import { WalletInfoCard, DRepInfoCard } from "@molecules";
import { openInNewTab } from "@utils";
export const Drawer = () => {
- const { isProposalDiscussionForumEnabled } = useFeatureFlag();
+ const { isProposalDiscussionForumEnabled, isGovernanceOutcomesPillarEnabled } = useFeatureFlag();
const { voter } = useGetVoterInfo();
return (
@@ -47,13 +47,6 @@ export const Drawer = () => {
rowGap={2}
>
{CONNECTED_NAV_ITEMS.map((navItem) => {
- if (
- !isProposalDiscussionForumEnabled &&
- navItem.dataTestId === "proposal-discussion-link"
- ) {
- return null;
- }
-
return (
{
: undefined
}
/>
+ {navItem.childNavItems && (
+
+ {navItem.childNavItems.map((childItem) => {
+ if (
+ !isProposalDiscussionForumEnabled &&
+ childItem.dataTestId === "proposal-discussion-link"
+ ) {
+ return null;
+ }
+
+ if (
+ !isGovernanceOutcomesPillarEnabled &&
+ (childItem.dataTestId === "governance-actions-voted-by-me-link" ||
+ childItem.dataTestId === "governance-actions-outcomes-link")
+ ) {
+ return null;
+ }
+
+ return (
+ openInNewTab(childItem.newTabLink!)
+ : undefined
+ }
+ />
+ );
+ })}
+
+ )}
);
})}
diff --git a/govtool/frontend/src/consts/navItems.tsx b/govtool/frontend/src/consts/navItems.tsx
index 74795d562..922f2b360 100644
--- a/govtool/frontend/src/consts/navItems.tsx
+++ b/govtool/frontend/src/consts/navItems.tsx
@@ -4,7 +4,7 @@ import { theme } from "@/theme";
import { ICONS } from "./icons";
import { LINKS } from "./links";
-import { PATHS, PDF_PATHS } from "./paths";
+import { PATHS, PDF_PATHS, OUTCOMES_PATHS, USER_PATHS } from "./paths";
export const NAV_ITEMS = [
{
@@ -59,6 +59,7 @@ export const CONNECTED_NAV_ITEMS = [
navTo: PATHS.dashboardDRepDirectory,
activeIcon: ICONS.dRepDirectoryActiveIcon,
icon: ICONS.dRepDirectoryIcon,
+ newTabLink: null,
},
{
dataTestId: "governance-actions-link",
@@ -67,28 +68,54 @@ export const CONNECTED_NAV_ITEMS = [
activeIcon: ICONS.governanceActionsActiveIcon,
icon: ICONS.governanceActionsIcon,
newTabLink: null,
- },
- {
- dataTestId: "proposal-discussion-link",
- label: i18n.t("proposalDiscussion.title"),
- navTo: PDF_PATHS.proposalDiscussion,
- activeIcon: (
-
- ),
- icon: (
-
- ),
- newTabLink: null,
+ childNavItems: [
+ {
+ dataTestId: "proposal-discussion-link",
+ label: i18n.t("proposalDiscussion.title"),
+ navTo: PDF_PATHS.proposalDiscussion,
+ activeIcon: (
+
+ ),
+ icon: (
+
+ ),
+ newTabLink: null,
+ },
+ {
+ dataTestId: "governance-actions-live-voting-link",
+ label: i18n.t("govActions.liveVoting.title"),
+ navTo: OUTCOMES_PATHS.governanceActionsLiveVoting,
+ activeIcon: ICONS.governanceActionsActiveIcon,
+ icon: ICONS.governanceActionsIcon,
+ newTabLink: null,
+ },
+ {
+ dataTestId: "governance-actions-outcomes-link",
+ label: i18n.t("govActions.outcomes.title"),
+ navTo: OUTCOMES_PATHS.governanceActionsOutcomes,
+ activeIcon: ICONS.governanceActionsActiveIcon,
+ icon: ICONS.governanceActionsIcon,
+ newTabLink: null,
+ },
+ {
+ dataTestId: "governance-actions-voted-by-me-link",
+ label: i18n.t("govActions.votedByMe.title"),
+ navTo: USER_PATHS.governanceActionsVotedByMe,
+ activeIcon: ICONS.governanceActionsActiveIcon,
+ icon: ICONS.governanceActionsIcon,
+ newTabLink: null,
+ },
+ ],
},
{
dataTestId: "guides-link",
diff --git a/govtool/frontend/src/consts/paths.ts b/govtool/frontend/src/consts/paths.ts
index 296b61d7e..a392aeb12 100644
--- a/govtool/frontend/src/consts/paths.ts
+++ b/govtool/frontend/src/consts/paths.ts
@@ -31,3 +31,13 @@ export const PDF_PATHS = {
proposalDiscussionProposal: "/proposal_discussion/:id",
proposalDiscussionPropose: "/proposal_discussion/propose",
};
+
+export const USER_PATHS = {
+ governanceActionsVotedByMe: "/my/votes_and_favorites",
+};
+
+export const OUTCOMES_PATHS = {
+ governanceActionsOutcomes: "/outcomes",
+ governanceActionOutcomes: "/outcomes/governance_actions/:id",
+ governanceActionsLiveVoting: "/connected/governance_actions",
+};
\ No newline at end of file
diff --git a/govtool/frontend/src/context/featureFlag.tsx b/govtool/frontend/src/context/featureFlag.tsx
index 23b1a9ecd..b45eacaa5 100644
--- a/govtool/frontend/src/context/featureFlag.tsx
+++ b/govtool/frontend/src/context/featureFlag.tsx
@@ -15,6 +15,7 @@ import { useAppContext } from "./appContext";
*/
type FeatureFlagContextType = {
isProposalDiscussionForumEnabled: boolean;
+ isGovernanceOutcomesPillarEnabled: boolean;
isVotingOnGovernanceActionEnabled: (
governanceActionType: GovernanceActionType,
) => boolean;
@@ -33,6 +34,7 @@ type FeatureFlagContextType = {
const FeatureFlagContext = createContext({
isProposalDiscussionForumEnabled: false,
+ isGovernanceOutcomesPillarEnabled: false,
isVotingOnGovernanceActionEnabled: () => false,
areDRepVoteTotalsDisplayed: () => false,
areSPOVoteTotalsDisplayed: () => false,
@@ -129,6 +131,10 @@ const FeatureFlagProvider = ({ children }: PropsWithChildren) => {
import.meta.env.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED === "true" ||
import.meta.env.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED === true ||
false,
+ isGovernanceOutcomesPillarEnabled:
+ import.meta.env.VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED === "true" ||
+ import.meta.env.VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED === true ||
+ false,
isVotingOnGovernanceActionEnabled,
areDRepVoteTotalsDisplayed,
areSPOVoteTotalsDisplayed,
diff --git a/govtool/frontend/src/i18n/locales/en.json b/govtool/frontend/src/i18n/locales/en.json
index d3faf4074..75b45a80d 100644
--- a/govtool/frontend/src/i18n/locales/en.json
+++ b/govtool/frontend/src/i18n/locales/en.json
@@ -455,6 +455,18 @@
"title": "Info Action",
"label": "Info Action"
}
+ },
+ "liveVoting": {
+ "title": "Live Voting",
+ "label": "Live Voting"
+ },
+ "outcomes": {
+ "title": "Outcomes",
+ "label": "Outcomes"
+ },
+ "votedByMe": {
+ "title": "Voted by me",
+ "label": "Voted by me"
}
},
"hero": {
diff --git a/govtool/frontend/src/pages/Dashboard.tsx b/govtool/frontend/src/pages/Dashboard.tsx
index 18f7a504b..77d9181d7 100644
--- a/govtool/frontend/src/pages/Dashboard.tsx
+++ b/govtool/frontend/src/pages/Dashboard.tsx
@@ -19,12 +19,18 @@ export const Dashboard = () => {
const getPageTitle = (path: string) => {
if (path === PATHS.dashboard) return t("dashboard.title");
- return (
- Object.values(CONNECTED_NAV_ITEMS).find(({ navTo }) =>
- pathname.startsWith(navTo),
- )?.label ?? ""
- );
+ return findNavItem(CONNECTED_NAV_ITEMS, path) ?? "";
};
+
+ const findNavItem = (items: NavItem[], targetPath: string): string | null => (
+ items.reduce((result, item) => (
+ result ?? (
+ targetPath === item.navTo
+ ? item.label
+ : (item.childNavItems ? findNavItem(item.childNavItems, targetPath) : null)
+ )
+ ), null)
+ );
useEffect(() => {
if (divRef.current && pathname !== PATHS.dashboardGovernanceActions) {
diff --git a/govtool/frontend/src/pages/GovernanceActionOutComes.tsx b/govtool/frontend/src/pages/GovernanceActionOutComes.tsx
new file mode 100644
index 000000000..62b389343
--- /dev/null
+++ b/govtool/frontend/src/pages/GovernanceActionOutComes.tsx
@@ -0,0 +1,49 @@
+import { Footer, TopNav } from "@/components/organisms";
+import { useCardano } from "@/context";
+import { useScreenDimension } from "@/hooks";
+import Outcomes from "@intersect.mbo/govtool-outcomes-pillar-ui";
+import { Box, CircularProgress } from "@mui/material";
+import { Suspense } from "react";
+
+export const GovernanceActionOutComesPillar = () => {
+ const { pagePadding } = useScreenDimension();
+ const { ...context } = useCardano();
+ return (
+
+ {!context.isEnabled && }
+
+
+
+
+ }
+ >
+
+
+
+ {!context.isEnabled && }
+
+ );
+};
diff --git a/govtool/frontend/src/types/global.d.ts b/govtool/frontend/src/types/global.d.ts
index bc7222156..567ca02ef 100644
--- a/govtool/frontend/src/types/global.d.ts
+++ b/govtool/frontend/src/types/global.d.ts
@@ -63,4 +63,14 @@ declare global {
label: string;
uri: string;
};
+
+ interface NavItem {
+ dataTestId: string;
+ label: string;
+ navTo: string;
+ activeIcon: JSX.Element | string;
+ icon: JSX.Element | string;
+ newTabLink: string | null;
+ childNavItems?: NavItem[];
+ }
}
diff --git a/govtool/frontend/yarn.lock b/govtool/frontend/yarn.lock
index 316811086..215aa9536 100644
--- a/govtool/frontend/yarn.lock
+++ b/govtool/frontend/yarn.lock
@@ -1488,6 +1488,14 @@
resolved "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz"
integrity sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==
+"@intersect.mbo/govtool-outcomes-pillar-ui@^1.0.0-beta.1":
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/@intersect.mbo/govtool-outcomes-pillar-ui/-/govtool-outcomes-pillar-ui-1.0.7.tgz#3db52ec87d7c26707ab6e9197b78d28d33a17465"
+ integrity sha512-I214XRhLfrQUWmfy8XfoCZDjtz7kWB2qf5/Fh5Jh/QfJ95H+AkO4R3jWvCAwN3apjKy5nhgWchCgD09464EovQ==
+ dependencies:
+ rollup-plugin-livereload "^2.0.5"
+ rollup-plugin-serve "^1.1.1"
+
"@intersect.mbo/intersectmbo.org-icons-set@^1.0.8":
version "1.1.0"
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
@@ -4199,7 +4207,7 @@ any-promise@^1.0.0:
anymatch@^3.0.3, anymatch@~3.1.2:
version "3.1.3"
- resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
dependencies:
normalize-path "^3.0.0"
@@ -4733,7 +4741,7 @@ brace-expansion@^2.0.1:
braces@^3.0.3, braces@~3.0.2:
version "3.0.3"
- resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.1.1"
@@ -7245,9 +7253,9 @@ gitdiff-parser@^0.3.1:
resolved "https://registry.npmjs.org/gitdiff-parser/-/gitdiff-parser-0.3.1.tgz"
integrity sha512-YQJnY8aew65id8okGxKCksH3efDCJ9HzV7M9rsvd65habf39Pkh4cgYJ27AaoDMqo1X98pgNJhNMrm/kpV7UVQ==
-glob-parent@^5.1.2:
+glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
- resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"
@@ -10672,7 +10680,7 @@ node-releases@^2.0.18:
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
- resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
normalize-range@^0.1.2:
@@ -10920,6 +10928,11 @@ optionator@^0.9.3:
type-check "^0.4.0"
word-wrap "^1.2.5"
+"opts@>= 1.2.0":
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/opts/-/opts-2.0.2.tgz#a17e189fbbfee171da559edd8a42423bc5993ce1"
+ integrity sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==
+
os-homedir@^1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz"