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
aa40c36c
Commit
aa40c36c
authored
Apr 25, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add payment option but the logo rounding is a little off
parent
781263fc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
8 deletions
+104
-8
PaymentOption.tsx
src/components/PaymentOption.tsx
+83
-0
HomePageWithPaymentOptions.tsx
src/screens/HomePageWithPaymentOptions.tsx
+21
-8
No files found.
src/components/PaymentOption.tsx
0 → 100644
View file @
aa40c36c
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
Props
=
{
onPress
:
()
=>
void
;
paymentMethod
:
PaymentOptions
;
};
const
PaymentOptionContainer
=
({
children
}:
{
children
:
React
.
ReactNode
})
=>
{
return
(
<
Box
height=
{
50
}
p=
{
"s"
}
style=
{
{
width
:
"100%"
,
height
:
"100%"
}
}
overflow=
{
"hidden"
}
>
{
children
}
</
Box
>
);
};
const
MtnMoney
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/mtn_money.png"
)
}
style=
{
images
.
cover
}
/>
</
PaymentOptionContainer
>
);
};
const
MoovMoney
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/moov_money.png"
)
}
style=
{
images
.
cover
}
/>
</
PaymentOptionContainer
>
);
};
const
WaveMoney
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/wave_money.png"
)
}
style=
{
images
.
cover
}
/>
</
PaymentOptionContainer
>
);
};
const
VisaCard
=
()
=>
{
return
(
<
PaymentOptionContainer
>
<
Image
source=
{
require
(
"../../assets/operators/visa_card.png"
)
}
style=
{
images
.
cover
}
/>
</
PaymentOptionContainer
>
);
};
const
PaymentOption
=
({
onPress
,
paymentMethod
}:
Props
)
=>
{
return
(
<
TouchableOpacity
style=
{
{
width
:
"50%"
,
height
:
"26%"
}
}
onPress=
{
onPress
}
>
{
paymentMethod
===
"OrangeMoney"
&&
<
OrangeMoney
/>
}
{
paymentMethod
===
"MtnMoney"
&&
<
MtnMoney
/>
}
{
paymentMethod
===
"MoovMoney"
&&
<
MoovMoney
/>
}
{
paymentMethod
===
"WaveMoney"
&&
<
WaveMoney
/>
}
{
paymentMethod
===
"VisaCard"
&&
<
VisaCard
/>
}
</
TouchableOpacity
>
);
};
const
OrangeMoney
=
()
=>
{
return
(
<
Box
height=
{
50
}
p=
{
"s"
}
style=
{
{
width
:
"100%"
,
height
:
"100%"
}
}
overflow=
{
"hidden"
}
>
<
Image
source=
{
require
(
"../../assets/operators/orange_money.png"
)
}
style=
{
images
.
cover
}
/>
</
Box
>
);
};
export
default
PaymentOption
;
src/screens/HomePageWithPaymentOptions.tsx
View file @
aa40c36c
import
BalanceContainer
from
"@components/BalanceContainer"
;
import
BeasyLogoIcon
from
"@components/BeasyLogoIcon"
;
import
NotificationIconButton
from
"@components/NotificationIconButton"
;
import
PaymentOption
from
"@components/PaymentOption"
;
import
BackgroundGreenWhiteContentArea
from
"@components/backgrounds/BackgroundGreenWhiteContentArea"
;
import
Box
from
"@components/bases/Box"
;
import
Text
from
"@components/bases/Text"
;
import
{
SafeAreaView
}
from
"react-native-safe-area-context"
;
const
HomePageWithPaymentOptions
=
()
=>
{
return
(
<
BackgroundGreenWhiteContentArea
>
<
SafeAreaView
>
<
Box
style=
{
{
height
:
"100%"
}
}
>
<
Box
p
=
{
"l"
}
px
=
{
"l"
}
flexDirection=
{
"row"
}
justifyContent=
{
"space-between"
}
alignItems=
{
"center"
}
>
{
/* <Text>HomePageWithPaymentOptions</Text> */
}
<
BeasyLogoIcon
/>
<
NotificationIconButton
/>
</
Box
>
<
Box
height=
{
150
}
alignItems=
{
"center"
}
justifyContent=
{
"center"
}
position=
{
"relative"
}
>
<
Box
height=
{
150
}
alignItems=
{
"center"
}
justifyContent=
{
"center"
}
>
<
BalanceContainer
balance=
{
78000
}
label=
"Total des ventes"
/>
</
Box
>
<
Box
flex=
{
1
}
p=
{
"l"
}
>
<
Box
height=
{
100
}
>
<
Text
fontSize=
{
20
}
fontWeight=
{
"bold"
}
>
Méthode de paiement
</
Text
>
</
Box
>
<
Box
flexDirection=
{
"row"
}
style=
{
{
flexWrap
:
"wrap"
}
}
>
{
/* Payment Modes */
}
<
PaymentOption
onPress=
{
()
=>
{}
}
paymentMethod=
{
"OrangeMoney"
}
/>
<
PaymentOption
onPress=
{
()
=>
{}
}
paymentMethod=
{
"MtnMoney"
}
/>
<
PaymentOption
onPress=
{
()
=>
{}
}
paymentMethod=
{
"MoovMoney"
}
/>
<
PaymentOption
onPress=
{
()
=>
{}
}
paymentMethod=
{
"WaveMoney"
}
/>
<
PaymentOption
onPress=
{
()
=>
{}
}
paymentMethod=
{
"VisaCard"
}
/>
</
Box
>
</
Box
>
</
Box
>
</
SafeAreaView
>
</
BackgroundGreenWhiteContentArea
>
);
...
...
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