Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beasy-mobile
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
G
beasy-mobile
Commits
b6aedca7
Commit
b6aedca7
authored
May 29, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the custom hook to retrieve and show transactions history
parent
b3c5e622
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
TransactionHistoryScreen.tsx
src/screens/TransactionHistoryScreen.tsx
+15
-7
No files found.
src/screens/TransactionHistoryScreen.tsx
View file @
b6aedca7
import
{
getTransactionsHistory
}
from
"@/utils/requests/transactions
"
;
import
Input
from
"@components/Input
"
;
import
TransactionInformationsItem
from
"@components/TransactionInformationsItem"
;
import
TransactionInformationsItem
from
"@components/TransactionInformationsItem"
;
import
BackgroundWithBeasyIconAndWhiteContentArea
from
"@components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea"
;
import
BackgroundWithBeasyIconAndWhiteContentArea
from
"@components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea"
;
import
Box
from
"@components/bases/Box"
;
import
useTransactionsHistory
from
"@hooks/useTransactionsHistory"
;
import
{
LOG
}
from
"@logger"
;
import
{
LOG
}
from
"@logger"
;
import
{
useQuery
}
from
"@tanstack/react-query"
;
import
{
RefreshControl
,
ScrollView
}
from
"react-native"
;
import
{
RefreshControl
,
ScrollView
}
from
"react-native"
;
const
log
=
LOG
.
extend
(
"TransactionHistoryScreen"
);
const
log
=
LOG
.
extend
(
"TransactionHistoryScreen"
);
...
@@ -10,21 +11,27 @@ const log = LOG.extend("TransactionHistoryScreen");
...
@@ -10,21 +11,27 @@ const log = LOG.extend("TransactionHistoryScreen");
const
TransactionHistoryScreen
=
()
=>
{
const
TransactionHistoryScreen
=
()
=>
{
log
.
verbose
(
"TransactionHistoryScreen"
);
log
.
verbose
(
"TransactionHistoryScreen"
);
const
{
data
,
isLoading
,
error
,
refetch
}
=
useQuery
({
const
{
transactionsHistory
:
data
,
isLoading
,
error
,
refetch
}
=
useTransactionsHistory
();
queryKey
:
[
"transactionsHistory"
],
queryFn
:
getTransactionsHistory
,
// const { data, isLoading, error, refetch } = useQuery({
});
// queryKey: ["transactionsHistory"],
// queryFn: getTransactionsHistory,
// });
console
.
info
(
"Data"
,
data
);
console
.
info
(
"Data"
,
data
);
return
(
return
(
<
BackgroundWithBeasyIconAndWhiteContentArea
>
<
BackgroundWithBeasyIconAndWhiteContentArea
>
<>
<
Box
px=
{
"m"
}
mt=
{
"m"
}
>
<
Input
label=
{
"Reference"
}
/>
</
Box
>
<
ScrollView
<
ScrollView
refreshControl=
{
<
RefreshControl
refreshing=
{
isLoading
}
onRefresh=
{
refetch
}
/>
}
refreshControl=
{
<
RefreshControl
refreshing=
{
isLoading
}
onRefresh=
{
refetch
}
/>
}
contentContainerStyle=
{
{
contentContainerStyle=
{
{
gap
:
10
,
gap
:
10
,
padding
:
10
,
padding
:
10
,
marginTop
:
10
,
//
marginTop: 10,
paddingBottom
:
30
,
paddingBottom
:
30
,
flexDirection
:
"column"
,
flexDirection
:
"column"
,
}
}
}
}
...
@@ -41,6 +48,7 @@ const TransactionHistoryScreen = () => {
...
@@ -41,6 +48,7 @@ const TransactionHistoryScreen = () => {
/>
/>
))
}
))
}
</
ScrollView
>
</
ScrollView
>
</>
</
BackgroundWithBeasyIconAndWhiteContentArea
>
</
BackgroundWithBeasyIconAndWhiteContentArea
>
);
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment