Skip to content

Commit bfbc9ff

Browse files
authored
Merge pull request #2938 from IntersectMBO/develop
2 parents ceea391 + 9713fb5 commit bfbc9ff

File tree

10 files changed

+111
-181
lines changed

10 files changed

+111
-181
lines changed

govtool/frontend/package-lock.json

Lines changed: 28 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@emotion/styled": "^11.11.0",
2828
"@emurgo/cardano-serialization-lib-asmjs": "^12.1.1",
2929
"@hookform/resolvers": "^3.3.1",
30-
"@intersect.mbo/govtool-outcomes-pillar-ui": "^1.0.0-beta.1",
30+
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.0.0",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
3232
"@intersect.mbo/pdf-ui": "^0.5.11",
3333
"@mui/icons-material": "^5.14.3",

govtool/frontend/src/App.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ export default () => {
107107
element={<ProposalDiscussionPillar />}
108108
/>
109109
)}
110+
{isGovernanceOutcomesPillarEnabled && !isEnabled && (
111+
<>
112+
<Route
113+
path={`${OUTCOMES_PATHS.governanceActionsOutcomes}/*`}
114+
element={<GovernanceActionOutComesPillar />}
115+
/>
116+
<Route
117+
path={USER_PATHS.governanceActionsVotedByMe}
118+
element={<GovernanceActionOutComesPillar />}
119+
/>
120+
</>
121+
)}
110122
<Route element={<Dashboard />}>
111123
<Route path={PATHS.dashboard} element={<DashboardHome />} />
112124
{isProposalDiscussionForumEnabled && (

govtool/frontend/src/components/molecules/WalletInfoCard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useLocation, useNavigate } from "react-router-dom";
22
import { Box, Button, Typography } from "@mui/material";
33

4-
import { PDF_PATHS, PATHS, gray } from "@consts";
4+
import { PDF_PATHS, PATHS, gray, OUTCOMES_PATHS } from "@consts";
55
import { useCardano } from "@context";
66
import { useTranslation } from "@hooks";
77
import { Card } from "./Card";
@@ -18,7 +18,11 @@ export const WalletInfoCard = () => {
1818
PDF_PATHS.proposalDiscussion.replace("/", ""),
1919
);
2020

21-
if (!isProposalDiscussionForum) {
21+
const isGovernanceOutcomesPillar = window.location.pathname.includes(
22+
OUTCOMES_PATHS.governanceActionsOutcomes.replace("/", ""),
23+
);
24+
25+
if (!isProposalDiscussionForum && !isGovernanceOutcomesPillar) {
2226
navigate(
2327
pathname.includes("/connected")
2428
? `${pathname.replace("/connected", "")}${hash ?? ""}`

govtool/frontend/src/components/molecules/WalletOption.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FC, useCallback } from "react";
22
import { To, useNavigate, useLocation } from "react-router-dom";
33
import { Box, CircularProgress, Typography } from "@mui/material";
44

5-
import { PATHS, PDF_PATHS } from "@consts";
5+
import { OUTCOMES_PATHS, PATHS, PDF_PATHS } from "@consts";
66
import { useCardano } from "@context";
77
import { theme } from "@/theme";
88

@@ -36,10 +36,14 @@ export const WalletOptionButton: FC<WalletOption> = ({
3636
PDF_PATHS.proposalDiscussion.replace("/", ""),
3737
);
3838

39+
const isGovernanceOutcomesPillar = window.location.pathname.includes(
40+
OUTCOMES_PATHS.governanceActionsOutcomes.replace("/", ""),
41+
);
42+
3943
const result = await enable(name);
4044

4145
if (result?.stakeKey) {
42-
if (isProposalDiscussionForum) return;
46+
if (isProposalDiscussionForum || isGovernanceOutcomesPillar) return;
4347
navigate(
4448
// eslint-disable-next-line no-unneeded-ternary
4549
pathToNavigate

govtool/frontend/src/components/organisms/DrawerMobile.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export const DrawerMobile = ({
1818
isDrawerOpen,
1919
setIsDrawerOpen,
2020
}: DrawerMobileProps) => {
21-
const { isProposalDiscussionForumEnabled } = useFeatureFlag();
21+
const {
22+
isProposalDiscussionForumEnabled,
23+
isGovernanceOutcomesPillarEnabled,
24+
} = useFeatureFlag();
2225
const { screenWidth } = useScreenDimension();
2326
const { openModal } = useModal();
2427
const { t } = useTranslation();
@@ -88,6 +91,13 @@ export const DrawerMobile = ({
8891
) {
8992
return null;
9093
}
94+
95+
if (
96+
!isGovernanceOutcomesPillarEnabled &&
97+
navItem.dataTestId === "governance-actions-outcomes-link"
98+
) {
99+
return null;
100+
}
91101
return (
92102
<Grid item key={navItem.label}>
93103
<Link

govtool/frontend/src/components/organisms/TopNav.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { DrawerMobile } from "./DrawerMobile";
1414
const POSITION_TO_BLUR = 50;
1515

1616
export const TopNav = ({ isConnectButton = true }) => {
17-
const { isProposalDiscussionForumEnabled } = useFeatureFlag();
17+
const { isProposalDiscussionForumEnabled, isGovernanceOutcomesPillarEnabled } = useFeatureFlag();
1818
const containerRef = useRef<HTMLDivElement>(null);
1919
const [shouldBlur, setShouldBlur] = useState<boolean>(false);
2020
const { openModal } = useModal();
@@ -121,6 +121,13 @@ export const TopNav = ({ isConnectButton = true }) => {
121121
) {
122122
return null;
123123
}
124+
125+
if (
126+
!isGovernanceOutcomesPillarEnabled &&
127+
navItem.dataTestId === "governance-actions-outcomes-link"
128+
) {
129+
return null;
130+
}
124131
return (
125132
<Grid item key={navItem.label}>
126133
<Link

0 commit comments

Comments
 (0)