Skip to content

Commit e3fffc6

Browse files
committed
refactor(v3-uplift): shared card surface, unified page container, button min-width
Card/theme consistency across the app (follow-up to the Markets-page bug fixes): - Button min-width: reset MUI's default 64px floor on MuiButton (minWidth:'unset') so buttons size to content; restore a scoped floor on ListButtonsColumn for row actions. - Page container: parameterize ContentContainer with optional containerProps and drop the bespoke MarketContainer fork, so Markets uses the shared container (gains the standard 40px top gap; the top panel keeps marketContainerProps for stat/table alignment). - Card surface: new MuiPaper variant="card" (surface-elevated + 10px radius + figSurfaceShadow('shadow-stroke-1')) as one source of truth; ListWrapper adopts it, and the bespoke Paper cards across reserve-overview / staking / sGho / stkGho / migration / connect-wallet empty-states migrate to it. - Markets Core assets card: drop the header pt override (matches the dashboard cards). - Migration: strip the inner list surface on mobile to match desktop (no card-in-card). - dev/components: show the new Paper "card" variant alongside the others.
1 parent f5a8b1e commit e3fffc6

20 files changed

Lines changed: 55 additions & 45 deletions

pages/markets.page.tsx

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
import { Box, Container } from '@mui/material';
2-
import { ReactNode, useEffect } from 'react';
1+
import { useEffect } from 'react';
2+
import { ContentContainer } from 'src/components/ContentContainer';
33
import { MainLayout } from 'src/layouts/MainLayout';
44
import { MarketAssetsListContainer } from 'src/modules/markets/MarketAssetsListContainer';
55
import { MarketsTopPanel } from 'src/modules/markets/MarketsTopPanel';
66
import { useRootStore } from 'src/store/root';
77

8-
interface MarketContainerProps {
9-
children: ReactNode;
10-
}
11-
8+
// Markets-specific Container overrides, shared with MarketsTopPanel (`containerProps=`) so the
9+
// top-panel stats align with the asset table at Markets' wider max-width. The theme's MuiContainer
10+
// override already supplies display/flexDirection/flex + the 39px bottom padding, so only the wider
11+
// px/maxWidth are set here.
1212
export const marketContainerProps = {
1313
sx: {
14-
display: 'flex',
15-
flexDirection: 'column',
16-
flex: 1,
17-
pb: '39px',
1814
px: {
1915
xs: 2,
2016
xsm: 5,
@@ -33,10 +29,6 @@ export const marketContainerProps = {
3329
},
3430
};
3531

36-
export const MarketContainer = ({ children }: MarketContainerProps) => {
37-
return <Container {...marketContainerProps}>{children}</Container>;
38-
};
39-
4032
export default function Markets() {
4133
const trackEvent = useRootStore((store) => store.trackEvent);
4234

@@ -49,18 +41,9 @@ export default function Markets() {
4941
return (
5042
<>
5143
<MarketsTopPanel />
52-
<Box
53-
sx={{
54-
display: 'flex',
55-
flexDirection: 'column',
56-
alignItems: 'center',
57-
flex: 1,
58-
}}
59-
>
60-
<MarketContainer>
61-
<MarketAssetsListContainer />
62-
</MarketContainer>
63-
</Box>
44+
<ContentContainer containerProps={marketContainerProps}>
45+
<MarketAssetsListContainer />
46+
</ContentContainer>
6447
</>
6548
);
6649
}

src/components/ConnectWalletPaper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const ConnectWalletPaper = ({ description, sx, ...rest }: ConnectWalletPa
1616

1717
return (
1818
<Paper
19+
variant="card"
1920
{...rest}
2021
sx={{
2122
display: 'flex',

src/components/ConnectWalletPaperStaking.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const ConnectWalletPaperStaking = ({
1818
}: ConnectWalletPaperStakingProps) => {
1919
return (
2020
<Paper
21+
variant="card"
2122
{...rest}
2223
sx={{
2324
display: 'flex',
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { Box, Container } from '@mui/material';
1+
import { Box, Container, ContainerProps } from '@mui/material';
22
import { ReactNode } from 'react';
33

44
interface ContentContainerProps {
55
children: ReactNode;
6+
// Optional passthrough to the inner MUI Container. Markets uses it for a wider maxWidth that its
7+
// top panel shares for stat/table column alignment; every other page omits it (default Container).
8+
containerProps?: ContainerProps;
69
}
710

8-
export const ContentContainer = ({ children }: ContentContainerProps) => {
11+
export const ContentContainer = ({ children, containerProps }: ContentContainerProps) => {
912
return (
1013
<Box
1114
sx={{
@@ -15,7 +18,7 @@ export const ContentContainer = ({ children }: ContentContainerProps) => {
1518
pt: '2.5rem',
1619
}}
1720
>
18-
<Container>{children}</Container>
21+
<Container {...containerProps}>{children}</Container>
1922
</Box>
2023
);
2124
};

src/components/lists/ListWrapper.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Box, BoxProps, Paper, PaperProps, Typography } from '@mui/material';
33
import { ReactNode, useState } from 'react';
44
import { useRootStore } from 'src/store/root';
55
import { DASHBOARD } from 'src/utils/events';
6-
import { figSurfaceShadow } from 'src/utils/figmaColors';
76

87
import { toggleLocalStorageClick } from '../../helpers/toggle-local-storage-click';
98

@@ -95,13 +94,9 @@ export const ListWrapper = ({
9594

9695
return (
9796
<Paper
97+
variant="card"
9898
sx={[
99-
{
100-
mt: withTopMargin ? 4 : 0,
101-
borderRadius: '10px',
102-
backgroundColor: 'surface-elevated',
103-
boxShadow: figSurfaceShadow('shadow-stroke-1'),
104-
},
99+
{ mt: withTopMargin ? 4 : 0 },
105100
...(paperSx ? (Array.isArray(paperSx) ? paperSx : [paperSx]) : []),
106101
]}
107102
>

src/modules/dashboard/lists/ListButtonsColumn.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export const ListButtonsColumn = ({ children, isColumnHeader = false }: ListButt
1919
flex: isColumnHeader ? 1 : 1,
2020
'.MuiButton-root': {
2121
ml: '6px',
22+
// Restore a min-width floor for the row action buttons (the theme no longer floors
23+
// button min-width globally) so they keep their prior size instead of shrinking to bare
24+
// label width.
25+
minWidth: 64,
2226
},
2327
}}
2428
>

src/modules/dev/ComponentShowcase/components/SurfacesSection/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { StakeActionBox } from 'src/modules/staking/StakeActionBox';
1010
import { Section } from '../Section';
1111
import { Specimen } from '../Specimen';
1212

13-
const PAPER_VARIANTS = ['elevation', 'outlined', 'modal'] as const;
13+
const PAPER_VARIANTS = ['elevation', 'outlined', 'modal', 'card'] as const;
1414

1515
export const SurfacesSection = () => (
1616
<Section title="Surfaces & cards">

src/modules/markets/MarketAssetsListContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export const MarketAssetsListContainer = () => {
134134

135135
return (
136136
<ListWrapper
137-
wrapperSx={{ pt: { xs: '6px', xsm: '6px', sm: 3.5 } }}
138137
titleComponent={
139138
sm ? (
140139
<Box

src/modules/migration/MigrationList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const MigrationList = ({
8686
return (
8787
<Box sx={{ width: '100%' }}>
8888
<ListWrapper
89-
paperSx={{ border: 0, boxShadow: 'none' }}
89+
paperSx={{ boxShadow: 'none' }}
9090
titleComponent={
9191
<Box display="block">
9292
<Typography component="div" variant="subheader2" sx={{ mr: 4 }}>

src/modules/migration/MigrationLists.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const MigrationLists = ({
5757

5858
return (
5959
<Paper
60+
variant="card"
6061
sx={{
6162
display: 'flex',
6263
flexDirection: 'column',

0 commit comments

Comments
 (0)