Skip to content

Commit d1341f7

Browse files
committed
fix: re-order the products pill
1 parent 15a95d5 commit d1341f7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/components/UI/Perps/components/PerpsProducts/PerpsProducts.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe('PerpsProducts', () => {
177177
expect(getByText('Crypto')).toBeOnTheScreen();
178178
});
179179

180-
it('renders a leading "New" pill when recently listed markets exist', () => {
180+
it('renders a trailing "New" pill when recently listed markets exist', () => {
181181
mockHasNewMarkets = true;
182182
mockCategories = [{ id: 'crypto', label: 'Crypto' }];
183183

@@ -197,7 +197,7 @@ describe('PerpsProducts', () => {
197197
expect(queryByTestId('perps-products-new')).toBeNull();
198198
});
199199

200-
it('renders the "New" pill before category pills and navigates with the "new" filter', () => {
200+
it('renders the "New" pill after category pills and navigates with the "new" filter', () => {
201201
mockHasNewMarkets = true;
202202
mockCategories = [{ id: 'crypto', label: 'Crypto' }];
203203

app/components/UI/Perps/components/PerpsProducts/PerpsProducts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const PRODUCTS_ROW_COUNT = 2;
4848
* PerpsProducts – grid of category pills for the Perps home screen.
4949
*
5050
* Categories are driven by `MARKET_CATEGORIES` from `@metamask/perps-controller`.
51-
* Pills whose category has zero available markets are hidden. A leading
51+
* Pills whose category has zero available markets are hidden. A trailing
5252
* "New" pill is shown when any market was listed within the last 30 days
5353
* (see `useHasNewMarkets`).
5454
* Tapping a pill navigates to the Markets list screen with that category
@@ -67,7 +67,7 @@ const PerpsProducts: React.FC<PerpsProductsProps> = ({
6767
const hasNewMarkets = useHasNewMarkets();
6868

6969
const categoriesWithLabels = useMemo(
70-
() => (hasNewMarkets ? [NEW_CATEGORY, ...categories] : categories),
70+
() => (hasNewMarkets ? [...categories, NEW_CATEGORY] : categories),
7171
[categories, hasNewMarkets],
7272
);
7373

0 commit comments

Comments
 (0)