-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wallet] Redesigning notification lists #1967
Conversation
e214f31
to
1458155
Compare
666aa20
to
461c083
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall really nice work! Please see comments below
expect(getByText('outgoingPaymentRequests')).toBeTruthy() | ||
}) | ||
|
||
it('renders outgoing payment request when they exist', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this differ from the test above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single payment request vs multiple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clarify the test description? I think the only diff is one character ;)
) | ||
} | ||
|
||
export function titleWithBalanceNavigationOptions(title: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like an HOC / wrapper. Consider renaming to withTitleBalanceNavigationOptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually not, just a function.
Usage: Screen.navigationOptions = titleWithBalanceNavigationOptions(title)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah then maybe a get
prefix would be helpful here
<View style={[styles.scrollArea]}>{props.items.map(props.listItemRenderer)}</View> | ||
</ScrollView> | ||
) : ( | ||
<Text style={[fontStyles.bodySecondary, styles.empty]}>{i18n.t('global:emptyList')}</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto feedback as above for use of i18n here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is 'Empty List' all the design calls for here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is only one call to t
, is that advisable to still use withNamespace
?
Can you rephrase "is 'Empty List' all the design calls for here" - I did not get that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please, still use withNamespace
Nevermind the Empty List bit for now. Was just a comment on the intended design. I think showing the words "Empty List" is suboptimal but fine for now
332d13a
to
f4bba95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work on this 💯 🎉
return ( | ||
<Text numberOfLines={1} ellipsizeMode="middle" style={styles.oneLine}> | ||
<Text style={[fontStyles.subSmall]}> | ||
{recipientPhone} - {message} | ||
{recipientPhone ? recipientPhone : i18n.t('global:unknown')} {i18n.t('global:for')} | ||
</Text> | ||
<Text style={[fontStyles.subSmall, fontStyles.semiBold]}> | ||
{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concatenating strings like this makes it impossible to translate correctly. Some locale don't use the same ordering in words.
We could instead use the <Trans />
component and context.
Something along those lines:
<Trans
i18nKey="escrowPaymentLine"
tOptions={{ context: !recipientPhone ? 'missingRecipientPhone' : null }}
>
<Text numberOfLines={1} ellipsizeMode="middle" style={styles.oneLine}>
<Text style={[fontStyles.subSmall]}>{{ recipientPhone }} for </Text>
<Text style={[fontStyles.subSmall, fontStyles.semiBold]}>{{ moneyAmount }}</Text>
</Text>
</Trans>
With the following translation strings (not sure about the correctness of the indices I used though):
"escrowPaymentLine": "<1><2>{{recipientPhone}} for</2><3>{{moneyAmount}}</3></1>",
"escrowPaymentLine_missingRecipientPhone": "<1><2>Unknown for</2><3>{{moneyAmount}}</3></1>",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot! It does make a lot of sense! I remember you've mention something like this on one of our meetings.
}, | ||
] | ||
itemRenderer = (item: EscrowedPayment, key: number) => { | ||
return <EscrowedPaymentLineItem payment={item} key={key} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering, do we have some kind of ID we could use instead of the key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the benefit to use ID vs key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed the key here was an index in an array which should be avoided if possible:
https://reactjs.org/docs/lists-and-keys.html#keys
packages/mobile/src/paymentRequest/IncomingPaymentRequestListItem.tsx
Outdated
Show resolved
Hide resolved
packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.tsx
Outdated
Show resolved
Hide resolved
packages/mobile/src/paymentRequest/PaymentRequestNotificationInner.tsx
Outdated
Show resolved
Hide resolved
* New design * Group notification if there are more then 2 of the same type
e99eb14
to
c80d4b7
Compare
Codecov Report
@@ Coverage Diff @@
## master #1967 +/- ##
==========================================
- Coverage 74.88% 74.81% -0.08%
==========================================
Files 279 276 -3
Lines 7797 7766 -31
Branches 971 692 -279
==========================================
- Hits 5839 5810 -29
+ Misses 1842 1839 -3
- Partials 116 117 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more small things but overall LGTM 👍
@@ -28,3 +37,5 @@ const styles = StyleSheet.create({ | |||
flexDirection: 'row', | |||
}, | |||
}) | |||
|
|||
export default withNamespaces('inviteFlow11')(EscrowedPaymentLineItem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, use the typed namespace IDs: Namespaces.inviteFlow11
}} | ||
> | ||
<Text style={fontStyles.subSmall}>{{ recipientPhone }} for </Text> | ||
<Text style={[fontStyles.subSmall, fontStyles.semiBold]}>{{ amount }}</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to fix this but just an FYI, we would generally prefer to have a style defined below which does something like this:
{
...fontStyles.subSmall,
...fontStyles.semiBold
}
But it's really nbd. Just an FYI on the convention we're roughly trying to keep to elsewhere
* master: [Wallet] Use Charles proxy to see eth JSON rpc calls when using forno (#2204) [Wallet] Disable skip button when the user enable contact access (#2224) [Wallet] Redesigning notification lists (#1967) [Wallet] Fix crash on iOS when segment is enabled (#2222) Update documentation wrt. epoch rewards fractions (#2182) Improvement facilitating to run a full node (#2130) [BlockchainApi] Add ability to get exchange rates from/to cGLD or cUSD (#2005) Improve reliability of e2e governance test (#2208) Fix/protocol test flakyness (#2155) Fix bignumber display in CLI (#2212) Doc changes to address frequently asked questions (#2209) Upgrade TS version (#2196) Wait for only waitTime - 1 blocks (#2207) Minor baklava docs reconnection fixes (#2215) Update walletkit gateway fee to fix transactions in forno mode (#2211) Update baklava network ID in docs for 1.1 (#2214) Support more than 1 attesation bot at a time (#2192) Check sync status of attestation service (#2191) Indicate to run Twilio globally (#2193) Add Twilio and attestation bot envs (#2194)
Description
Create a separate task to change currency in notifications to local- https://github.com/celo-org/celo-monorepo/issues/2153Tested
iOS & Android
Other changes
Some refactoring and little design tweaks
Related issues
Backwards compatibility
Yes
Screenshots
Grouped notification
Notification list
Single notification