More touchups

This commit is contained in:
Anthony 2021-07-29 21:58:18 +02:00
parent 5e02f5cb54
commit 70e423a026
No known key found for this signature in database
GPG key ID: C386D3C93D50E356
3 changed files with 22 additions and 20 deletions

View file

@ -28,7 +28,7 @@ const WalletBalance = (props: Props) => {
return (
<>{1 == 1 && <Card
title={<><Icon size="18" icon={ICONS.FINANCE} />{accountDetails && accountDetails.total_received_unpaid/100} || 0 USD</>}
title={<><Icon size="18" icon={ICONS.FINANCE} />{accountDetails && accountDetails.total_received_unpaid/100 || 0} USD</>}
subtitle={
<I18nMessage>
This is your remaining balance that can still be withdrawn to your bank account
@ -92,7 +92,7 @@ const WalletBalance = (props: Props) => {
<div className="section__actions">
<Button button="primary" label={__('Receive Payout')} icon={ICONS.SEND} />
<Button button="secondary" label={__('Account Configuration')} icon={ICONS.SETTINGS} navigate={`/$/${PAGES.SETTINGS_STRIPE_ACCOUNT}`} />
<Button button="secondary" label={__('Account Configuration')} icon={ICONS.SETTINGS} navigate={`/$/${PAGES.SETTINGS_STRIPE_CARD}`} />
</div>
</>
}

View file

@ -153,7 +153,7 @@ const WalletBalance = (props: Props) => {
))}
</tbody>
</table>
{(!paymentHistoryTransactions || paymentHistoryTransactions.length === 0) && <p style={{textAlign:"center", marginTop: '20px', fontSize: '13px', color: 'rgb(171, 171, 171)'}}>No Transactions</p>}
{(!accountTransactions || accountTransactions.length === 0) && <p style={{textAlign:"center", marginTop: '20px', fontSize: '13px', color: 'rgb(171, 171, 171)'}}>No Transactions</p>}
</div>
</>
}

View file

@ -75,11 +75,30 @@ const WalletPage = (props: Props) => {
);
}
// calculate account transactions section
React.useEffect(() => {
(async function(){
try {
const response = await getAccountStatus();
setAccountStatusResponse(response);
// TODO: some weird naming clash hence getAccountTransactionsa
const getAccountTransactions = await getAccountTransactionsa();
setAccountTransactionResponse(getAccountTransactions)
} catch (err){
console.log(err);
}
})();
}, []);
// populate customer payment data
React.useEffect(() => {
(async function(){
try {
// get card payments customer has made
const customerTransactionResponse = await getPaymentHistory();
@ -91,25 +110,8 @@ const WalletPage = (props: Props) => {
setTotalTippedAmount(totalTippedAmount / 100);
console.log(customerTransactionResponse);
setCustomerTransactions(customerTransactionResponse)
console.log('account status');
console.log(response);
setAccountStatusResponse(response);
// TODO: some weird naming clash hence getAccountTransactionsa
const getAccountTransactions = await getAccountTransactionsa();
console.log('transactions');
setAccountTransactionResponse(getAccountTransactions)
console.log(getAccountTransactions);
} catch (err){
console.log(err);
}