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
de216ba5
Commit
de216ba5
authored
May 28, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove onPress event, for CloseModal, it is self handled
parent
9a05e902
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
ErrorModal.tsx
src/components/modals/ErrorModal.tsx
+5
-3
useOrangeMoney.tsx
src/hooks/useOrangeMoney.tsx
+2
-9
No files found.
src/components/modals/ErrorModal.tsx
View file @
de216ba5
import
{
useModalsManagerContext
}
from
"@/contexts/ModalsManagerContext"
;
import
Button
from
"@components/Button"
;
import
Button
from
"@components/Button"
;
import
Box
from
"@components/bases/Box"
;
import
Box
from
"@components/bases/Box"
;
import
ErrorIcon
from
"@components/icons/ErrorIcon"
;
import
ErrorIcon
from
"@components/icons/ErrorIcon"
;
...
@@ -5,10 +6,11 @@ import { Text } from "react-native";
...
@@ -5,10 +6,11 @@ import { Text } from "react-native";
interface
Props
{
interface
Props
{
message
?:
string
;
message
?:
string
;
onPress
?:
()
=>
void
;
//
onPress?: () => void;
}
}
const
ErrorModal
=
({
message
=
"Une erreur s'est produite"
,
onPress
=
()
=>
{}
}:
Props
)
=>
{
const
ErrorModal
=
({
message
=
"Une erreur s'est produite"
}:
Props
)
=>
{
const
{
closeModal
}
=
useModalsManagerContext
();
return
(
return
(
<
Box
<
Box
width=
{
300
}
width=
{
300
}
...
@@ -34,7 +36,7 @@ const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {}
...
@@ -34,7 +36,7 @@ const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {}
variant=
{
"fullError"
}
variant=
{
"fullError"
}
textVariants=
{
"white"
}
textVariants=
{
"white"
}
label=
"Fermer"
label=
"Fermer"
onPress=
{
onPress
}
onPress=
{
closeModal
}
/>
/>
</
Box
>
</
Box
>
</
Box
>
</
Box
>
...
...
src/hooks/useOrangeMoney.tsx
View file @
de216ba5
...
@@ -85,16 +85,9 @@ const useOrangeMoney = () => {
...
@@ -85,16 +85,9 @@ const useOrangeMoney = () => {
if
(
error
instanceof
Error
)
{
if
(
error
instanceof
Error
)
{
if
(
error
.
name
===
"ORANGE_PAYMENT_IN_PROGRESS"
)
{
if
(
error
.
name
===
"ORANGE_PAYMENT_IN_PROGRESS"
)
{
log
.
warn
(
"handlePaymentButton | ORANGE_PAYMENT_IN_PROGRESS"
);
log
.
warn
(
"handlePaymentButton | ORANGE_PAYMENT_IN_PROGRESS"
);
showModal
(
showModal
(<
ErrorModal
message=
"Le payment est toujours en cours."
/>);
<
ErrorModal
message=
"Le payment est toujours en cours."
onPress=
{
async
()
=>
await
openBrowserThenCheckStatus
(
paymentUrl
,
orderId
)
}
/>,
);
}
else
if
(
error
.
name
===
"ORANGE_PAYMENT_FAILED"
)
{
}
else
if
(
error
.
name
===
"ORANGE_PAYMENT_FAILED"
)
{
showModal
(<
ErrorModal
message=
"Le paiment à échoué."
onPress=
{
closeModal
}
/>);
showModal
(<
ErrorModal
message=
"Le paiment à échoué."
/>);
log
.
error
(
"handlePaymentButton | ORANGE_PAYMENT_FAILED"
);
log
.
error
(
"handlePaymentButton | ORANGE_PAYMENT_FAILED"
);
}
}
}
else
{
}
else
{
...
...
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