Skip to content

Commit

Permalink
fix: pass child routes as children to appease dep cruiser
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Oct 16, 2023
1 parent 07c5c98 commit 200907a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 6 additions & 8 deletions src/app/pages/fund/fund.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { Route, useNavigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

import { RouteUrls } from '@shared/route-urls';

import { useRouteHeader } from '@app/common/hooks/use-route-header';
import { Header } from '@app/components/header';
import { FullPageLoadingSpinner } from '@app/components/loading-spinner';
import { ReceiveStxModal } from '@app/pages/receive/receive-stx';
import { useCurrentStacksAccountAnchoredBalances } from '@app/query/stacks/balance/stx-balance.hooks';
import { ModalBackgroundWrapper } from '@app/routes/components/modal-background-wrapper';
import { useBackgroundLocationRedirect } from '@app/routes/hooks/use-background-location-redirect';
import { settingsRoutes } from '@app/routes/settings-routes';
import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';

import { FundLayout } from './fund.layout';

export function FundPage() {
interface FundPageProps {
children: React.ReactNode;
}
export function FundPage({ children }: FundPageProps) {
useBackgroundLocationRedirect(RouteUrls.Fund);
const navigate = useNavigate();
const currentAccount = useCurrentStacksAccount();
Expand All @@ -27,10 +28,7 @@ export function FundPage() {
<>
<FundLayout address={currentAccount.address} />
<>
<ModalBackgroundWrapper>
<Route path={RouteUrls.ReceiveStx} element={<ReceiveStxModal />} />
{settingsRoutes}
</ModalBackgroundWrapper>
<ModalBackgroundWrapper>{children}</ModalBackgroundWrapper>
</>
</>
);
Expand Down
5 changes: 4 additions & 1 deletion src/app/routes/app-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ function useAppRoutes() {
path={`${RouteUrls.Fund}/*`}
element={
<AccountGate>
<FundPage />
<FundPage>
<Route path={RouteUrls.ReceiveStx} element={<ReceiveStxModal />} />
{settingsRoutes}
</FundPage>
</AccountGate>
}
>
Expand Down

0 comments on commit 200907a

Please sign in to comment.