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
52c5bb3b
Commit
52c5bb3b
authored
May 29, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a common AmountWrapper component for all
parent
436ec37f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
23 deletions
+7
-23
TransactionInformationsItem.tsx
src/components/TransactionInformationsItem.tsx
+7
-23
No files found.
src/components/TransactionInformationsItem.tsx
View file @
52c5bb3b
...
@@ -51,30 +51,12 @@ const TransactionInformationsItem = ({ paymentType, reference, date, amount, sta
...
@@ -51,30 +51,12 @@ const TransactionInformationsItem = ({ paymentType, reference, date, amount, sta
const
AmountColorRenderer
=
({
status
,
amount
}:
{
status
:
string
;
amount
:
number
})
=>
{
const
AmountColorRenderer
=
({
status
,
amount
}:
{
status
:
string
;
amount
:
number
})
=>
{
if
(
status
===
"SUCCESS"
)
{
if
(
status
===
"SUCCESS"
)
{
return
(
return
<
AmountWrapper
color=
"secondary"
>
{
amount
}
</
AmountWrapper
>;
<
AmountWrapper
color=
"secondary"
>
<
Text
variant=
{
"white"
}
fontWeight=
{
"bold"
}
>
{
amount
}
</
Text
>
</
AmountWrapper
>
);
}
}
if
(
status
===
"INITIATED"
)
{
if
(
status
===
"INITIATED"
)
{
return
(
return
<
AmountWrapper
color=
"softYellow"
>
{
amount
}
</
AmountWrapper
>;
<
AmountWrapper
color=
"softYellow"
>
<
Text
variant=
{
"white"
}
fontWeight=
{
"bold"
}
>
{
amount
}
</
Text
>
</
AmountWrapper
>
);
}
}
return
(
return
<
AmountWrapper
color=
"softRed"
>
{
amount
}
</
AmountWrapper
>;
<
AmountWrapper
color=
"softRed"
>
<
Text
variant=
{
"white"
}
fontWeight=
{
"bold"
}
>
{
amount
}
</
Text
>
</
AmountWrapper
>
);
};
};
const
AmountWrapper
=
({
const
AmountWrapper
=
({
...
@@ -82,8 +64,10 @@ const AmountWrapper = ({
...
@@ -82,8 +64,10 @@ const AmountWrapper = ({
children
,
children
,
}:
{
color
:
"secondary"
|
"softYellow"
|
"softRed"
;
children
:
React
.
ReactNode
})
=>
{
}:
{
color
:
"secondary"
|
"softYellow"
|
"softRed"
;
children
:
React
.
ReactNode
})
=>
{
return
(
return
(
<
Box
backgroundColor=
{
color
}
px=
{
"m"
}
py=
{
"xs"
}
borderRadius=
{
10
}
>
<
Box
backgroundColor=
{
color
}
px=
{
"m"
}
py=
{
"xs"
}
borderRadius=
{
7
}
>
{
children
}
<
Text
variant=
{
"white"
}
fontWeight=
{
"bold"
}
>
{
children
}
F
</
Text
>
</
Box
>
</
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