File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
src/apps/wallet-admin/src Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,8 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
249
249
// eslint-disable-next-line react-hooks/exhaustive-deps
250
250
} , [ handleValueUpdated , editState ] )
251
251
252
+ const isEditingAllowed = ( ) : boolean => props . profile . roles . includes ( 'Payment Admin' ) || props . profile . roles . includes ( 'Payment Editor' )
253
+
252
254
return (
253
255
< >
254
256
< div className = { styles . container } >
@@ -378,6 +380,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
378
380
{ isLoading && < LoadingCircles className = { styles . centered } /> }
379
381
{ ! isLoading && winnings . length > 0 && (
380
382
< PaymentsTable
383
+ canEdit = { isEditingAllowed ( ) }
381
384
currentPage = { pagination . currentPage }
382
385
numPages = { pagination . totalPages }
383
386
payments = { winnings }
Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
107
107
< p className = { styles . value } > { props . payment . releaseDateObj . toLocaleDateString ( ) } </ p >
108
108
</ div >
109
109
110
+ { props . payment . datePaid !== '-' && (
111
+ (
112
+ < div className = { styles . infoItem } >
113
+ < span className = { styles . label } > Date Paid</ span >
114
+ < p className = { styles . value } > { props . payment . datePaid } </ p >
115
+ </ div >
116
+ ) ) }
117
+
110
118
< div className = { styles . infoItem } >
111
119
< Button
112
120
onClick = { handleToggleView }
@@ -121,6 +129,7 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
121
129
< div className = { styles . auditSection } >
122
130
{ auditLines && auditLines . length > 0 && auditLines . map ( line => (
123
131
< Collapsible
132
+ key = { line . id }
124
133
header = { (
125
134
< h3 >
126
135
{
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ interface PaymentTableProps {
18
18
onNextPageClick : ( ) => void ;
19
19
onPreviousPageClick : ( ) => void ;
20
20
onPageClick : ( pageNumber : number ) => void ;
21
+ canEdit : boolean ;
21
22
}
22
23
23
24
const PaymentsTable : React . FC < PaymentTableProps > = ( props : PaymentTableProps ) => {
@@ -58,7 +59,7 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
58
59
< td > { payment . releaseDate } </ td >
59
60
< td > { payment . datePaid } </ td >
60
61
< td className = { styles . actionButtons } >
61
- { payment . status . toUpperCase ( ) !== 'PAID' && (
62
+ { props . canEdit && payment . status . toUpperCase ( ) !== 'PAID' && (
62
63
< Button
63
64
icon = { IconOutline . PencilIcon }
64
65
size = 'sm'
You can’t perform that action at this time.
0 commit comments