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
189a2b57
Commit
189a2b57
authored
May 08, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change PaymentOptions type to match the returned ones from api
parent
a40b4e6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
PaymentOption.tsx
src/components/PaymentOption.tsx
+11
-19
HomePageWithPaymentOptions.tsx
src/screens/HomePageWithPaymentOptions.tsx
+5
-5
No files found.
src/components/PaymentOption.tsx
View file @
189a2b57
...
...
@@ -2,15 +2,7 @@ import { images } from "@styles/Commons";
import
{
Image
,
TouchableOpacity
}
from
"react-native"
;
import
Box
from
"./bases/Box"
;
export
enum
PaymentMethods
{
OrangeMoney
=
1
,
MtnMoney
=
2
,
MoobMoney
=
3
,
WaveMoney
=
4
,
VisaCard
=
5
,
}
type
PaymentOptions
=
"OrangeMoney"
|
"MtnMoney"
|
"MoovMoney"
|
"WaveMoney"
|
"VisaCard"
;
type
PaymentOptions
=
"ORANGE"
|
"MTN"
|
"FLOOZ"
|
"WAVE"
|
"CB"
;
type
Props
=
{
onPress
:
()
=>
void
;
...
...
@@ -32,7 +24,7 @@ const PaymentOptionContainer = ({ children }: { children: React.ReactNode }) =>
);
};
const
Orange
Money
=
()
=>
{
const
Orange
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
...
...
@@ -43,7 +35,7 @@ const OrangeMoney = () => {
);
};
const
Mtn
Money
=
()
=>
{
const
Mtn
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/mtn_money.png"
)
}
style=
{
images
.
cover
}
/>
...
...
@@ -51,7 +43,7 @@ const MtnMoney = () => {
);
};
const
MoovMoney
=
()
=>
{
const
Flooz
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/moov_money.png"
)
}
style=
{
images
.
cover
}
/>
...
...
@@ -59,7 +51,7 @@ const MoovMoney = () => {
);
};
const
Wave
Money
=
()
=>
{
const
Wave
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/wave_money.png"
)
}
style=
{
images
.
cover
}
/>
...
...
@@ -67,7 +59,7 @@ const WaveMoney = () => {
);
};
const
VisaCard
=
()
=>
{
const
Cb
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/visa_card.png"
)
}
style=
{
images
.
cover
}
/>
...
...
@@ -78,11 +70,11 @@ const VisaCard = () => {
const
PaymentOption
=
({
onPress
,
paymentMethod
}:
Props
)
=>
{
return
(
<
TouchableOpacity
style=
{
{
width
:
"100%"
,
height
:
"100%"
}
}
onPress=
{
onPress
}
>
{
paymentMethod
===
"O
rangeMoney"
&&
<
OrangeMoney
/>
}
{
paymentMethod
===
"M
tnMoney"
&&
<
MtnMoney
/>
}
{
paymentMethod
===
"
MoovMoney"
&&
<
MoovMoney
/>
}
{
paymentMethod
===
"W
aveMoney"
&&
<
WaveMoney
/>
}
{
paymentMethod
===
"
VisaCard"
&&
<
VisaCard
/>
}
{
paymentMethod
===
"O
RANGE"
&&
<
Orange
/>
}
{
paymentMethod
===
"M
TN"
&&
<
Mtn
/>
}
{
paymentMethod
===
"
FLOOZ"
&&
<
Flooz
/>
}
{
paymentMethod
===
"W
AVE"
&&
<
Wave
/>
}
{
paymentMethod
===
"
CB"
&&
<
Cb
/>
}
</
TouchableOpacity
>
);
};
...
...
src/screens/HomePageWithPaymentOptions.tsx
View file @
189a2b57
...
...
@@ -66,7 +66,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
onPress=
{
()
=>
navigation
.
navigate
(
"paymentAmountInputScreen"
)
}
paymentMethod=
{
"O
rangeMoney
"
}
paymentMethod=
{
"O
RANGE
"
}
/>
</
PaymentOptionContainer
>
<
PaymentOptionContainer
>
...
...
@@ -74,7 +74,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
onPress=
{
()
=>
navigation
.
navigate
(
"paymentAmountInputScreen"
)
}
paymentMethod=
{
"M
tnMoney
"
}
paymentMethod=
{
"M
TN
"
}
/>
</
PaymentOptionContainer
>
<
PaymentOptionContainer
>
...
...
@@ -82,7 +82,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
onPress=
{
()
=>
navigation
.
navigate
(
"paymentAmountInputScreen"
)
}
paymentMethod=
{
"
MoovMoney
"
}
paymentMethod=
{
"
FLOOZ
"
}
/>
</
PaymentOptionContainer
>
...
...
@@ -91,7 +91,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
onPress=
{
()
=>
navigation
.
navigate
(
"paymentAmountInputScreen"
)
}
paymentMethod=
{
"W
aveMoney
"
}
paymentMethod=
{
"W
AVE
"
}
/>
</
PaymentOptionContainer
>
...
...
@@ -100,7 +100,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
onPress=
{
()
=>
navigation
.
navigate
(
"paymentAmountInputScreen"
)
}
paymentMethod=
{
"
VisaCard
"
}
paymentMethod=
{
"
CB
"
}
/>
</
PaymentOptionContainer
>
</
Box
>
...
...
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