Skip to content

Commit f08b598

Browse files
authored
fix: small ui tweaks + different tracking (#27)
* replace user frontend property with frontend track event property * small ui tweaks * set debug logging to false * spacing and sizing issues fixed, removed launchable markets * fix launchable removals
1 parent a3c00b7 commit f08b598

File tree

16 files changed

+173
-152
lines changed

16 files changed

+173
-152
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ function shouldForwardProp(propName: string, target: WebTarget): boolean {
364364

365365
const $AppContainer = styled.div`
366366
width: 100%;
367-
max-width: 1800px;
367+
/* max-width: 1800px; */
368368
margin-left: auto;
369369
margin-right: auto;
370370
`;
@@ -461,7 +461,7 @@ const $Main = styled.main<{ isTradePage?: boolean }>`
461461
isTradePage
462462
? css`
463463
width: 100%;
464-
max-width: 1800px;
464+
max-width: 100%;
465465
`
466466
: css`
467467
width: 100%;

src/constants/analytics.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export const AnalyticsUserProperties = unionize(
6161
'MOBILE' | 'TABLET' | 'DESKTOP_SMALL' | 'DESKTOP_MEDIUM' | 'DESKTOP_LARGE' | 'UNSUPPORTED'
6262
>(),
6363
Version: ofType<string | null>(),
64-
Frontend: ofType<'bonk' | 'dydx'>(),
6564

6665
// Location
6766
Geo: ofType<string | null>(),
@@ -118,7 +117,6 @@ export const AnalyticsUserPropertyLoggableTypes = {
118117
CustomFlags: 'customFlags',
119118
UserId: 'userId',
120119
IsNewUser: 'isNewUser',
121-
Frontend: 'frontend',
122120
} as const satisfies Record<AnalyticsUserPropertyTypes, string>;
123121

124122
export type AnalyticsUserProperty = UnionOf<typeof AnalyticsUserProperties>;

src/constants/markets.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export enum MarketFilters {
6868
GAMING = 'gaming',
6969
MEMES = 'memes',
7070
RWA = 'tokenized-assets',
71-
LAUNCHABLE = 'launchable',
71+
// LAUNCHABLE = 'launchable',
7272
}
7373
export enum HiddenMarketFilterTags {
7474
DEX = 'decentralized-exchange-dex-token',
@@ -91,10 +91,10 @@ export const MARKET_FILTER_OPTIONS: Record<
9191
[MarketFilters.NEW]: {
9292
labelStringKey: STRING_KEYS.RECENTLY_LISTED,
9393
},
94-
[MarketFilters.LAUNCHABLE]: {
95-
labelStringKey: STRING_KEYS.LAUNCHABLE,
96-
isNew: true,
97-
},
94+
// [MarketFilters.LAUNCHABLE]: {
95+
// labelStringKey: STRING_KEYS.LAUNCHABLE,
96+
// isNew: true,
97+
// },
9898
[MarketFilters.MEMES]: {
9999
labelStringKey: STRING_KEYS.MEME,
100100
},

src/hooks/useAnalytics.ts

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

7373
useEffect(() => {
7474
identify(AnalyticsUserProperties.CustomDomainReferrer(document.referrer));
75-
identify(AnalyticsUserProperties.Frontend('bonk'));
7675
}, []);
7776

7877
useEffect(() => {

src/hooks/useEnableSpot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// import { isDev } from '@/constants/networks';
1+
import { isDev } from '@/constants/networks';
22
import { StatsigFlags } from '@/constants/statsig';
33

44
import { useStatsigGateValue } from './useStatsig';
55

66
export const useEnableSpot = () => {
77
const spotFF = useStatsigGateValue(StatsigFlags.ffSpotBonk);
8-
return spotFF; // could also do only spotFF;
8+
return isDev || spotFF;
99
};

src/hooks/useMarketsData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ const filterFunctions: Record<MarketFilters, (market: MarketData) => boolean | u
6565
[MarketFilters.RWA]: (market) => {
6666
return market.sectorTags?.includes(MarketFilters.RWA);
6767
},
68-
[MarketFilters.LAUNCHABLE]: (market) => {
69-
return market.isUnlaunched;
70-
},
68+
// [MarketFilters.LAUNCHABLE]: (market) => {
69+
// return market.isUnlaunched;
70+
// },
7171
};
7272

7373
const sortByMarketCap = (a: AssetData, b: AssetData) => {

src/layout/Header/HeaderDesktop.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const HeaderDesktop = () => {
194194
};
195195
const $Header = styled.header`
196196
--header-horizontal-padding-mobile: 0.5rem;
197-
--trigger-height: 2.25rem;
197+
--trigger-height: 2rem;
198198
--logo-width: 12rem;
199199
200200
${layoutMixins.container}
@@ -203,10 +203,10 @@ const $Header = styled.header`
203203
border-radius: 0.75rem;
204204
overflow: visible;
205205
height: var(--page-currentHeaderHeight);
206-
margin-top: 2rem;
207-
margin-bottom: 2rem;
206+
margin-top: 1.75rem;
207+
margin-bottom: 1rem;
208208
width: 100%;
209-
max-width: 1800px;
209+
/* max-width: 100%; */
210210
margin-left: auto;
211211
margin-right: auto;
212212
padding-left: 1rem;

src/lib/analytics/analytics.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ export const identify = (property: AnalyticsUserProperty) => {
2929
};
3030

3131
export const track = (event: AnalyticsEvent) => {
32+
const eventPayload = { ...event.payload, frontend: 'bonk' };
33+
3234
if (DEBUG_ANALYTICS || import.meta.env.VITE_LOG_TRACK_EVENTS === 'true') {
3335
// eslint-disable-next-line no-console
34-
console.log(`[Analytics] ${event.type}`, event.payload);
36+
console.log(`[Analytics] ${event.type}`, eventPayload);
3537
}
3638
const customEvent = customTrackEvent({
37-
detail: { eventType: event.type, eventData: event.payload },
39+
detail: {
40+
eventType: event.type,
41+
eventData: eventPayload,
42+
},
3843
});
3944

4045
globalThis.dispatchEvent(customEvent);

src/pages/markets/MarketsBanners.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { Link } from '@/components/Link';
2323
import { Output, OutputType } from '@/components/Output';
2424

2525
import { useAppDispatch, useAppSelector } from '@/state/appTypes';
26-
import { setShouldHideLaunchableMarkets } from '@/state/appUiConfigs';
26+
// import { setShouldHideLaunchableMarkets } from '@/state/appUiConfigs';
2727
import {
2828
setHasDismissedNoFeeBanner,
2929
setHasDismissedPmlBanner,
@@ -34,7 +34,8 @@ import {
3434
getHasDismissedPmlBanner,
3535
getHasDismissedRebateBanner,
3636
} from '@/state/dismissableSelectors';
37-
import { setMarketFilter } from '@/state/perpetuals';
37+
38+
// import { setMarketFilter } from '@/state/perpetuals';
3839

3940
export const MarketsBanners = ({
4041
marketsTableRef,
@@ -44,7 +45,8 @@ export const MarketsBanners = ({
4445
const stringGetter = useStringGetter();
4546
const allMarkets = useMarketsData({
4647
filter: MarketFilters.ALL,
47-
forceShowUnlaunchedMarkets: true,
48+
forceShowUnlaunchedMarkets: false,
49+
forceHideUnlaunchedMarkets: true,
4850
}).markets;
4951
const launchable = useMemo(() => allMarkets.filter((f) => f.isUnlaunched), [allMarkets]);
5052
const launched = useMemo(() => allMarkets.filter((f) => !f.isUnlaunched), [allMarkets]);
@@ -68,8 +70,8 @@ export const MarketsBanners = ({
6870
};
6971

7072
const onClickPmlBanner = () => {
71-
dispatch(setShouldHideLaunchableMarkets(false));
72-
dispatch(setMarketFilter(MarketFilters.LAUNCHABLE));
73+
// dispatch(setShouldHideLaunchableMarkets(false));
74+
// dispatch(setMarketFilter(MarketFilters.LAUNCHABLE));
7375
marketsTableRef?.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
7476
};
7577

src/pages/portfolio/Portfolio.tsx

Lines changed: 92 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -83,91 +83,95 @@ const PortfolioPage = () => {
8383

8484
useDocumentTitle(stringGetter({ key: STRING_KEYS.PORTFOLIO }));
8585

86-
const routesComponent = isSimpleUi ? (
87-
<Suspense fallback={<LoadingSpace id="portfolio" />}>
88-
<Routes>
89-
<Route path={PortfolioRoute.History} element={<SimpleUiHistory />}>
90-
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
91-
<Route path={HistoryRoute.Trades} element={<TradeHistoryList />} />
92-
<Route path={HistoryRoute.Transfers} element={<AccountHistoryList />} />
93-
<Route path={HistoryRoute.Payments} element={<FundingHistoryList />} />
94-
</Route>
95-
<Route
96-
path="*"
97-
element={<Navigate to={`${PortfolioRoute.History}/${HistoryRoute.Trades}`} replace />}
98-
/>
99-
</Routes>
100-
</Suspense>
101-
) : (
102-
<Suspense fallback={<LoadingSpace id="portfolio" />}>
103-
<Routes>
104-
<Route path={PortfolioRoute.Overview} element={<Overview />} />
105-
<Route path={PortfolioRoute.Positions} element={<Positions />} />
106-
<Route path={PortfolioRoute.Orders} element={<Orders />} />
107-
<Route path={PortfolioRoute.Fees} element={<Fees />} />
108-
<Route path={PortfolioRoute.EquityTiers} element={<EquityTiers />} />
109-
<Route path={PortfolioRoute.History} element={<History />}>
110-
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
111-
<Route
112-
path={HistoryRoute.Trades}
113-
element={
114-
<FillsTable
115-
initialPageSize={initialPageSize}
116-
columnKeys={
117-
isTablet
118-
? [
119-
FillsTableColumnKey.Time,
120-
FillsTableColumnKey.TypeAmount,
121-
FillsTableColumnKey.PriceFee,
122-
]
123-
: [
124-
FillsTableColumnKey.Market,
125-
FillsTableColumnKey.Time,
126-
FillsTableColumnKey.Type,
127-
FillsTableColumnKey.Side,
128-
FillsTableColumnKey.AmountTag,
129-
FillsTableColumnKey.Price,
130-
FillsTableColumnKey.Total,
131-
FillsTableColumnKey.Fee,
132-
FillsTableColumnKey.Liquidity,
133-
]
86+
const routesComponent = (
87+
<div className="p-1">
88+
{isSimpleUi ? (
89+
<Suspense fallback={<LoadingSpace id="portfolio" />}>
90+
<Routes>
91+
<Route path={PortfolioRoute.History} element={<SimpleUiHistory />}>
92+
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
93+
<Route path={HistoryRoute.Trades} element={<TradeHistoryList />} />
94+
<Route path={HistoryRoute.Transfers} element={<AccountHistoryList />} />
95+
<Route path={HistoryRoute.Payments} element={<FundingHistoryList />} />
96+
</Route>
97+
<Route
98+
path="*"
99+
element={<Navigate to={`${PortfolioRoute.History}/${HistoryRoute.Trades}`} replace />}
100+
/>
101+
</Routes>
102+
</Suspense>
103+
) : (
104+
<Suspense fallback={<LoadingSpace id="portfolio" />}>
105+
<Routes>
106+
<Route path={PortfolioRoute.Overview} element={<Overview />} />
107+
<Route path={PortfolioRoute.Positions} element={<Positions />} />
108+
<Route path={PortfolioRoute.Orders} element={<Orders />} />
109+
<Route path={PortfolioRoute.Fees} element={<Fees />} />
110+
<Route path={PortfolioRoute.EquityTiers} element={<EquityTiers />} />
111+
<Route path={PortfolioRoute.History} element={<History />}>
112+
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
113+
<Route
114+
path={HistoryRoute.Trades}
115+
element={
116+
<FillsTable
117+
initialPageSize={initialPageSize}
118+
columnKeys={
119+
isTablet
120+
? [
121+
FillsTableColumnKey.Time,
122+
FillsTableColumnKey.TypeAmount,
123+
FillsTableColumnKey.PriceFee,
124+
]
125+
: [
126+
FillsTableColumnKey.Market,
127+
FillsTableColumnKey.Time,
128+
FillsTableColumnKey.Type,
129+
FillsTableColumnKey.Side,
130+
FillsTableColumnKey.AmountTag,
131+
FillsTableColumnKey.Price,
132+
FillsTableColumnKey.Total,
133+
FillsTableColumnKey.Fee,
134+
FillsTableColumnKey.Liquidity,
135+
]
136+
}
137+
withOuterBorder={isNotTablet}
138+
/>
134139
}
135-
withOuterBorder={isNotTablet}
136140
/>
137-
}
138-
/>
139-
<Route
140-
path={HistoryRoute.Transfers}
141-
element={
142-
<TransferHistoryTable
143-
initialPageSize={initialPageSize}
144-
withOuterBorder={isNotTablet}
141+
<Route
142+
path={HistoryRoute.Transfers}
143+
element={
144+
<TransferHistoryTable
145+
initialPageSize={initialPageSize}
146+
withOuterBorder={isNotTablet}
147+
/>
148+
}
145149
/>
146-
}
147-
/>
148-
<Route
149-
path={HistoryRoute.VaultTransfers}
150-
element={
151-
<VaultTransactionsTable
152-
withOuterBorders
153-
withTxHashLink
154-
emptyString={stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_BALANCE })}
150+
<Route
151+
path={HistoryRoute.VaultTransfers}
152+
element={
153+
<VaultTransactionsTable
154+
withOuterBorders
155+
withTxHashLink
156+
emptyString={stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_BALANCE })}
157+
/>
158+
}
155159
/>
156-
}
157-
/>
158-
<Route
159-
path={HistoryRoute.Payments}
160-
element={
161-
<FundingPaymentsTable
162-
initialPageSize={initialPageSize}
163-
withOuterBorder={isNotTablet}
160+
<Route
161+
path={HistoryRoute.Payments}
162+
element={
163+
<FundingPaymentsTable
164+
initialPageSize={initialPageSize}
165+
withOuterBorder={isNotTablet}
166+
/>
167+
}
164168
/>
165-
}
166-
/>
167-
</Route>
168-
<Route path="*" element={<Navigate to={PortfolioRoute.Overview} replace />} />
169-
</Routes>
170-
</Suspense>
169+
</Route>
170+
<Route path="*" element={<Navigate to={PortfolioRoute.Overview} replace />} />
171+
</Routes>
172+
</Suspense>
173+
)}
174+
</div>
171175
);
172176

173177
if (isSimpleUi) {
@@ -180,9 +184,9 @@ const PortfolioPage = () => {
180184
<$MobileContent>{routesComponent}</$MobileContent>
181185
</$PortfolioMobile>
182186
) : (
183-
<WithSidebar
187+
<$WithSidebar
184188
sidebar={
185-
<div tw="flexColumn h-full justify-between bg-color-layer-0">
189+
<div tw="flexColumn h-full min-h-[70svh] justify-between bg-color-layer-0">
186190
<$NavigationMenu
187191
items={[
188192
{
@@ -317,12 +321,17 @@ const PortfolioPage = () => {
317321
}
318322
>
319323
{routesComponent}
320-
</WithSidebar>
324+
</$WithSidebar>
321325
);
322326
};
323327

324328
export default PortfolioPage;
325329

330+
const $WithSidebar = styled(WithSidebar)`
331+
height: 100%;
332+
min-height: 100%;
333+
`;
334+
326335
const $PortfolioMobile = styled.div`
327336
min-height: 100%;
328337
${layoutMixins.expandingColumnWithHeader}

0 commit comments

Comments
 (0)