show summary on the history page
This commit is contained in:
parent
1f365d1c42
commit
84ca0b1cb9
@ -39,7 +39,7 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
iconPath={imageBank}
|
iconPath={imageBank}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Payment:
|
case TransactionType.Payment:
|
||||||
return (
|
return (
|
||||||
@ -48,11 +48,12 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
amount={tx.amountEffective}
|
amount={tx.amountEffective}
|
||||||
debitCreditIndicator={"debit"}
|
debitCreditIndicator={"debit"}
|
||||||
title={tx.info.merchant.name}
|
title={tx.info.merchant.name}
|
||||||
|
subtitle={tx.info.summary}
|
||||||
timestamp={tx.timestamp}
|
timestamp={tx.timestamp}
|
||||||
iconPath={imageShoppingCart}
|
iconPath={imageShoppingCart}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Refund:
|
case TransactionType.Refund:
|
||||||
return (
|
return (
|
||||||
@ -65,7 +66,7 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
iconPath={imageRefund}
|
iconPath={imageRefund}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Tip:
|
case TransactionType.Tip:
|
||||||
return (
|
return (
|
||||||
@ -78,7 +79,7 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
iconPath={imageHandHeart}
|
iconPath={imageHandHeart}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Refresh:
|
case TransactionType.Refresh:
|
||||||
return (
|
return (
|
||||||
@ -91,7 +92,7 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
iconPath={imageRefresh}
|
iconPath={imageRefresh}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Deposit:
|
case TransactionType.Deposit:
|
||||||
return (
|
return (
|
||||||
@ -104,7 +105,7 @@ export function TransactionItem(props: { tx: Transaction, multiCurrency: boolean
|
|||||||
iconPath={imageRefresh}
|
iconPath={imageRefresh}
|
||||||
pending={tx.pending}
|
pending={tx.pending}
|
||||||
multiCurrency={props.multiCurrency}
|
multiCurrency={props.multiCurrency}
|
||||||
></TransactionLayout>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,12 +119,13 @@ function TransactionLayout(props: TransactionLayoutProps): JSX.Element {
|
|||||||
<img src={props.iconPath} />
|
<img src={props.iconPath} />
|
||||||
<Column>
|
<Column>
|
||||||
<LargeText>
|
<LargeText>
|
||||||
<span>{props.title}</span>
|
<div>{props.title}</div>
|
||||||
|
{props.subtitle && <div style={{color:'gray', fontSize:'medium', marginTop: 5}}>{props.subtitle}</div>}
|
||||||
</LargeText>
|
</LargeText>
|
||||||
{props.pending &&
|
{props.pending &&
|
||||||
<LightText style={{marginTop: 5, marginBottom: 5}}>Waiting for confirmation</LightText>
|
<LightText style={{ marginTop: 5, marginBottom: 5 }}>Waiting for confirmation</LightText>
|
||||||
}
|
}
|
||||||
<SmallLightText>{dateStr}</SmallLightText>
|
<SmallLightText style={{marginTop:5 }}>{dateStr}</SmallLightText>
|
||||||
</Column>
|
</Column>
|
||||||
<TransactionAmount
|
<TransactionAmount
|
||||||
pending={props.pending}
|
pending={props.pending}
|
||||||
@ -140,6 +142,7 @@ interface TransactionLayoutProps {
|
|||||||
amount: AmountString | "unknown";
|
amount: AmountString | "unknown";
|
||||||
timestamp: Timestamp;
|
timestamp: Timestamp;
|
||||||
title: string;
|
title: string;
|
||||||
|
subtitle?: string;
|
||||||
id: string;
|
id: string;
|
||||||
iconPath: string;
|
iconPath: string;
|
||||||
pending: boolean;
|
pending: boolean;
|
||||||
|
@ -41,7 +41,7 @@ const commonTransaction = () => ({
|
|||||||
amountEffective: 'USD:9',
|
amountEffective: 'USD:9',
|
||||||
pending: false,
|
pending: false,
|
||||||
timestamp: {
|
timestamp: {
|
||||||
t_ms: new Date().getTime() - (count++ * 1000*60*60*7)
|
t_ms: new Date().getTime() - (count++ * 1000 * 60 * 60 * 7)
|
||||||
},
|
},
|
||||||
transactionId: '12',
|
transactionId: '12',
|
||||||
} as TransactionCommon)
|
} as TransactionCommon)
|
||||||
@ -131,7 +131,8 @@ export const One = createExample(TestedComponent, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const OnePending = createExample(TestedComponent, {
|
export const OnePending = createExample(TestedComponent, {
|
||||||
list: [{...exampleData.withdraw,
|
list: [{
|
||||||
|
...exampleData.withdraw,
|
||||||
pending: true
|
pending: true
|
||||||
}],
|
}],
|
||||||
balances: [{
|
balances: [{
|
||||||
@ -149,7 +150,13 @@ export const Several = createExample(TestedComponent, {
|
|||||||
exampleData.payment,
|
exampleData.payment,
|
||||||
exampleData.withdraw,
|
exampleData.withdraw,
|
||||||
exampleData.payment,
|
exampleData.payment,
|
||||||
exampleData.refresh,
|
{
|
||||||
|
...exampleData.payment,
|
||||||
|
info: {
|
||||||
|
...exampleData.payment.info,
|
||||||
|
summary: 'this is a long summary that may be cropped because its too long',
|
||||||
|
},
|
||||||
|
},
|
||||||
exampleData.refund,
|
exampleData.refund,
|
||||||
exampleData.tip,
|
exampleData.tip,
|
||||||
exampleData.deposit,
|
exampleData.deposit,
|
||||||
@ -180,7 +187,7 @@ export const SeveralWithTwoCurrencies = createExample(TestedComponent, {
|
|||||||
pendingOutgoing: 'TESTKUDOS:0',
|
pendingOutgoing: 'TESTKUDOS:0',
|
||||||
hasPendingTransactions: false,
|
hasPendingTransactions: false,
|
||||||
requiresUserInput: false,
|
requiresUserInput: false,
|
||||||
},{
|
}, {
|
||||||
available: 'USD:10',
|
available: 'USD:10',
|
||||||
pendingIncoming: 'USD:0',
|
pendingIncoming: 'USD:0',
|
||||||
pendingOutgoing: 'USD:0',
|
pendingOutgoing: 'USD:0',
|
||||||
|
@ -74,8 +74,8 @@ export function HistoryView({ list, balances }: { list: Transaction[], balances:
|
|||||||
</div>}
|
</div>}
|
||||||
</header>}
|
</header>}
|
||||||
<section>
|
<section>
|
||||||
{Object.keys(byDate).map(d => {
|
{Object.keys(byDate).map((d,i) => {
|
||||||
return <Fragment>
|
return <Fragment key={i}>
|
||||||
<DateSeparator>{d}</DateSeparator>
|
<DateSeparator>{d}</DateSeparator>
|
||||||
{byDate[d].map((tx, i) => (
|
{byDate[d].map((tx, i) => (
|
||||||
<TransactionItem key={i} tx={tx} multiCurrency={multiCurrency}/>
|
<TransactionItem key={i} tx={tx} multiCurrency={multiCurrency}/>
|
||||||
|
Loading…
Reference in New Issue
Block a user