Skip to content

Commit 85b40b7

Browse files
authored
Merge pull request #2541 from IntersectMBO/fix/2493-remaining-mobile-responsiveness-issue
fix(#2493): fix mobile responsiveness issue
2 parents cd26b58 + 5ddef24 commit 85b40b7

File tree

9 files changed

+80
-19
lines changed

9 files changed

+80
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ changes.
1818

1919
- Move matomo initalization out of the react code
2020
- Fix some non-ipfs related errors while fetching the DRep images [Issue 2546](https://github.com/IntersectMBO/govtool/issues/2546)
21+
- Remaining mobile responsiveness issue [Issue 2493](https://github.com/IntersectMBO/govtool/issues/2493)
2122

2223
### Changed
2324

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const DataActionsFilters = ({
4343
[chosenFilters, setChosenFilters],
4444
);
4545

46-
const { isMobile, screenWidth } = useScreenDimension();
46+
const { isMobile } = useScreenDimension();
4747

4848
const wrapperRef = useRef<HTMLDivElement>(null);
4949
useOnClickOutside(wrapperRef, closeFilters);
@@ -58,7 +58,10 @@ export const DataActionsFilters = ({
5858
boxShadow: "1px 2px 11px 0px #00123D5E",
5959
borderRadius: "10px",
6060
padding: "12px 0px",
61-
width: screenWidth < 850 ? "315px" : "415px",
61+
width: {
62+
xxs: "250px",
63+
md: "415px",
64+
},
6265
zIndex: "1",
6366
right: isMobile ? "59px" : "115px",
6467
top: "53px",

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ export const DataActionsSorting = ({
4141
boxShadow: "1px 2px 11px 0px #00123D5E",
4242
borderRadius: "10px",
4343
padding: "12px 0px",
44-
width: "315px",
44+
width: {
45+
xxs: "250px",
46+
md: "415px",
47+
},
4548
zIndex: "1",
4649
right: "3px",
4750
top: "53px",

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export const DataMissingHeader = ({
3333
<Box
3434
sx={{
3535
flexDirection: {
36-
sm: "column",
37-
lg: "row",
36+
xxs: "column",
37+
md: "row",
3838
},
3939
alignItems: {
40-
lg: "center",
40+
md: "center",
4141
},
4242
display: "flex",
4343
}}
@@ -52,8 +52,8 @@ export const DataMissingHeader = ({
5252
)}
5353
<Typography
5454
sx={{
55-
...(isDRep && { ml: { lg: 3 } }),
56-
...(isDRep && { mt: { sm: 2, lg: 0 } }),
55+
...(isDRep && { ml: { md: 3 } }),
56+
...(isDRep && { mt: { xxs: 2, md: 0 } }),
5757
textOverflow: "ellipsis",
5858
fontWeight: 600,
5959
...(isDataMissing && { color: "errorRed" }),

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export const DataMissingInfoBox = ({
5656
sx={{
5757
mb: 4,
5858
pr: 6,
59+
maxWidth: {
60+
xxs: "295px",
61+
md: "100%",
62+
},
5963
...sx,
6064
}}
6165
>

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ export const DRepCard = ({
106106
src={image || ICONS.defaultDRepIcon}
107107
data-testid="drep-image"
108108
/>
109-
<Box ml={3}>
109+
<Box
110+
sx={{
111+
marginLeft: {
112+
xxs: 1,
113+
xs: 2,
114+
sm: 3,
115+
},
116+
}}
117+
>
110118
<Typography
111119
sx={{ ellipsisStyles, color: metadataStatus && "errorRed" }}
112120
>
@@ -124,7 +132,10 @@ export const DRepCard = ({
124132
sx={{
125133
gap: 1,
126134
width: "250px",
127-
maxWidth: "100%",
135+
maxWidth: {
136+
xxs: "200px",
137+
xs: "100%",
138+
},
128139
"&:hover": {
129140
opacity: 0.6,
130141
transition: "opacity 0.3s",
@@ -195,12 +206,15 @@ export const DRepCard = ({
195206
<Box
196207
display="flex"
197208
gap={2.5}
198-
minWidth={isConnected ? 233 : 310}
199209
sx={{
200210
"@container root (min-width: 480px)": {
201211
justifyContent: "flex-end",
202212
alignItems: "center",
203213
},
214+
minWidth: {
215+
xxs: "233px",
216+
xs: isConnected ? "233px" : "310px",
217+
},
204218
}}
205219
>
206220
{type === "DRep" && (
@@ -251,4 +265,5 @@ const ellipsisStyles = {
251265
overflow: "hidden",
252266
textOverflow: "ellipsis",
253267
whiteSpace: "nowrap",
268+
maxWidth: { xxs: "200px", xs: "100%" },
254269
} as const;

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,19 @@ const DRepDetailsInfoItem = ({
239239
if (!children && !text) return null;
240240
const dataTestIdInfoItemCategoryPrefix = "info-item";
241241
return (
242-
<div>
243-
<Box sx={{ mb: 0.5 }}>
242+
<Box
243+
sx={{
244+
maxWidth: {
245+
xxs: "295px",
246+
md: "100%",
247+
},
248+
}}
249+
>
250+
<Box
251+
sx={{
252+
mb: 0.5,
253+
}}
254+
>
244255
<Typography
245256
color="neutralGray"
246257
fontWeight={600}
@@ -260,7 +271,7 @@ const DRepDetailsInfoItem = ({
260271
)}
261272
{children}
262273
</div>
263-
</div>
274+
</Box>
264275
);
265276
};
266277

@@ -306,7 +317,17 @@ const ReferencesGroup = ({ references }: { references: ReferenceItem[] }) => (
306317
);
307318

308319
const ReferencesLink = ({ label, uri }: ReferenceItem) => (
309-
<Box sx={{ display: "flex", flexDirection: "column", gap: 0.5 }}>
320+
<Box
321+
sx={{
322+
display: "flex",
323+
flexDirection: "column",
324+
gap: 0.5,
325+
maxWidth: {
326+
xxs: "295px",
327+
md: "100%",
328+
},
329+
}}
330+
>
310331
<Typography fontWeight={400}>{label}</Typography>
311332
<Link
312333
data-testid={`${testIdFromLabel(label)}-link`}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Box, Grid, IconButton, SwipeableDrawer } from "@mui/material";
2+
import { NavLink } from "react-router-dom";
23

34
import { Background, Link } from "@atoms";
4-
import { CONNECTED_NAV_ITEMS, ICONS } from "@consts";
5+
import { CONNECTED_NAV_ITEMS, ICONS, PATHS } from "@consts";
56
import { DRepInfoCard, WalletInfoCard } from "@molecules";
67
import { useGetVoterInfo, useScreenDimension } from "@hooks";
78
import { openInNewTab } from "@utils";
@@ -57,7 +58,13 @@ export const DashboardDrawerMobile = ({
5758
width: screenWidth - CALCULATED_DRAWER_PADDING,
5859
}}
5960
>
60-
<img alt="app-logo" src={ICONS.appLogoIcon} height={25} />
61+
<NavLink
62+
data-testid="logo-button"
63+
style={{ display: "flex", justifyContent: "center" }}
64+
to={PATHS.dashboard}
65+
>
66+
<img alt="app-logo" src={ICONS.appLogoIcon} height={25} />
67+
</NavLink>
6168
<IconButton
6269
data-testid="close-drawer-button"
6370
onClick={closeDrawer}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { NavLink } from "react-router-dom";
12
import { Box, Grid, IconButton, SwipeableDrawer } from "@mui/material";
23

34
import { Background, Button, Link, Typography } from "@atoms";
4-
import { ICONS, IMAGES, NAV_ITEMS } from "@consts";
5+
import { ICONS, IMAGES, NAV_ITEMS, PATHS } from "@consts";
56
import { useScreenDimension, useTranslation } from "@hooks";
67
import { useFeatureFlag, useModal } from "@context";
78
import { openInNewTab } from "@utils";
@@ -48,7 +49,13 @@ export const DrawerMobile = ({
4849
width: screenWidth - CALCULATED_DRAWER_PADDING,
4950
}}
5051
>
51-
<img alt="app-logo" height={25} src={IMAGES.appLogo} />
52+
<NavLink
53+
data-testid="logo-button"
54+
style={{ display: "flex", justifyContent: "center" }}
55+
to={PATHS.dashboard}
56+
>
57+
<img alt="app-logo" height={25} src={IMAGES.appLogo} />
58+
</NavLink>
5259
<IconButton
5360
sx={{ padding: 0 }}
5461
onClick={() => setIsDrawerOpen(false)}

0 commit comments

Comments
 (0)