diff --git a/apps/admin-panel/app/actions/list.tsx b/apps/admin-panel/app/actions/list.tsx index fb38084fc..d6ec10f20 100644 --- a/apps/admin-panel/app/actions/list.tsx +++ b/apps/admin-panel/app/actions/list.tsx @@ -93,7 +93,7 @@ const List: React.FC = ({ dashboard = false }) => { const more = approvalProcesses.length - NUMBER_OF_ITEMS_IN_DASHBOARD - if (loading) return + if (loading && !data) return const getVisitUrl = (data: ActionNode) => { if ( diff --git a/apps/admin-panel/app/balance-sheet/page.tsx b/apps/admin-panel/app/balance-sheet/page.tsx index 0d3f4d08b..a10f60034 100644 --- a/apps/admin-panel/app/balance-sheet/page.tsx +++ b/apps/admin-panel/app/balance-sheet/page.tsx @@ -103,7 +103,7 @@ export default function BalanceSheetPage() { <> {error.message} - if (loading) { + if (loading && !data) { return ( diff --git a/apps/admin-panel/app/chart-of-accounts/page.tsx b/apps/admin-panel/app/chart-of-accounts/page.tsx index fdfd4c5bc..ea1c66bfe 100644 --- a/apps/admin-panel/app/chart-of-accounts/page.tsx +++ b/apps/admin-panel/app/chart-of-accounts/page.tsx @@ -110,7 +110,7 @@ const ChartOfAccountsValues: React.FC = ({ error, dateRange, }) => { - if (loading) return + if (loading && !data) return if (error) return

{error.message}

return ( @@ -185,7 +185,7 @@ function ChartOfAccountsPage() { @@ -193,7 +193,7 @@ function ChartOfAccountsPage() { diff --git a/apps/admin-panel/app/committees/[committee-id]/page.tsx b/apps/admin-panel/app/committees/[committee-id]/page.tsx index a12092d27..9c822c88a 100644 --- a/apps/admin-panel/app/committees/[committee-id]/page.tsx +++ b/apps/admin-panel/app/committees/[committee-id]/page.tsx @@ -49,7 +49,7 @@ function CommitteePage({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data?.committee]) - if (loading) { + if (loading && !data) { return } if (error) return
{error.message}
diff --git a/apps/admin-panel/app/credit-facilities/[credit-facility-id]/layout.tsx b/apps/admin-panel/app/credit-facilities/[credit-facility-id]/layout.tsx index 7b913477f..1bfdad9a0 100644 --- a/apps/admin-panel/app/credit-facilities/[credit-facility-id]/layout.tsx +++ b/apps/admin-panel/app/credit-facilities/[credit-facility-id]/layout.tsx @@ -133,7 +133,7 @@ export default function CreditFacilityLayout({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data?.creditFacility, currentTab]) - if (loading) return + if (loading && !data) return if (error) return
{error.message}
if (!data?.creditFacility) return
Not found
diff --git a/apps/admin-panel/app/customers/[customer-id]/kyc-status.tsx b/apps/admin-panel/app/customers/[customer-id]/kyc-status.tsx index baec1b152..bc05cc324 100644 --- a/apps/admin-panel/app/customers/[customer-id]/kyc-status.tsx +++ b/apps/admin-panel/app/customers/[customer-id]/kyc-status.tsx @@ -61,7 +61,7 @@ export const KycStatus: React.FC = ({ customerId }) => { } } - if (loading) return + if (loading && !data) return const details: DetailItemProps[] = [ { diff --git a/apps/admin-panel/app/customers/[customer-id]/layout.tsx b/apps/admin-panel/app/customers/[customer-id]/layout.tsx index e75359275..64d008dfb 100644 --- a/apps/admin-panel/app/customers/[customer-id]/layout.tsx +++ b/apps/admin-panel/app/customers/[customer-id]/layout.tsx @@ -82,7 +82,7 @@ export default function CustomerLayout({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data?.customer, currentTab]) - if (loading) return + if (loading && !data) return if (error) return
{error.message}
if (!data || !data.customer) return null diff --git a/apps/admin-panel/app/dashboard/page.tsx b/apps/admin-panel/app/dashboard/page.tsx index 817806955..272c81e0c 100644 --- a/apps/admin-panel/app/dashboard/page.tsx +++ b/apps/admin-panel/app/dashboard/page.tsx @@ -48,7 +48,7 @@ const Dashboard = () => {
- {loading ? ( + {loading && !data ? ( <> diff --git a/apps/admin-panel/app/disbursals/[disbursal-id]/page.tsx b/apps/admin-panel/app/disbursals/[disbursal-id]/page.tsx index 12afff328..3874f2a4d 100644 --- a/apps/admin-panel/app/disbursals/[disbursal-id]/page.tsx +++ b/apps/admin-panel/app/disbursals/[disbursal-id]/page.tsx @@ -54,7 +54,7 @@ function DisbursalPage({ variables: { id: disbursalId }, }) - if (loading) { + if (loading && !data) { return } if (error) return
{error.message}
diff --git a/apps/admin-panel/app/policies/[policy-id]/page.tsx b/apps/admin-panel/app/policies/[policy-id]/page.tsx index 5bdd9b2e7..6aa3b4990 100644 --- a/apps/admin-panel/app/policies/[policy-id]/page.tsx +++ b/apps/admin-panel/app/policies/[policy-id]/page.tsx @@ -63,7 +63,7 @@ function PolicyPage({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data?.policy]) - if (loading) { + if (loading && !data) { return } if (error) return
{error.message}
diff --git a/apps/admin-panel/app/profit-and-loss/page.tsx b/apps/admin-panel/app/profit-and-loss/page.tsx index 3ca5cd4aa..b0816e79c 100644 --- a/apps/admin-panel/app/profit-and-loss/page.tsx +++ b/apps/admin-panel/app/profit-and-loss/page.tsx @@ -134,7 +134,7 @@ export default function ProfitAndLossStatementPage() { return ( {error.message}
- if (loading) { + if (loading && !data) { return ( diff --git a/apps/admin-panel/app/regulatory-reporting/page.tsx b/apps/admin-panel/app/regulatory-reporting/page.tsx index 49dacb0c3..b85e1dfe1 100644 --- a/apps/admin-panel/app/regulatory-reporting/page.tsx +++ b/apps/admin-panel/app/regulatory-reporting/page.tsx @@ -154,7 +154,7 @@ const RegulatoryReportingPage: React.FC = () => { - {loading ? ( + {loading && !data ? (
diff --git a/apps/admin-panel/app/terms-templates/[terms-template-id]/page.tsx b/apps/admin-panel/app/terms-templates/[terms-template-id]/page.tsx index 3ca13582c..f227750dd 100644 --- a/apps/admin-panel/app/terms-templates/[terms-template-id]/page.tsx +++ b/apps/admin-panel/app/terms-templates/[terms-template-id]/page.tsx @@ -45,7 +45,7 @@ function TermsTemplatePage({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data?.termsTemplate]) - if (loading) return + if (loading && !data) return if (error) return
{error.message}
if (!data?.termsTemplate) return
Not found
diff --git a/apps/admin-panel/app/trial-balance/page.tsx b/apps/admin-panel/app/trial-balance/page.tsx index 12bfc9f12..0aa488cbb 100644 --- a/apps/admin-panel/app/trial-balance/page.tsx +++ b/apps/admin-panel/app/trial-balance/page.tsx @@ -237,7 +237,7 @@ const TrialBalanceValues: React.FC = ({ const subAccounts = data?.subAccounts if (error) return
{error.message}
- if (loading) { + if (loading && !data) { return } if (!total) return
No data
@@ -364,7 +364,7 @@ function TrialBalancePage() { } if (error) return
{error.message}
diff --git a/apps/admin-panel/app/withdrawals/[withdrawal-id]/page.tsx b/apps/admin-panel/app/withdrawals/[withdrawal-id]/page.tsx index f4cb5c998..86a9a1bc9 100644 --- a/apps/admin-panel/app/withdrawals/[withdrawal-id]/page.tsx +++ b/apps/admin-panel/app/withdrawals/[withdrawal-id]/page.tsx @@ -51,7 +51,7 @@ function WithdrawalPage({ variables: { id: withdrawalId }, }) - if (loading) { + if (loading && !data) { return } if (error) return
{error.message}
diff --git a/apps/admin-panel/components/app-sidebar/market-rate.tsx b/apps/admin-panel/components/app-sidebar/market-rate.tsx index 8877e3c91..48e29c0a8 100644 --- a/apps/admin-panel/components/app-sidebar/market-rate.tsx +++ b/apps/admin-panel/components/app-sidebar/market-rate.tsx @@ -10,7 +10,7 @@ export function MarketRate() { .centsToUsd(data?.realtimePrice?.usdCentsPerBtc || NaN) .toLocaleString() - if (loading) return + if (loading && !data) return return (
diff --git a/apps/admin-panel/components/app-sidebar/user-block.tsx b/apps/admin-panel/components/app-sidebar/user-block.tsx index ff1379d8f..2306da10a 100644 --- a/apps/admin-panel/components/app-sidebar/user-block.tsx +++ b/apps/admin-panel/components/app-sidebar/user-block.tsx @@ -33,7 +33,7 @@ gql` export function UserBlock() { const { data, loading } = useAvatarQuery() - if (loading) { + if (loading && !data) { return ( diff --git a/apps/admin-panel/components/data-table/index.tsx b/apps/admin-panel/components/data-table/index.tsx index c227ef352..3fc94e50d 100644 --- a/apps/admin-panel/components/data-table/index.tsx +++ b/apps/admin-panel/components/data-table/index.tsx @@ -127,7 +127,7 @@ const DataTable = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [data.length]) - if (loading) { + if (loading && !data) { return isMobile ? (
{Array.from({ length: 5 }).map((_, idx) => ( diff --git a/apps/admin-panel/components/paginated-table/index.tsx b/apps/admin-panel/components/paginated-table/index.tsx index 89d62ec0b..656dfa775 100644 --- a/apps/admin-panel/components/paginated-table/index.tsx +++ b/apps/admin-panel/components/paginated-table/index.tsx @@ -255,7 +255,7 @@ const PaginatedTable = ({ } } - if (loading) { + if (loading && !data) { return isMobile ? (
{Array.from({ length: pageSize }).map((_, idx) => ( @@ -501,45 +501,42 @@ const PaginatedTable = ({ )} - {!loading && - displayData.map(({ node }, idx) => ( - onClick?.(node)} - tabIndex={0} - className={`${onClick ? "cursor-pointer" : ""} ${ - focusedRowIndex === idx ? "bg-muted" : "" - } hover:bg-muted/50 transition-colors outline-none`} - onFocus={() => setFocusedRowIndex(idx)} - role="row" - aria-selected={focusedRowIndex === idx} - > - {columns.map((col) => ( - - {col.render - ? col.render(node[col.key], node) - : String(node[col.key])} - - ))} - {navigateTo && ( - - - - - - )} - - ))} + {displayData.map(({ node }, idx) => ( + onClick?.(node)} + tabIndex={0} + className={`${onClick ? "cursor-pointer" : ""} ${ + focusedRowIndex === idx ? "bg-muted" : "" + } hover:bg-muted/50 transition-colors outline-none`} + onFocus={() => setFocusedRowIndex(idx)} + role="row" + aria-selected={focusedRowIndex === idx} + > + {columns.map((col) => ( + + {col.render ? col.render(node[col.key], node) : String(node[col.key])} + + ))} + {navigateTo && ( + + + + + + )} + + ))}