Skip to content

Commit

Permalink
chore: bump pdf-ui package to v0.1.8;
Browse files Browse the repository at this point in the history
remove propose a governance action button from wrapper
  • Loading branch information
MSzalowski committed Jun 18, 2024
1 parent 3a140e3 commit cb078c8
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 70 deletions.
8 changes: 4 additions & 4 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@emurgo/cardano-serialization-lib-asmjs": "12.0.0-alpha.29",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.1.3",
"@intersect.mbo/pdf-ui": "^0.1.8",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down
34 changes: 4 additions & 30 deletions govtool/frontend/src/components/organisms/DashboardTopNav.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useEffect, useState } from "react";
import { Box, Button, IconButton } from "@mui/material";
import { IconPlusCircle } from "@intersect.mbo/intersectmbo.org-icons-set";
import { Box, IconButton } from "@mui/material";

import { VotingPowerChips, Typography } from "@atoms";
import { ICONS, PATHS, PDF_PATHS } from "@consts";
import { useScreenDimension, useTranslation } from "@hooks";
import { ICONS } from "@consts";
import { useScreenDimension } from "@hooks";
import { DashboardDrawerMobile } from "@organisms";

type DashboardTopNavProps = {
Expand All @@ -18,14 +17,6 @@ export const DashboardTopNav = ({
title,
isVotingPowerHidden,
}: DashboardTopNavProps) => {
const { t } = useTranslation();
const isProposalDiscussion = Object.values(PDF_PATHS).some(
(pdfPath) =>
window.location.pathname.includes(pdfPath) &&
window.location.pathname.includes(
PATHS.connectedProposalPillar.replace("/*", ""),
),
);
const [windowScroll, setWindowScroll] = useState<number>(0);
const { isMobile } = useScreenDimension();
const [isDrawerOpen, setIsDrawerOpen] = useState<boolean>(false);
Expand All @@ -34,12 +25,6 @@ export const DashboardTopNav = ({
setIsDrawerOpen(true);
};

const goToProposalDiscussionCreateGovernanceAction = () => {
window.location.href = `${PATHS.connectedProposalPillar.replace("/*", "")}${
PDF_PATHS.proposalDiscussionCreateGovernanceAction
}`;
};

useEffect(() => {
const onScroll = () => {
setWindowScroll(window.scrollY);
Expand Down Expand Up @@ -91,9 +76,7 @@ export const DashboardTopNav = ({
) : null}
</Box>
<Box display="flex">
{!isVotingPowerHidden && !isProposalDiscussion && (
<VotingPowerChips />
)}
{!isVotingPowerHidden && <VotingPowerChips />}
{isMobile && (
<IconButton
data-testid="open-drawer-button"
Expand All @@ -103,15 +86,6 @@ export const DashboardTopNav = ({
<img alt="drawer" src={ICONS.drawerIcon} />
</IconButton>
)}
{isProposalDiscussion && (
<Button
variant="contained"
startIcon={<IconPlusCircle fill="white" />}
onClick={goToProposalDiscussionCreateGovernanceAction}
>
{t("proposalDiscussion.proposeAGovernanceAction")}
</Button>
)}
</Box>
{isMobile && (
<DashboardDrawerMobile
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/components/organisms/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Grid } from "@mui/material";
import { NavLink } from "react-router-dom";

import { DrawerLink, Spacer } from "@atoms";
import { CONNECTED_NAV_ITEMS, IMAGES, PATHS } from "@consts";
import { CONNECTED_NAV_ITEMS, IMAGES, PATHS, DRAWER_WIDTH } from "@consts";
import { useFeatureFlag } from "@context";
import { useGetVoterInfo } from "@hooks";
import { WalletInfoCard, DRepInfoCard } from "@molecules";
Expand All @@ -21,7 +21,7 @@ export const Drawer = () => {
height: "100vh",
position: "sticky",
top: 0,
width: "268px",
width: `${DRAWER_WIDTH}px`,
}}
>
<NavLink
Expand Down
2 changes: 2 additions & 0 deletions govtool/frontend/src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export * from "./navItems";
export * from "./paths";
export * from "./placeholders";
export * from "./queryKeys";

export const DRAWER_WIDTH = 268;
1 change: 0 additions & 1 deletion govtool/frontend/src/consts/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ export const PATHS = {
export const PDF_PATHS = {
proposalDiscussion: "/proposal_discussion",
proposalDiscussionProposal: "/proposal_discussion/:id",
proposalDiscussionCreateGovernanceAction: "/create-governance-action",
};
8 changes: 5 additions & 3 deletions govtool/frontend/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLocation, Outlet, useNavigate } from "react-router-dom";
import { Box } from "@mui/material";

import { Background, ScrollToManage } from "@atoms";
import { CONNECTED_NAV_ITEMS, PATHS } from "@consts";
import { CONNECTED_NAV_ITEMS, DRAWER_WIDTH, PATHS } from "@consts";
import { useCardano } from "@context";
import { useScreenDimension, useTranslation } from "@hooks";
import { DashboardTopNav, Drawer, Footer } from "@organisms";
Expand All @@ -20,8 +20,9 @@ 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 ?? ""
Object.values(CONNECTED_NAV_ITEMS).find(({ navTo }) =>
pathname.startsWith(navTo),
)?.label ?? ""
);
};

Expand Down Expand Up @@ -53,6 +54,7 @@ export const Dashboard = () => {
flex: 1,
flexDirection: "column",
minHeight: "100vh",
width: `calc(100vw - ${DRAWER_WIDTH}px)`,
overflow: "clip",
position: "relative",
}}
Expand Down
58 changes: 29 additions & 29 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1466,20 +1466,20 @@
resolved "https://registry.npmjs.org/@emurgo/cardano-serialization-lib-asmjs/-/cardano-serialization-lib-asmjs-12.0.0-alpha.29.tgz"
integrity sha512-E9+jGLo8QciXbkb7dDYEbZL6YlEJfNRwzYkyR4kkuvzAsy0uKe93dtAY1tdj6ECp+NyeH5xqyKU6aUT8rxwm7A==

"@esbuild/darwin-arm64@0.18.20":
"@esbuild/linux-x64@0.18.20":
version "0.18.20"
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz"
integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz"
integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==

"@esbuild/darwin-arm64@0.19.12":
"@esbuild/linux-x64@0.19.12":
version "0.19.12"
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz"
integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz"
integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==

"@esbuild/darwin-arm64@0.20.2":
"@esbuild/linux-x64@0.20.2":
version "0.20.2"
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz"
integrity sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz"
integrity sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==

"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
Expand Down Expand Up @@ -1596,10 +1596,10 @@
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.0.8.tgz"
integrity sha512-Y+5vYGlF3Smg/QscQT/4ZwsKTNm2C0GCs2czzYWrE4O4RV2YAAg9MZkQ52u8uZp3cEW0h9vr+f9W9ihhwsNHGQ==

"@intersect.mbo/pdf-ui@^0.1.3":
version "0.1.3"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.1.3.tgz"
integrity sha512-XCcmKw7sAxqU7JpllfxyLzGjfZBUIhm1aqjLpupm/35Ntr6UpxfBm9bgGmxcDtRHW9kSHMTWQoadiGro2kBx+A==
"@intersect.mbo/pdf-ui@^0.1.8":
version "0.1.8"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.1.8.tgz"
integrity sha512-KMprTN0YbYcRAYWF8zmZIQzokdQUh3Q0Fly7zcDstfF8MZB64X5ZphoT1SP7GLSXryLadLVkqK/MuGFrr6LAcQ==
dependencies:
"@fontsource/poppins" "^5.0.14"
"@intersect.mbo/intersectmbo.org-icons-set" "^1.0.8"
Expand Down Expand Up @@ -2630,10 +2630,15 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"

"@rollup/[email protected]":
"@rollup/[email protected]":
version "4.18.0"
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz"
integrity sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==

"@rollup/[email protected]":
version "4.18.0"
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz"
integrity sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz"
integrity sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==

"@rushstack/eslint-patch@^1.1.0":
version "1.10.3"
Expand Down Expand Up @@ -3675,10 +3680,15 @@
"@svgr/plugin-svgo" "^5.5.0"
loader-utils "^2.0.0"

"@swc/core-darwin-arm64@1.5.25":
"@swc/core-linux-x64-gnu@1.5.25":
version "1.5.25"
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.5.25.tgz"
integrity sha512-YbD0SBgVJS2DM0vwJTU5m7+wOyCjHPBDMf3nCBJQzFZzOLzK11eRW7SzU2jhJHr9HI9sKcNFfN4lIC2Sj+4inA==
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.5.25.tgz"
integrity sha512-LwbJEgNT3lXbvz4WFzVNXNvs8DvxpoXjMZk9K9Hig8tmZQJKHC2qZTGomcyK5EFzfj2HBuBXZnAEW8ZT9PcEaA==

"@swc/[email protected]":
version "1.5.25"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.5.25.tgz"
integrity sha512-rsepMTgml0EkswWkBpg3Wrjj5eqjwTzZN5omAn1klzXSZnClTrfeHvBuoIJYVr1yx+jmBkqySgME2p7+magUAw==

"@swc/core@*", "@swc/core@^1.3.18":
version "1.5.25"
Expand Down Expand Up @@ -8406,16 +8416,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@^2.3.2, fsevents@~2.3.2, fsevents@~2.3.3:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

[email protected]:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down

0 comments on commit cb078c8

Please sign in to comment.