File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ export const ExpenseList: React.FC<{
5656 >
5757 < span className = "text-[10px]" > { isSettlement ? ' 🎉 ' : null } </ span >
5858 { displayName ( e . paidByUser , userId ) } { ' ' }
59- { t ( `ui.expense.user.${ e . amount < 0n ? 'received' : 'paid' } ` , { ns : 'common' } ) } { ' ' }
59+ { t (
60+ `ui.expense.${ e . paidByUser . id === userId ? 'you' : 'user' } .${ e . amount < 0n ? 'received' : 'paid' } ` ,
61+ { ns : 'common' } ,
62+ ) } { ' ' }
6063 { toUIString ( e . amount ) }
6164 </ p >
6265 </ div >
Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ const CurrencyInput = React.forwardRef<
3939 value = { strValue }
4040 onFocus = { ( ) => onValueChange ( { strValue : parseToCleanString ( strValue ) } ) }
4141 onBlur = { ( ) => {
42- const formattedValue = format ( strValue ) ;
42+ const formattedValue = format ( strValue , allowNegative ) ;
4343 return onValueChange ( {
4444 strValue : hideSymbol ? stripCurrencySymbol ( formattedValue ) : formattedValue ,
4545 } ) ;
4646 } }
4747 onChange = { ( e ) => {
4848 const rawValue = e . target . value ;
4949 const strValue = sanitizeInput ( rawValue , allowNegative ) ;
50- const bigIntValue = toSafeBigInt ( strValue ) ;
50+ const bigIntValue = toSafeBigInt ( strValue , allowNegative ) ;
5151 onValueChange ( { strValue, bigIntValue } ) ;
5252 } }
5353 { ...props }
Original file line number Diff line number Diff line change @@ -35,10 +35,12 @@ function getPaymentString(
3535 ) ;
3636 } else {
3737 return (
38- < div className = { `${ user . id === paidBy ? 'text-emerald-500' : 'text-orange-500' } text-sm` } >
39- { user . id === paidBy
40- ? `${ t ( 'ui.actors.you' ) } ${ t ( 'ui.expense.you.lent' ) } ${ toUIString ( BigMath . abs ( expenseUserAmt ) ) } `
41- : `${ t ( 'ui.actors.you' ) } ${ t ( 'ui.expense.you.owe' ) } ${ toUIString ( expenseUserAmt ) } ` }
38+ < div
39+ className = { `${ ( user . id === paidBy ) !== amount < 0n ? 'text-emerald-500' : 'text-orange-500' } text-sm` }
40+ >
41+ { t ( `ui.actors.you` ) } { ' ' }
42+ { t ( `ui.expense.you.${ ( user . id === paidBy ) !== amount < 0n ? 'lent' : 'owe' } ` ) } { ' ' }
43+ { toUIString ( expenseUserAmt ) }
4244 </ div >
4345 ) ;
4446 }
@@ -86,7 +88,9 @@ const ActivityPage: NextPageWithUser = ({ user }) => {
8688 < span className = "font-semibold text-gray-300" >
8789 { displayName ( e . expense . paidByUser , user . id ) }
8890 </ span > { ' ' }
89- { t ( `ui.expense.${ e . expense . paidByUser . id === user . id ? 'you' : 'user' } .paid` ) } { ' ' }
91+ { t (
92+ `ui.expense.${ e . expense . paidByUser . id === user . id ? 'you' : 'user' } .${ e . expense . amount > 0n ? 'paid' : 'received' } ` ,
93+ ) } { ' ' }
9094 { toUIString ( e . expense . amount ) } { t ( 'ui.expense.for' ) } { ' ' }
9195 < span className = "font-semibold text-gray-300" > { e . expense . name } </ span >
9296 </ p >
You can’t perform that action at this time.
0 commit comments