fix(ZapRecord): change zap_comment to 'comment' and zap_amount to 'amount'

environments/review-fix-zap-re-b0tbq3/deployments/4695
P. Reis 3 months ago
parent ed33cd400c
commit e4dbe2a8c6

@ -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…
Cancel
Save