Skip to content

Commit 8394537

Browse files
authored
feat: BONK redesign polish 3 (#17)
1 parent 9836731 commit 8394537

File tree

8 files changed

+64
-37
lines changed

8 files changed

+64
-37
lines changed

src/components/Separator.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Fragment } from 'react';
33
import { Separator } from '@radix-ui/react-separator';
44
import styled, { css } from 'styled-components';
55

6-
const StyledSeparator = styled(Separator)<{ $fullHeight: boolean }>`
6+
const StyledSeparator = styled(Separator)<{ $fullHeight: boolean; $transparent?: boolean }>`
77
flex: 0 !important;
88
z-index: -1;
99
@@ -18,7 +18,8 @@ const StyledSeparator = styled(Separator)<{ $fullHeight: boolean }>`
1818
align-self: center;
1919
width: 0;
2020
margin: 0 !important;
21-
border-right: solid var(--border-width, var(--default-border-width)) var(--color-border);
21+
border-right: solid var(--border-width, var(--default-border-width))
22+
${({ $transparent }) => ($transparent ? 'transparent' : 'var(--color-border)')};
2223
2324
${({ $fullHeight }) =>
2425
$fullHeight
@@ -35,16 +36,19 @@ export const VerticalSeparator = ({
3536
className,
3637
decorative = false,
3738
fullHeight = false,
39+
transparent = false,
3840
}: {
3941
className?: string;
4042
decorative?: boolean;
4143
fullHeight?: boolean;
44+
transparent?: boolean;
4245
}) => (
4346
<StyledSeparator
4447
className={className}
4548
orientation="vertical"
4649
decorative={decorative}
4750
$fullHeight={fullHeight}
51+
$transparent={transparent}
4852
/>
4953
);
5054

src/layout/Header/HeaderDesktop.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ export const HeaderDesktop = () => {
135135
<LogoShortIcon />
136136
</$LogoLink>
137137

138-
<VerticalSeparator />
138+
<VerticalSeparator transparent />
139139

140140
<$NavBefore>
141141
<$LanguageSelector sideOffset={16}>
142142
<Icon iconName={IconName.Translate} size="1.25em" />
143143
</$LanguageSelector>
144-
<VerticalSeparator />
144+
<VerticalSeparator transparent />
145145
</$NavBefore>
146146

147-
<VerticalSeparator />
147+
<VerticalSeparator transparent />
148148

149149
<$NavigationScrollBar>
150150
<$NavigationMenu items={navItems} orientation="horizontal" dividerStyle="underline" />

src/pages/spot/SpotMarketsDropdown.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const SpotMarketsDropdown = ({
152152
}
153153
triggerType={TriggerType.MarketDropdown}
154154
>
155-
<div tw="flex h-full flex-col">
155+
<div tw="flex min-h-0 flex-col">
156156
<$Toolbar>
157157
<$SearchInput
158158
placeholder="Search markets"
@@ -226,10 +226,13 @@ const $Popover = styled(Popover)`
226226
display: flex;
227227
flex-direction: column;
228228
229-
height: calc(
229+
/* Use max-height instead of height to allow the popover to be smaller if needed */
230+
/* Add buffer space (4rem) to ensure pagination controls and bottom rows are visible */
231+
max-height: calc(
230232
100vh - var(--page-header-height) - var(--market-info-row-height) - var(
231233
--page-footer-height
232-
) - var(--restriction-warning-currentHeight)
234+
) - var(--restriction-warning-currentHeight) -
235+
4rem
233236
);
234237
235238
width: var(--spot-marketsDropdown-openWidth);
@@ -249,7 +252,8 @@ const $Popover = styled(Popover)`
249252
const $ScrollArea = styled.div`
250253
overflow: scroll;
251254
position: relative;
252-
height: 100%;
255+
flex: 1;
256+
min-height: 0; /* Allow flex item to shrink below content size */
253257
`;
254258

255259
const $Table = styled(Table)`

src/pages/token/RewardsLeaderboardPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const RewardsLeaderboardPanel = () => {
6464
const onDownload = () => {
6565
if (!feeLeaderboard) return;
6666

67-
const csvRows = feeLeaderboard?.map((item) => ({
67+
const csvRows = feeLeaderboard.map((item) => ({
6868
rank: item.rank,
6969
address: item.address,
7070
estimatedRewards: item.estimatedDydxRewards,

src/views/MarketsDropdown.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,13 @@ const $Popover = styled(Popover)`
405405
display: flex;
406406
flex-direction: column;
407407
408-
height: calc(
408+
/* Use max-height instead of height to allow the popover to be smaller if needed */
409+
/* Add buffer space (4rem) to ensure pagination controls and bottom rows are visible */
410+
max-height: calc(
409411
100vh - var(--page-header-height) - var(--market-info-row-height) - var(
410412
--page-footer-height
411-
) - var(--restriction-warning-currentHeight)
413+
) - var(--restriction-warning-currentHeight) -
414+
4rem
412415
);
413416
414417
width: var(--marketsDropdown-openWidth);
@@ -476,7 +479,8 @@ const $TriggerFlag = styled.div`
476479
const $ScrollArea = styled.div`
477480
overflow: scroll;
478481
position: relative;
479-
height: 100%;
482+
flex: 1;
483+
min-height: 0; /* Allow flex item to shrink below content size */
480484
`;
481485

482486
const $Table = styled(Table)`

src/views/TradeSideTabs.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ export const TradeSideTabs = ({ sharedContent, className }: ElementProps & Style
4343

4444
return (
4545
<$Container className={className}>
46-
<$HeaderSection>
46+
<$MarginModeSection>
4747
<MarginModeSelector />
48-
<$TradeSideTabs
49-
fullWidthTabs
50-
dividerStyle="none"
51-
activeTab={side}
52-
value={side}
53-
items={items}
54-
onValueChange={(newSide: OrderSide) => {
55-
dispatch(tradeFormActions.setSide(newSide));
56-
}}
57-
disabled={!allowChangingOrderType}
58-
sharedContent={sharedContent}
59-
/>
60-
</$HeaderSection>
48+
</$MarginModeSection>
49+
<$TradeSideTabs
50+
fullWidthTabs
51+
dividerStyle="none"
52+
activeTab={side}
53+
value={side}
54+
items={items}
55+
onValueChange={(newSide: OrderSide) => {
56+
dispatch(tradeFormActions.setSide(newSide));
57+
}}
58+
disabled={!allowChangingOrderType}
59+
sharedContent={sharedContent}
60+
/>
6161
</$Container>
6262
);
6363
};
@@ -73,23 +73,21 @@ const $Container = styled.div`
7373
flex-direction: column;
7474
`;
7575

76-
const $HeaderSection = styled.div`
77-
display: flex;
78-
flex-direction: column;
79-
gap: 0.5rem;
80-
padding: 0.5rem;
76+
const $MarginModeSection = styled.div`
77+
flex-shrink: 0;
78+
padding: 0.5rem 0.5rem 0 0.5rem;
8179
background-color: var(--color-layer-1);
8280
border-top-right-radius: 0.75rem;
8381
border-top-left-radius: 0.75rem;
84-
flex: 1;
85-
min-height: 0;
8682
`;
8783

8884
const $TradeSideTabs = styled(Tabs)<{ activeTab: OrderSide }>`
8985
--tabs-height: 2.625rem;
9086
overflow: visible;
91-
padding: 0;
87+
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
9288
gap: 0.5rem;
89+
flex: 1;
90+
min-height: 0;
9391
9492
/* Base styles for all tabs */
9593
--trigger-backgroundColor: #12121280; /* #121212 at 50% opacity */

src/views/charts/TradingView/BaseTvChart.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ const $PriceChart = styled.div<{ isChartReady?: boolean }>`
8181
8282
height: 100%;
8383
84+
${({ isChartReady }) =>
85+
!isChartReady &&
86+
css`
87+
background-color: var(--color-layer-1);
88+
`}
89+
8490
#tv-price-chart {
8591
${({ isChartReady }) =>
8692
!isChartReady &&

src/views/dialogs/SetMarketLeverageDialog.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,21 @@ const $LeverageSlider = styled(Slider)`
326326
`;
327327

328328
const $SaveButton = styled(Button)`
329-
--button-textColor: var(--color-white) !important;
330329
--button-padding: 0.5rem 1.5rem;
331330
331+
/* White text when enabled */
332+
--button-textColor: var(--color-white);
333+
332334
span {
333-
color: var(--color-white) !important;
335+
color: var(--color-white);
336+
}
337+
338+
/* Darker, visible text when disabled */
339+
&:disabled {
340+
--button-textColor: var(--color-text-1) !important;
341+
342+
span {
343+
color: var(--color-text-1) !important;
344+
}
334345
}
335346
`;

0 commit comments

Comments
 (0)