@opexa/portal-components 0.0.341 → 0.0.343

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,12 @@
2
2
  import { useSearchParams } from 'next/navigation';
3
3
  import { useTimeout } from 'usehooks-ts';
4
4
  import { toaster } from '../../client/utils/toaster.js';
5
+ import { getQueryClient } from '../../utils/getQueryClient.js';
6
+ import { getSessionQueryKey } from '../../utils/queryKeys.js';
5
7
  export function LinkGoogleAccountObserver() {
6
8
  const searchParams = useSearchParams();
7
9
  const code = searchParams.get('message') ?? searchParams.get('status');
10
+ const queryClient = getQueryClient();
8
11
  useTimeout(() => {
9
12
  if (code === 'duplicate') {
10
13
  return toaster.error({
@@ -13,6 +16,9 @@ export function LinkGoogleAccountObserver() {
13
16
  });
14
17
  }
15
18
  if (code === 'linked') {
19
+ queryClient.invalidateQueries({
20
+ queryKey: getSessionQueryKey(),
21
+ });
16
22
  return toaster.success({
17
23
  title: 'Google Account Linked Successfully',
18
24
  description: 'Your Google account has been successfully connected.',
@@ -1,10 +1,11 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { tz, TZDateMini } from '@date-fns/tz';
3
+ import { TZDateMini, tz } from '@date-fns/tz';
4
4
  import { endOfDay, format, startOfDay } from 'date-fns';
5
5
  import { usePathname, useRouter, useSearchParams } from 'next/navigation';
6
6
  import { useReducer } from 'react';
7
7
  import { twMerge } from 'tailwind-merge';
8
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
8
9
  import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
9
10
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
10
11
  import { useWithdrawalRecordsQuery } from '../../client/hooks/useWithdrawalRecordsQuery.js';
@@ -19,7 +20,6 @@ import { capitalize } from '../../utils/capitalize.js';
19
20
  import { formatNumber } from '../../utils/formatNumber.js';
20
21
  import { Empty } from '../shared/Empty.js';
21
22
  import { TableFilters } from './TableFilters.js';
22
- import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
23
23
  export function WithdrawalRecordsTable() {
24
24
  const router = useRouter();
25
25
  const pathname = usePathname();
@@ -87,7 +87,9 @@ export function WithdrawalRecordsTable() {
87
87
  withdrawalStatus: true,
88
88
  } }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
89
89
  ? 'Fetching latest withdrawal records...'
90
- : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference Number" }), enabled && _jsx(Table.Heading, { children: "Account Name" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: data.accountName }), _jsx(Table.Cell, { className: "!py-1 text-right", children: capitalize(data.type, {
90
+ : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference Number" }), enabled && _jsx(Table.Heading, { children: "Account Name" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), enabled && (_jsx(Table.Cell, { className: "!py-1", children: data.type === 'INSTAPAY' && data.accountName
91
+ ? data.accountName
92
+ : '' })), _jsx(Table.Cell, { className: "!py-1 text-right", children: capitalize(data.type, {
91
93
  delimiter: capitalize.delimiters.UNDERSCORE,
92
94
  }) }), _jsx(Table.Cell, { className: "!py-1", children: data.recipientMobileNumber }), _jsx(Table.Cell, { className: "!py-1 text-right", children: formatNumber(data.amount, {
93
95
  currency: localeInfo.currency.code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.341",
3
+ "version": "0.0.343",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",