@autobusal/account-transactions 1.0.2 → 1.1.0

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.
package/Browse/Admin.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useSearchParams } from 'react-router-dom';
2
2
  import { TFunction } from 'i18next';
3
3
  import { Meta, Table, Row } from '@autobusal/common';
4
- import { usePage } from '@autobusal/hooks';
4
+ import { usePage, useBreadcrumbs } from '@autobusal/hooks';
5
5
  import { getParams } from '@autobusal/utilities';
6
6
  import Information from '../Information';
7
7
  import { useGetTransactions } from '../services';
@@ -16,6 +16,8 @@ const Admin = ({ url, t }: Props): JSX.Element => {
16
16
 
17
17
  usePage('transactions');
18
18
 
19
+ useBreadcrumbs(t('transactions.browse.title', { ns: 'common' }));
20
+
19
21
  const { data, isLoading, isFetching } = useGetTransactions(getParams(searchParams, ['page', 'sort', 'order', 'q', 'id']));
20
22
 
21
23
  const rows = data?.data.map(item => (
package/Browse/Simple.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useSearchParams } from 'react-router-dom';
2
2
  import { TFunction } from 'i18next';
3
3
  import { Meta, Table, Row } from '@autobusal/common';
4
- import { usePage } from '@autobusal/hooks';
4
+ import { usePage, useBreadcrumbs } from '@autobusal/hooks';
5
5
  import { getParams } from '@autobusal/utilities';
6
6
  import Information from '../Information';
7
7
  import { useGetTransactions } from '../services';
@@ -16,6 +16,8 @@ const Simple = ({ url, t }: Props): JSX.Element => {
16
16
 
17
17
  usePage('transactions');
18
18
 
19
+ useBreadcrumbs(t('transactions.browse.title', { ns: 'common' }));
20
+
19
21
  const { data, isLoading, isFetching } = useGetTransactions(getParams(searchParams, ['page', 'sort', 'order', 'q']));
20
22
 
21
23
  const rows = data?.data.map(item => (
package/Manage/Admin.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TFunction } from 'i18next';
2
2
  import { useNavigate, useParams, Navigate } from 'react-router-dom';
3
3
  import { Meta, BackWithTitle, Viewer } from '@autobusal/common';
4
- import { usePage } from '@autobusal/hooks';
4
+ import { usePage, useBreadcrumbs } from '@autobusal/hooks';
5
5
  import { success } from '@autobusal/utilities';
6
6
  import { getText, getStatuses } from '../utilities';
7
7
  import { TransactionData } from '@autobusal/providers/types/account';
@@ -22,6 +22,10 @@ const Admin = ({ url, t }: Props): JSX.Element => {
22
22
  const navigate = useNavigate();
23
23
 
24
24
  const { data, isFetching } = useGetTransaction(id);
25
+
26
+ const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
27
+
28
+ useBreadcrumbs(title, [{ name: t('transactions.browse.title', { ns: 'common' }), url }]);
25
29
 
26
30
  const { mutate: Update, isPending } = usePostTransaction(id);
27
31
 
@@ -38,8 +42,6 @@ const Admin = ({ url, t }: Props): JSX.Element => {
38
42
  }
39
43
  });
40
44
  };
41
-
42
- const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
43
45
 
44
46
  return (
45
47
  <Meta title={ title }>
package/Manage/Simple.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TFunction } from 'i18next';
2
2
  import { useNavigate, useParams, Navigate } from 'react-router-dom';
3
3
  import { Meta, BackWithTitle, Viewer } from '@autobusal/common';
4
- import { usePage } from '@autobusal/hooks';
4
+ import { usePage, useBreadcrumbs } from '@autobusal/hooks';
5
5
  import { success } from '@autobusal/utilities';
6
6
  import { getText } from '../utilities';
7
7
  import { TransactionData } from '@autobusal/providers/types/account';
@@ -22,6 +22,10 @@ const Simple = ({ url, t }: Props): JSX.Element => {
22
22
  const navigate = useNavigate();
23
23
 
24
24
  const { data, isFetching } = useGetTransaction(id);
25
+
26
+ const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
27
+
28
+ useBreadcrumbs(title, [{ name: t('transactions.browse.title', { ns: 'common' }), url }]);
25
29
 
26
30
  const { mutate: Update, isPending } = usePostTransaction(id);
27
31
 
@@ -38,8 +42,6 @@ const Simple = ({ url, t }: Props): JSX.Element => {
38
42
  }
39
43
  });
40
44
  };
41
-
42
- const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
43
45
 
44
46
  return (
45
47
  <Meta title={ title }>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/account-transactions",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }