Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2749e6e59 | ||
|
|
582dade27e |
+13
-12
@@ -1,4 +1,4 @@
|
|||||||
import { Suspense } from 'react';
|
import { lazy, Suspense } from 'react';
|
||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
import styled, { AnyStyledComponent, css } from 'styled-components';
|
import styled, { AnyStyledComponent, css } from 'styled-components';
|
||||||
import { WagmiConfig } from 'wagmi';
|
import { WagmiConfig } from 'wagmi';
|
||||||
@@ -25,16 +25,6 @@ import { SubaccountProvider } from '@/hooks/useSubaccount';
|
|||||||
|
|
||||||
import { GuardedMobileRoute } from '@/components/GuardedMobileRoute';
|
import { GuardedMobileRoute } from '@/components/GuardedMobileRoute';
|
||||||
|
|
||||||
import MarketsPage from '@/pages/markets/Markets';
|
|
||||||
import PortfolioPage from '@/pages/portfolio/Portfolio';
|
|
||||||
import { AlertsPage } from '@/pages/AlertsPage';
|
|
||||||
import ProfilePage from '@/pages/Profile';
|
|
||||||
import { SettingsPage } from '@/pages/settings/Settings';
|
|
||||||
import TradePage from '@/pages/trade/Trade';
|
|
||||||
import { RewardsPage } from '@/pages/rewards/RewardsPage';
|
|
||||||
import { TermsOfUsePage } from '@/pages/TermsOfUsePage';
|
|
||||||
import { PrivacyPolicyPage } from '@/pages/PrivacyPolicyPage';
|
|
||||||
|
|
||||||
import { HeaderDesktop } from '@/layout/Header/HeaderDesktop';
|
import { HeaderDesktop } from '@/layout/Header/HeaderDesktop';
|
||||||
import { FooterDesktop } from '@/layout/Footer/FooterDesktop';
|
import { FooterDesktop } from '@/layout/Footer/FooterDesktop';
|
||||||
import { FooterMobile } from '@/layout/Footer/FooterMobile';
|
import { FooterMobile } from '@/layout/Footer/FooterMobile';
|
||||||
@@ -46,11 +36,22 @@ import { config } from '@/lib/wagmi';
|
|||||||
|
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
import { LoadingSpace } from './components/Loading/LoadingSpinner';
|
||||||
|
|
||||||
import '@/styles/constants.css';
|
import '@/styles/constants.css';
|
||||||
import '@/styles/fonts.css';
|
import '@/styles/fonts.css';
|
||||||
import '@/styles/web3modal.css';
|
import '@/styles/web3modal.css';
|
||||||
|
|
||||||
|
const MarketsPage = lazy(() => import('@/pages/markets/Markets'));
|
||||||
|
const PortfolioPage = lazy(() => import('@/pages/portfolio/Portfolio'));
|
||||||
|
const AlertsPage = lazy(() => import('@/pages/AlertsPage'));
|
||||||
|
const ProfilePage = lazy(() => import('@/pages/Profile'));
|
||||||
|
const SettingsPage = lazy(() => import('@/pages/settings/Settings'));
|
||||||
|
const TradePage = lazy(() => import('@/pages/trade/Trade'));
|
||||||
|
const RewardsPage = lazy(() => import('@/pages/rewards/RewardsPage'));
|
||||||
|
const TermsOfUsePage = lazy(() => import('@/pages/TermsOfUsePage'));
|
||||||
|
const PrivacyPolicyPage = lazy(() => import('@/pages/PrivacyPolicyPage'));
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
const Content = () => {
|
const Content = () => {
|
||||||
@@ -69,7 +70,7 @@ const Content = () => {
|
|||||||
{isNotTablet && <HeaderDesktop />}
|
{isNotTablet && <HeaderDesktop />}
|
||||||
|
|
||||||
<Styled.Main>
|
<Styled.Main>
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={<LoadingSpace id="main" />}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path={AppRoute.Trade}>
|
<Route path={AppRoute.Trade}>
|
||||||
<Route path=":market" element={<TradePage />} />
|
<Route path=":market" element={<TradePage />} />
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { DialogPlacement } from '@/components/Dialog';
|
import { DialogPlacement } from '@/components/Dialog';
|
||||||
import { NotificationsMenu } from '@/views/menus/NotificationsMenu';
|
import { NotificationsMenu } from '@/views/menus/NotificationsMenu';
|
||||||
|
|
||||||
export const AlertsPage = () => <NotificationsMenu placement={DialogPlacement.Inline} />;
|
const AlertsPage = () => <NotificationsMenu placement={DialogPlacement.Inline} />;
|
||||||
|
|
||||||
|
export default AlertsPage;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import styled, { AnyStyledComponent } from 'styled-components';
|
|||||||
|
|
||||||
import { articleMixins } from '@/styles/articleMixins';
|
import { articleMixins } from '@/styles/articleMixins';
|
||||||
|
|
||||||
export const PrivacyPolicyPage = () => (
|
const PrivacyPolicyPage = () => (
|
||||||
<Styled.Article>
|
<Styled.Article>
|
||||||
<header>
|
<header>
|
||||||
<h1>Privacy Policy</h1>
|
<h1>Privacy Policy</h1>
|
||||||
@@ -10,6 +10,8 @@ export const PrivacyPolicyPage = () => (
|
|||||||
</Styled.Article>
|
</Styled.Article>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export default PrivacyPolicyPage;
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
Styled.Article = styled.article`
|
Styled.Article = styled.article`
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import styled, { AnyStyledComponent } from 'styled-components';
|
|||||||
|
|
||||||
import { articleMixins } from '@/styles/articleMixins';
|
import { articleMixins } from '@/styles/articleMixins';
|
||||||
|
|
||||||
export const TermsOfUsePage = () => (
|
const TermsOfUsePage = () => (
|
||||||
<Styled.Article>
|
<Styled.Article>
|
||||||
<header>
|
<header>
|
||||||
<h1>Sample Terms of Use</h1>
|
<h1>Sample Terms of Use</h1>
|
||||||
@@ -1076,6 +1076,8 @@ export const TermsOfUsePage = () => (
|
|||||||
</Styled.Article>
|
</Styled.Article>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export default TermsOfUsePage;
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
Styled.Article = styled.article`
|
Styled.Article = styled.article`
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
|
import { lazy, Suspense } from 'react';
|
||||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
import styled, { type AnyStyledComponent } from 'styled-components';
|
import styled, { type AnyStyledComponent } from 'styled-components';
|
||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
import { OnboardingState } from '@/constants/account';
|
import { OnboardingState } from '@/constants/account';
|
||||||
|
import { ButtonAction } from '@/constants/buttons';
|
||||||
import { DialogTypes } from '@/constants/dialogs';
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { HistoryRoute, PortfolioRoute } from '@/constants/routes';
|
import { HistoryRoute, PortfolioRoute } from '@/constants/routes';
|
||||||
|
|
||||||
import { useAccountBalance, useBreakpoints, useDocumentTitle, useStringGetter } from '@/hooks';
|
import { useAccountBalance, useBreakpoints, useDocumentTitle, useStringGetter } from '@/hooks';
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
import { FillsTable, FillsTableColumnKey } from '@/views/tables/FillsTable';
|
import { FillsTable, FillsTableColumnKey } from '@/views/tables/FillsTable';
|
||||||
import { FundingPaymentsTable } from '@/views/tables/FundingPaymentsTable';
|
import { FundingPaymentsTable } from '@/views/tables/FundingPaymentsTable';
|
||||||
import { TransferHistoryTable } from '@/views/tables/TransferHistoryTable';
|
import { TransferHistoryTable } from '@/views/tables/TransferHistoryTable';
|
||||||
|
import { Button } from '@/components/Button';
|
||||||
import { Icon, IconName } from '@/components/Icon';
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
import { NavigationMenu } from '@/components/NavigationMenu';
|
import { NavigationMenu } from '@/components/NavigationMenu';
|
||||||
import { WithSidebar } from '@/components/WithSidebar';
|
import { WithSidebar } from '@/components/WithSidebar';
|
||||||
@@ -20,15 +23,15 @@ import { getOnboardingState, getSubaccount } from '@/state/accountSelectors';
|
|||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
|
|
||||||
import { PortfolioNavMobile } from './PortfolioNavMobile';
|
import { PortfolioNavMobile } from './PortfolioNavMobile';
|
||||||
import { Overview } from './Overview';
|
import { LoadingSpace } from '@/components/Loading/LoadingSpinner';
|
||||||
import { Positions } from './Positions';
|
|
||||||
import { Orders } from './Orders';
|
|
||||||
import { Fees } from './Fees';
|
|
||||||
import { History } from './History';
|
|
||||||
|
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
const Overview = lazy(() => import('./Overview').then((module) => ({ default: module.Overview })));
|
||||||
import { Button } from '@/components/Button';
|
const Positions = lazy(() =>
|
||||||
import { ButtonAction } from '@/constants/buttons';
|
import('./Positions').then((module) => ({ default: module.Positions }))
|
||||||
|
);
|
||||||
|
const Orders = lazy(() => import('./Orders').then((module) => ({ default: module.Orders })));
|
||||||
|
const Fees = lazy(() => import('./Fees').then((module) => ({ default: module.Fees })));
|
||||||
|
const History = lazy(() => import('./History').then((module) => ({ default: module.History })));
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -44,49 +47,51 @@ export default () => {
|
|||||||
useDocumentTitle(stringGetter({ key: STRING_KEYS.PORTFOLIO }));
|
useDocumentTitle(stringGetter({ key: STRING_KEYS.PORTFOLIO }));
|
||||||
|
|
||||||
const routesComponent = (
|
const routesComponent = (
|
||||||
<Routes>
|
<Suspense fallback={<LoadingSpace id="portfolio" />}>
|
||||||
<Route path={PortfolioRoute.Overview} element={<Overview />} />
|
<Routes>
|
||||||
<Route path={PortfolioRoute.Positions} element={<Positions />} />
|
<Route path={PortfolioRoute.Overview} element={<Overview />} />
|
||||||
<Route path={PortfolioRoute.Orders} element={<Orders />} />
|
<Route path={PortfolioRoute.Positions} element={<Positions />} />
|
||||||
<Route path={PortfolioRoute.Fees} element={<Fees />} />
|
<Route path={PortfolioRoute.Orders} element={<Orders />} />
|
||||||
<Route path={PortfolioRoute.History} element={<History />}>
|
<Route path={PortfolioRoute.Fees} element={<Fees />} />
|
||||||
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
|
<Route path={PortfolioRoute.History} element={<History />}>
|
||||||
<Route
|
<Route index path="*" element={<Navigate to={HistoryRoute.Trades} />} />
|
||||||
path={HistoryRoute.Trades}
|
<Route
|
||||||
element={
|
path={HistoryRoute.Trades}
|
||||||
<FillsTable
|
element={
|
||||||
columnKeys={
|
<FillsTable
|
||||||
isTablet
|
columnKeys={
|
||||||
? [
|
isTablet
|
||||||
FillsTableColumnKey.Time,
|
? [
|
||||||
FillsTableColumnKey.TypeAmount,
|
FillsTableColumnKey.Time,
|
||||||
FillsTableColumnKey.PriceFee,
|
FillsTableColumnKey.TypeAmount,
|
||||||
]
|
FillsTableColumnKey.PriceFee,
|
||||||
: [
|
]
|
||||||
FillsTableColumnKey.Time,
|
: [
|
||||||
FillsTableColumnKey.Market,
|
FillsTableColumnKey.Time,
|
||||||
FillsTableColumnKey.Side,
|
FillsTableColumnKey.Market,
|
||||||
FillsTableColumnKey.AmountPrice,
|
FillsTableColumnKey.Side,
|
||||||
FillsTableColumnKey.TotalFee,
|
FillsTableColumnKey.AmountPrice,
|
||||||
FillsTableColumnKey.Type,
|
FillsTableColumnKey.TotalFee,
|
||||||
FillsTableColumnKey.Liquidity,
|
FillsTableColumnKey.Type,
|
||||||
]
|
FillsTableColumnKey.Liquidity,
|
||||||
}
|
]
|
||||||
withOuterBorder={isNotTablet}
|
}
|
||||||
/>
|
withOuterBorder={isNotTablet}
|
||||||
}
|
/>
|
||||||
/>
|
}
|
||||||
<Route
|
/>
|
||||||
path={HistoryRoute.Transfers}
|
<Route
|
||||||
element={<TransferHistoryTable withOuterBorder={isNotTablet} />}
|
path={HistoryRoute.Transfers}
|
||||||
/>
|
element={<TransferHistoryTable withOuterBorder={isNotTablet} />}
|
||||||
<Route
|
/>
|
||||||
path={HistoryRoute.Payments}
|
<Route
|
||||||
element={<FundingPaymentsTable withOuterBorder={isNotTablet} />}
|
path={HistoryRoute.Payments}
|
||||||
/>
|
element={<FundingPaymentsTable withOuterBorder={isNotTablet} />}
|
||||||
</Route>
|
/>
|
||||||
<Route path="*" element={<Navigate to={PortfolioRoute.Overview} replace />} />
|
</Route>
|
||||||
</Routes>
|
<Route path="*" element={<Navigate to={PortfolioRoute.Overview} replace />} />
|
||||||
|
</Routes>
|
||||||
|
</Suspense>
|
||||||
);
|
);
|
||||||
|
|
||||||
return isTablet ? (
|
return isTablet ? (
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { DYDXBalancePanel } from './DYDXBalancePanel';
|
|||||||
import { MigratePanel } from './MigratePanel';
|
import { MigratePanel } from './MigratePanel';
|
||||||
import { LaunchIncentivesPanel } from './LaunchIncentivesPanel';
|
import { LaunchIncentivesPanel } from './LaunchIncentivesPanel';
|
||||||
|
|
||||||
export const RewardsPage = () => {
|
const RewardsPage = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { governanceLearnMore, stakingLearnMore } = useURLConfigs();
|
const { governanceLearnMore, stakingLearnMore } = useURLConfigs();
|
||||||
@@ -84,6 +84,8 @@ export const RewardsPage = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default RewardsPage;
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
Styled.Page = styled.div`
|
Styled.Page = styled.div`
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { useNetworks } from '@/views/menus/useNetworks';
|
|||||||
import { SettingsHeader } from './SettingsHeader';
|
import { SettingsHeader } from './SettingsHeader';
|
||||||
import { ComingSoonSpace } from '@/components/ComingSoon';
|
import { ComingSoonSpace } from '@/components/ComingSoon';
|
||||||
|
|
||||||
export const SettingsPage = () => {
|
const SettingsPage = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -105,3 +105,5 @@ export const SettingsPage = () => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default SettingsPage;
|
||||||
|
|||||||
Reference in New Issue
Block a user