Skip to content
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

Merged
merged 16 commits into from
Dec 12, 2019
Merged

[Wallet] Redesigning notification lists #1967

merged 16 commits into from
Dec 12, 2019

Conversation

i1skn
Copy link
Contributor

@i1skn i1skn commented Nov 29, 2019

Description

  • Redesign notification boxes on main mage
  • Redesign Incoming transaction list
  • Create a separate task to change currency in notifications to local - https://github.com/celo-org/celo-monorepo/issues/2153
  • Unify implementation for Incoming, Outgoing and Escrow notifications.
  • Add Screenshots
  • Add Spanish translation

Tested

iOS & Android

Other changes

Some refactoring and little design tweaks

Related issues

Backwards compatibility

Yes

Screenshots

Grouped notification

Notification list

Single notification

@i1skn i1skn force-pushed the notifications-redesign branch 3 times, most recently from e214f31 to 1458155 Compare December 9, 2019 15:57
@i1skn i1skn force-pushed the notifications-redesign branch 2 times, most recently from 666aa20 to 461c083 Compare December 10, 2019 14:02
@i1skn i1skn changed the title 🚧 WIP: [Wallet] Redesigning notification lists [Wallet] Redesigning notification lists Dec 10, 2019
@i1skn i1skn requested a review from a team December 10, 2019 14:23
Copy link
Contributor

@jmrossy jmrossy left a 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

packages/mobile/src/escrow/EscrowedPaymentLineItem.tsx Outdated Show resolved Hide resolved
expect(getByText('outgoingPaymentRequests')).toBeTruthy()
})

it('renders outgoing payment request when they exist', () => {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 ;)

packages/mobile/src/navigator/Navigator.tsx Show resolved Hide resolved
)
}

export function titleWithBalanceNavigationOptions(title: string) {
Copy link
Contributor

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

Copy link
Contributor Author

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)

Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

Copy link
Contributor

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

packages/react-components/components/BackButton.tsx Outdated Show resolved Hide resolved
packages/react-components/components/BaseNotification.tsx Outdated Show resolved Hide resolved
packages/react-components/components/BaseNotification.tsx Outdated Show resolved Hide resolved
packages/react-components/styles/styles.ts Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@jmrossy jmrossy requested a review from a team December 10, 2019 15:23
@i1skn i1skn force-pushed the notifications-redesign branch 2 times, most recently from 332d13a to f4bba95 Compare December 10, 2019 16:08
Copy link
Contributor

@jeanregisser jeanregisser left a 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]}>
{' '}
Copy link
Contributor

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>",

Copy link
Contributor Author

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.

packages/mobile/src/escrow/EscrowedPaymentListScreen.tsx Outdated Show resolved Hide resolved
},
]
itemRenderer = (item: EscrowedPayment, key: number) => {
return <EscrowedPaymentLineItem payment={item} key={key} />
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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/send/saga.ts Show resolved Hide resolved
packages/mobile/src/web3/gas.ts Show resolved Hide resolved
packages/mobile/src/web3/gas.ts Show resolved Hide resolved
packages/react-components/styles/styles.ts Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 11, 2019

Codecov Report

Merging #1967 into master will decrease coverage by 0.07%.
The diff coverage is 89.95%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#mobile 74.81% <89.95%> (-0.08%) ⬇️
Impacted Files Coverage Δ
...es/mobile/src/notifications/SimpleNotification.tsx 100% <ø> (ø) ⬆️
packages/mobile/src/escrow/saga.ts 20.94% <ø> (ø) ⬆️
packages/mobile/src/send/SendAmount.tsx 77.07% <ø> (ø) ⬆️
packages/mobile/test/values.ts 100% <ø> (ø) ⬆️
packages/mobile/src/send/saga.ts 42.66% <0%> (ø) ⬆️
...s/mobile/src/notifications/SummaryNotification.tsx 100% <100%> (ø)
packages/mobile/src/home/NotificationBox.tsx 75.53% <100%> (+1.06%) ⬆️
...bile/src/escrow/ReclaimPaymentConfirmationCard.tsx 100% <100%> (ø) ⬆️
...kages/mobile/src/transactions/TransferFeedIcon.tsx 100% <100%> (ø) ⬆️
packages/mobile/src/transactions/NoActivity.tsx 96% <100%> (+0.16%) ⬆️
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5c5fda...7aed2ef. Read the comment docs.

Copy link
Contributor

@jmrossy jmrossy left a 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)
Copy link
Contributor

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>
Copy link
Contributor

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

@i1skn i1skn merged commit 6e6543b into master Dec 12, 2019
@i1skn i1skn deleted the notifications-redesign branch December 12, 2019 15:26
aaronmgdr added a commit that referenced this pull request Dec 12, 2019
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement latest design for in-app notifications
3 participants