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) => {
249249 // eslint-disable-next-line react-hooks/exhaustive-deps
250250 } , [ handleValueUpdated , editState ] )
251251
252+ const isEditingAllowed = ( ) : boolean => props . profile . roles . includes ( 'Payment Admin' ) || props . profile . roles . includes ( 'Payment Editor' )
253+
252254 return (
253255 < >
254256 < div className = { styles . container } >
@@ -378,6 +380,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
378380 { isLoading && < LoadingCircles className = { styles . centered } /> }
379381 { ! isLoading && winnings . length > 0 && (
380382 < PaymentsTable
383+ canEdit = { isEditingAllowed ( ) }
381384 currentPage = { pagination . currentPage }
382385 numPages = { pagination . totalPages }
383386 payments = { winnings }
Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
107107 < p className = { styles . value } > { props . payment . releaseDateObj . toLocaleDateString ( ) } </ p >
108108 </ div >
109109
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+
110118 < div className = { styles . infoItem } >
111119 < Button
112120 onClick = { handleToggleView }
@@ -121,6 +129,7 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
121129 < div className = { styles . auditSection } >
122130 { auditLines && auditLines . length > 0 && auditLines . map ( line => (
123131 < Collapsible
132+ key = { line . id }
124133 header = { (
125134 < h3 >
126135 {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ interface PaymentTableProps {
1818 onNextPageClick : ( ) => void ;
1919 onPreviousPageClick : ( ) => void ;
2020 onPageClick : ( pageNumber : number ) => void ;
21+ canEdit : boolean ;
2122}
2223
2324const PaymentsTable : React . FC < PaymentTableProps > = ( props : PaymentTableProps ) => {
@@ -58,7 +59,7 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
5859 < td > { payment . releaseDate } </ td >
5960 < td > { payment . datePaid } </ td >
6061 < td className = { styles . actionButtons } >
61- { payment . status . toUpperCase ( ) !== 'PAID' && (
62+ { props . canEdit && payment . status . toUpperCase ( ) !== 'PAID' && (
6263 < Button
6364 icon = { IconOutline . PencilIcon }
6465 size = 'sm'
You can’t perform that action at this time.
0 commit comments