-
Notifications
You must be signed in to change notification settings - Fork 370
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
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c6e6dbd
Implement new notifications on Home screen
i1skn cd055fa
fix tests
i1skn 346eae3
Fix build
i1skn b1f054d
Fix locales
i1skn 02547a8
Address the comments
i1skn f57b96b
Address PR comments
i1skn c80d4b7
Address comments in the PR
i1skn 4d51962
Revert for key in i18n
i1skn 7320831
Merge branch 'master' into notifications-redesign
i1skn 09367aa
Merge branch 'master' into notifications-redesign
i1skn 7855ef9
Fix ts-ignore for TS#3.7.3
i1skn 34096ab
Address comments
i1skn 253a53c
Merge branch 'master' into notifications-redesign
i1skn 264fb3d
Merge branch 'master' into notifications-redesign
i1skn 6384fd7
Merge branch 'master' into notifications-redesign
i1skn 7aed2ef
Merge branch 'master' into notifications-redesign
i1skn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"requests": "Requests", | ||
"empty": "You have no Payment Requests", | ||
"incomingPaymentRequests": "Requests Waiting for You", | ||
"outgoingPaymentRequests": "Payments You’ve Requested", | ||
"celoDollarBalance": "{{CeloDollar}} Balance", | ||
"requestDeclined": "Request Declined", | ||
"requestPaid": "Request Paid", | ||
"paymentRequestUpdateFailed": "Cannot update payment request" | ||
"paymentRequestUpdateFailed": "Cannot update payment request", | ||
"incomingPaymentRequestNotificationTitle": "{{name}} requested {{amount}}", | ||
"outgoingPaymentRequestNotificationTitle": "Requested {{amount}} from {{name}}", | ||
"defaultComment": "Payment Requested", | ||
"paymentRequestNotificationLine": "<0>{{displayName}} for</0> <1>{{amount}}</1>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"requests": "Solicitudes", | ||
"empty": "No tienes solicitudes de pago", | ||
"incomingPaymentRequests": "Pedidos esperandote", | ||
"outgoingPaymentRequests": "Pagos que tu has pedido", | ||
"celoDollarBalance": "Saldo de {{CeloDollar}}", | ||
"requestDeclined": "Solicitud rechazada", | ||
"requestPaid": "Solicitud Pagada", | ||
"paymentRequestUpdateFailed": "No se pudo actualizar el pedido de pago" | ||
"paymentRequestUpdateFailed": "No se pudo actualizar el pedido de pago", | ||
"incomingPaymentRequestNotificationTitle": "~~{{name}} requested {{amount}}", | ||
"outgoingPaymentRequestNotificationTitle": "~~Requested {{amount}} from {{name}}", | ||
"defaultComment": "~~Payment Requested", | ||
"paymentRequestNotificationLine": "~~<0>{{displayName}} for</0> <1>{{amount}}</1>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
import fontStyles from '@celo/react-components/styles/fonts' | ||
import * as React from 'react' | ||
import { Trans, withNamespaces, WithNamespaces } from 'react-i18next' | ||
import { StyleSheet, Text } from 'react-native' | ||
import { EscrowedPayment } from 'src/escrow/actions' | ||
import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' | ||
import { divideByWei, getCentAwareMoneyDisplay } from 'src/utils/formatting' | ||
|
||
interface Props { | ||
payment: EscrowedPayment | ||
} | ||
|
||
export default function EscrowedPaymentLineItem(props: Props) { | ||
const { amount, message, recipientPhone } = props.payment | ||
function EscrowedPaymentLineItem(props: Props & WithNamespaces) { | ||
const { amount, recipientPhone } = props.payment | ||
return ( | ||
<Text numberOfLines={1} ellipsizeMode="middle" style={styles.oneLine}> | ||
<Text style={[fontStyles.subSmall]}> | ||
{recipientPhone} - {message} | ||
</Text> | ||
<Text style={[fontStyles.subSmall, fontStyles.semiBold]}> | ||
{' '} | ||
${getCentAwareMoneyDisplay(divideByWei(amount.toString()))} | ||
</Text> | ||
<Trans | ||
i18nKey="escrowPaymentNotificationLine" | ||
// @ts-ignore tOptions prop is missing in type bindings, but exists in the implementation | ||
tOptions={{ context: !recipientPhone ? 'missingRecipientPhone' : null }} | ||
values={{ | ||
amount: | ||
CURRENCIES[CURRENCY_ENUM.DOLLAR].symbol + | ||
getCentAwareMoneyDisplay(divideByWei(amount.toString())), | ||
recipientPhone, | ||
}} | ||
> | ||
<Text style={fontStyles.subSmall}>{{ recipientPhone }} for </Text> | ||
<Text style={[fontStyles.subSmall, fontStyles.semiBold]}>{{ amount }}</Text> | ||
</Trans> | ||
</Text> | ||
) | ||
} | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Nit, use the typed namespace IDs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
But it's really nbd. Just an FYI on the convention we're roughly trying to keep to elsewhere