|
1 | 1 | import './CLNWallet.scss'; |
2 | | -import { useState } from 'react'; |
| 2 | +import { useState, lazy, Suspense } from 'react'; |
3 | 3 | import { motion, AnimatePresence } from 'framer-motion'; |
4 | 4 | import PerfectScrollbar from 'react-perfect-scrollbar'; |
5 | 5 | import { Card, Col, ButtonGroup, Spinner, Alert, Tab, Nav } from 'react-bootstrap'; |
6 | | - |
| 6 | +const CLNTransactionsList = lazy(() => import('../CLNTransactionsList/CLNTransactionsList')); |
| 7 | +const CLNOffersList = lazy(() => import('../CLNOffersList/CLNOffersList')); |
7 | 8 | import { LightningWalletSVG } from '../../../svgs/LightningWallet'; |
8 | 9 | import { WithdrawSVG } from '../../../svgs/Withdraw'; |
9 | 10 | import { DepositSVG } from '../../../svgs/Deposit'; |
10 | | -import CLNTransactionsList from '../CLNTransactionsList/CLNTransactionsList'; |
11 | 11 | import CurrencyBox from '../../shared/CurrencyBox/CurrencyBox'; |
12 | 12 | import { TRANSITION_DURATION } from '../../../utilities/constants'; |
13 | | -import CLNOffersList from '../CLNOffersList/CLNOffersList'; |
14 | 13 | import { useSelector } from 'react-redux'; |
15 | 14 | import { selectIsAuthenticated, selectWalletBalances } from '../../../store/rootSelectors'; |
| 15 | +import { Loading } from '../../ui/Loading/Loading'; |
16 | 16 |
|
17 | 17 | const CLNWallet = (props) => { |
18 | 18 | const isAuthenticated = useSelector(selectIsAuthenticated); |
@@ -85,10 +85,14 @@ const CLNWallet = (props) => { |
85 | 85 | > |
86 | 86 | <Tab.Content className="h-100 d-flex flex-column"> |
87 | 87 | <Tab.Pane className="h-100 list-scroll-container" eventKey="transactions"> |
88 | | - <CLNTransactionsList /> |
| 88 | + <Suspense fallback={<Loading />}> |
| 89 | + <CLNTransactionsList /> |
| 90 | + </Suspense> |
89 | 91 | </Tab.Pane> |
90 | 92 | <Tab.Pane eventKey="offers"> |
91 | | - <CLNOffersList /> |
| 93 | + <Suspense fallback={<Loading />}> |
| 94 | + <CLNOffersList /> |
| 95 | + </Suspense> |
92 | 96 | </Tab.Pane> |
93 | 97 | </Tab.Content> |
94 | 98 | </motion.div> |
|
0 commit comments