Skip to content

Commit 8ae8151

Browse files
authored
fix header width, rebates panel, and spot flag (#19)
1 parent 80bb590 commit 8ae8151

File tree

6 files changed

+40
-28
lines changed

6 files changed

+40
-28
lines changed

src/App.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const Content = () => {
198198
return (
199199
<>
200200
<GlobalStyle />
201-
<$AppContainer isTradePage={isTradePage || isSpotPage}>
201+
<$AppContainer>
202202
<$Content
203203
isShowingHeader={isShowingHeader}
204204
isShowingFooter={isShowingFooter}
@@ -207,7 +207,7 @@ const Content = () => {
207207
<GlobalBackground />
208208
{isShowingHeader && <HeaderDesktop />}
209209
<RestrictionWarning />
210-
<$Main>
210+
<$Main isTradePage={isTradePage || isSpotPage}>
211211
<Suspense fallback={<LoadingSpace id="main" />}>
212212
<Routes>
213213
<Route path={`${AppRoute.Referrals}/*`} element={<AffiliatesPage />} />
@@ -362,16 +362,9 @@ function shouldForwardProp(propName: string, target: WebTarget): boolean {
362362
return true;
363363
}
364364

365-
const $AppContainer = styled.div<{ isTradePage?: boolean }>`
365+
const $AppContainer = styled.div`
366366
width: 100%;
367-
${({ isTradePage }) =>
368-
isTradePage
369-
? css`
370-
max-width: 1800px;
371-
`
372-
: css`
373-
max-width: 1600px;
374-
`}
367+
max-width: 1800px;
375368
margin-left: auto;
376369
margin-right: auto;
377370
`;
@@ -461,8 +454,23 @@ const $Content = styled.div<{
461454
transition: 0.3s var(--ease-out-expo);
462455
`;
463456

464-
const $Main = styled.main`
457+
const $Main = styled.main<{ isTradePage?: boolean }>`
465458
${layoutMixins.contentSectionAttached}
459+
460+
${({ isTradePage }) =>
461+
isTradePage
462+
? css`
463+
width: 100%;
464+
max-width: 1800px;
465+
`
466+
: css`
467+
width: 100%;
468+
max-width: 1600px;
469+
`}
470+
471+
margin-left: auto;
472+
margin-right: auto;
473+
466474
box-shadow: none;
467475
468476
grid-area: Main;
@@ -476,8 +484,8 @@ const $Main = styled.main`
476484
padding-right: 1rem;
477485
478486
/* Override min-width from contentSectionAttached to allow proper grid constraints */
479-
min-width: 0;
480-
max-width: 100%;
487+
/* min-width: 0;
488+
max-width: 100%; */
481489
overflow-x: hidden;
482490
`;
483491

src/constants/statsig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export enum StatsigFlags {
1818
ffSwapEnabled = 'ff_swap_ui_web',
1919
ffSpot = 'ff_spot',
2020
abPopupDeposit = 'ab_popup_deposit',
21+
ffSpotBonk = 'ff_spot_bonk',
2122
}
2223

2324
export enum CustomFlags {

src/hooks/useEnableSpot.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
// import { isDev } from '@/constants/networks';
2+
import { StatsigFlags } from '@/constants/statsig';
3+
4+
import { useStatsigGateValue } from './useStatsig';
5+
16
export const useEnableSpot = () => {
2-
// const forcedSpot = testFlags.spot;
3-
// const spotFF = useStatsigGateValue(StatsigFlags.ffSpot);
4-
return true;
7+
const spotFF = useStatsigGateValue(StatsigFlags.ffSpotBonk);
8+
return spotFF; // could also do only spotFF;
59
};

src/layout/Header/HeaderDesktop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const $Header = styled.header`
217217
margin-top: 2rem;
218218
margin-bottom: 2rem;
219219
width: 100%;
220-
max-width: 1600px;
220+
max-width: 1800px;
221221
margin-left: auto;
222222
margin-right: auto;
223223
padding-left: 1rem;

src/pages/spot/Spot.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AppRoute } from '@/constants/routes';
1616
import { SPOT_DUST_USD_THRESHOLD } from '@/constants/spot';
1717

1818
import { useCurrentSpotToken } from '@/hooks/useCurrentSpotToken';
19+
import { useEnableSpot } from '@/hooks/useEnableSpot';
1920
import { useSpotTokenSearch } from '@/hooks/useSpotTokenSearch';
2021

2122
import breakpoints from '@/styles/breakpoints';
@@ -70,6 +71,7 @@ const SpotPage = () => {
7071
useAppSelector(BonsaiCore.spot.portfolioTrades.loading) !== 'success' && canLoadSpotData;
7172

7273
const horizontalPanelHeightPxBase = useAppSelector(getHorizontalPanelHeightPx);
74+
7375
const setPanelHeight = useCallback(
7476
(h: number) => {
7577
dispatch(setHorizontalPanelHeightPx(h));
@@ -255,6 +257,12 @@ const SpotPage = () => {
255257
}
256258
}, [isSearchOpen]);
257259

260+
const isSpotEnabled = useEnableSpot();
261+
if (!isSpotEnabled) {
262+
navigate(AppRoute.Trade);
263+
return null;
264+
}
265+
258266
return (
259267
<$SpotLayout
260268
tradeLayout={tradeLayout}

src/pages/token/CompetitionIncentivesPanel.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ import styled from 'styled-components';
55
import tw from 'twin.macro';
66

77
import { STRING_KEYS } from '@/constants/localization';
8-
import { isDev } from '@/constants/networks';
9-
import { StatsigFlags } from '@/constants/statsig';
108

119
import { useChaosLabsPnlDistribution } from '@/hooks/rewards/hooks';
1210
import { DEC_2025_COMPETITION_DETAILS } from '@/hooks/rewards/util';
1311
import { useAccounts } from '@/hooks/useAccounts';
1412
import { useNow } from '@/hooks/useNow';
15-
import { useStatsigGateValue } from '@/hooks/useStatsig';
1613
import { useStringGetter } from '@/hooks/useStringGetter';
1714

1815
import { layoutMixins } from '@/styles/layoutMixins';
@@ -25,13 +22,7 @@ import { SuccessTag, TagSize } from '@/components/Tag';
2522
import { WithTooltip } from '@/components/WithTooltip';
2623

2724
export const CompetitionIncentivesPanel = () => {
28-
const isSept2025RewardsBase = useStatsigGateValue(StatsigFlags.ffSeptember2025Rewards);
29-
const isSept2025Rewards = isDev ? true : isSept2025RewardsBase;
30-
if (isSept2025Rewards) {
31-
return <September2025RewardsPanel />;
32-
}
33-
34-
return null;
25+
return <September2025RewardsPanel />;
3526
};
3627

3728
const September2025RewardsPanel = () => {

0 commit comments

Comments
 (0)