Merge branch 'fix-zap-record' into 'main'
ZapRecord and Zaps modal - change zap_comment to 'comment' and zap_amount to 'amount' See merge request soapbox-pub/soapbox!3063
This commit is contained in:
commit
bbdc224010
|
@ -11,8 +11,8 @@ import { shortNumberFormat } from 'soapbox/utils/numbers';
|
|||
|
||||
interface IAccountWithZaps {
|
||||
id: string;
|
||||
zap_comment: string;
|
||||
zap_amount: number;
|
||||
comment: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
interface IZapsModal {
|
||||
|
@ -28,7 +28,7 @@ const ZapsModal: React.FC<IZapsModal> = ({ onClose, statusId }) => {
|
|||
const accounts = useMemo((): ImmutableList<IAccountWithZaps> | undefined => {
|
||||
if (!zaps) return;
|
||||
|
||||
return zaps.map(({ account, zap_amount, zap_comment }) =>({ id: account, zap_amount, zap_comment })).flatten() as ImmutableList<IAccountWithZaps>;
|
||||
return zaps.map(({ account, amount, comment }) =>({ id: account, amount, comment })).flatten() as ImmutableList<IAccountWithZaps>;
|
||||
}, [zaps]);
|
||||
|
||||
const fetchData = () => {
|
||||
|
@ -63,9 +63,9 @@ const ZapsModal: React.FC<IZapsModal> = ({ onClose, statusId }) => {
|
|||
return (
|
||||
<div>
|
||||
<Text weight='bold'>
|
||||
{shortNumberFormat(account.zap_amount / 1000)}
|
||||
{shortNumberFormat(account.amount / 1000)}
|
||||
</Text>
|
||||
<AccountContainer key={account.id} id={account.id} note={account.zap_comment} emoji='⚡' />
|
||||
<AccountContainer key={account.id} id={account.id} note={account.comment} emoji='⚡' />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
|
|
@ -93,8 +93,8 @@ const ReactionListRecord = ImmutableRecord({
|
|||
|
||||
export const ZapRecord = ImmutableRecord({
|
||||
account: '',
|
||||
zap_comment: '',
|
||||
zap_amount: 0, // in millisats
|
||||
comment: '',
|
||||
amount: 0, // in millisats
|
||||
});
|
||||
|
||||
const ZapListRecord = ImmutableRecord({
|
||||
|
|
Loading…
Reference in New Issue