chore(trading): revert moving rewards container to portfolio (#5441)

This commit is contained in:
m.ray 2023-12-05 12:19:42 +02:00 committed by GitHub
parent cdfd8a2d00
commit df20dbeee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 5 deletions

View File

@ -14,7 +14,6 @@ import { PositionsMenu } from '../../components/positions-menu';
import { WithdrawalsContainer } from '../../components/withdrawals-container';
import { OrdersContainer } from '../../components/orders-container';
import { LedgerContainer } from '../../components/ledger-container';
import { RewardsContainer } from '../../components/rewards-container';
import {
ResizableGrid,
ResizableGridPanel,
@ -87,9 +86,6 @@ export const Portfolio = () => {
<Tab id="ledger-entries" name={t('Ledger entries')}>
<LedgerContainer />
</Tab>
<Tab id="rewards" name={t('Rewards')}>
<RewardsContainer />
</Tab>
</Tabs>
</PortfolioGridChild>
</ResizableGridPanel>

View File

@ -68,6 +68,7 @@ describe('Navbar', () => {
['/portfolio', 'Portfolio'],
['/referrals', 'Referrals'],
['/fees', 'Fees'],
['/rewards', 'Rewards'],
[expect.stringContaining('governance'), 'Governance'],
];
@ -102,6 +103,7 @@ describe('Navbar', () => {
['/portfolio', 'Portfolio'],
['/referrals', 'Referrals'],
['/fees', 'Fees'],
['/rewards', 'Rewards'],
[expect.stringContaining('governance'), 'Governance'],
];
const links = menu.getAllByRole('link');

View File

@ -213,6 +213,11 @@ const NavbarMenu = ({ onClick }: { onClick: () => void }) => {
{t('Fees')}
</NavbarLink>
</NavbarItem>
<NavbarItem>
<NavbarLink to={Links.REWARDS()} onClick={onClick}>
{t('Rewards')}
</NavbarLink>
</NavbarItem>
<NavbarItem>
<NavbarLinkExternal to={useLinks(DApp.Governance)()}>
{t('Governance')}

View File

@ -70,7 +70,7 @@ export const RewardsContainer = () => {
);
return (
<div className="grid auto-rows-min grid-cols-6 gap-3 p-2">
<div className="grid auto-rows-min grid-cols-6 gap-3">
{/* Always show reward information for vega */}
<Card
key={params.reward_asset}

View File

@ -13,6 +13,7 @@ import { Deposit } from '../client-pages/deposit';
import { Withdraw } from '../client-pages/withdraw';
import { Transfer } from '../client-pages/transfer';
import { Fees } from '../client-pages/fees';
import { Rewards } from '../client-pages/rewards';
import { Routes as AppRoutes } from '../lib/links';
import { LayoutWithSky } from '../client-pages/referrals/layout';
import { Referrals } from '../client-pages/referrals/referrals';
@ -99,6 +100,16 @@ export const routerConfig: RouteObject[] = compact([
},
],
},
{
path: 'rewards/*',
element: <LayoutWithSidebar sidebar={<PortfolioSidebar />} />,
children: [
{
index: true,
element: <Rewards />,
},
],
},
{
path: 'markets/*',
element: (