-
Notifications
You must be signed in to change notification settings - Fork 14
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
Notifications: wiring and integration with API #318
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
805d65d
Email notifications
rperez89 e3b59e7
Loader
rperez89 94b3476
tweaks
rperez89 aaca905
Existing email modal screen merge
rperez89 5c3b986
Status info merge
rperez89 f2f6900
Global preferences merge
rperez89 61c6046
Merge branch 'development' into email-notifications-testing
rperez89 30554c9
Delete and unlock fix
rperez89 37c5d1f
Verify Email merge
rperez89 722b17d
sing request merge
rperez89 5562f0b
Integration Fixes
rperez89 b6e5de4
Merge branch 'development' into email-notifications-testing
rperez89 20c02b2
Integration Fixes
rperez89 bbd1b75
use inside modal pattern
rperez89 b4d00c2
Resend verification email
rperez89 a4bc976
remove unnecessary file
rperez89 cb63d92
constants cleanup
rperez89 1281e6a
Loading constants
rperez89 50818ff
loading
rperez89 4dc4b06
PR comments
rperez89 ceb3138
Merge branch 'development' into email-notifications-testing
rperez89 f1fd50e
remove unnecessary file
rperez89 d75c4ed
rename utils file import
rperez89 7b3f832
useWallet
rperez89 99ff2ac
Loading screen
rperez89 16319aa
unnecessary file
rperez89 575d69f
cleanup
rperez89 153892a
Fix loading screen when unsubscribed
rperez89 35c7ff7
.
rperez89 f64493e
z-index for the modal
rperez89 f73af80
Incorrect delete success screen from preferences fix
rperez89 0af5494
change account fix
rperez89 973b379
fix unlock screen on not subscibed account
rperez89 8ee93c2
unlock screen on unsubscribed account
rperez89 43ba3a5
remove styled button
rperez89 dc0a91d
only one useEffect
rperez89 ad6f164
Email notifications: update copy, troubleshooting link (#331)
sohkai 288b2d1
Notifications: Animation transition fix and prevent same email update…
rperez89 46068a5
Use Input hook and screens refactors (#343)
rperez89 2810737
Notifications: Endpoint url change (#344)
rperez89 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import React, { useEffect, useState } from 'react' | ||
import { | ||
Field, | ||
GU, | ||
IconCheck, | ||
IconCross, | ||
TextInput, | ||
textStyle, | ||
useInside, | ||
useTheme, | ||
} from '@aragon/ui' | ||
|
||
const EmailInput = React.memo(function EmailInput({ | ||
existingEmail, | ||
status, | ||
...inputProps | ||
}) { | ||
const theme = useTheme() | ||
const [error, setError] = useState('') | ||
const [insideModal] = useInside('NotificationsModal') | ||
|
||
useEffect(() => { | ||
if (status === 'invalid') { | ||
return setError('Please enter a valid email address.') | ||
} | ||
return setError('') | ||
}, [status]) | ||
|
||
const adornment = (() => { | ||
if (status === 'invalid') | ||
return ( | ||
<IconCross | ||
css={` | ||
color: ${theme.negative}; | ||
`} | ||
/> | ||
) | ||
|
||
if (status === 'empty') | ||
return ( | ||
<IconCheck | ||
css={` | ||
opacity: 0; | ||
color: ${theme.positive}; | ||
`} | ||
/> | ||
) | ||
|
||
return ( | ||
<IconCheck | ||
css={` | ||
opacity: 1; | ||
color: ${theme.positive}; | ||
`} | ||
/> | ||
) // status === 'valid' | ||
})() | ||
return ( | ||
<div | ||
css={` | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
`} | ||
> | ||
<Field | ||
label={ | ||
existingEmail | ||
? insideModal | ||
? 'Update email address' | ||
: 'Enter new email address' | ||
: 'Enter email address' | ||
} | ||
css={` | ||
width: 100%; | ||
margin-bottom: 0; | ||
`} | ||
> | ||
<TextInput | ||
adornment={adornment} | ||
adornmentPosition="end" | ||
type="email" | ||
wide | ||
placeholder="you@example.org" | ||
{...inputProps} | ||
/> | ||
</Field> | ||
{error && ( | ||
<div> | ||
<p | ||
css={` | ||
color: ${theme.negative}; | ||
${textStyle('body4')}; | ||
text-align: left; | ||
height: 0; | ||
margin-top: ${0.5 * GU}px; | ||
`} | ||
> | ||
{error} | ||
</p> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
}) | ||
|
||
export default EmailInput |
51 changes: 51 additions & 0 deletions
51
src/components/EmailNotifications/EmailNotificationError.js
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react' | ||
import { GU, textStyle, useTheme } from '@aragon/ui' | ||
|
||
import emailIllustration from '../../assets/emailIllustration.svg' | ||
|
||
const VerifyEmailAddress = React.memo(function VerifyEmailAddress({ email }) { | ||
const theme = useTheme() | ||
|
||
return ( | ||
<div | ||
css={` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding: ${5 * GU}px; | ||
`} | ||
> | ||
<div | ||
css={` | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
`} | ||
> | ||
<img src={emailIllustration} /> | ||
<span | ||
css={` | ||
${textStyle('title2')}; | ||
margin-top: ${4 * GU}px; | ||
`} | ||
> | ||
Cannot connect to Notifications server | ||
</span> | ||
|
||
<span | ||
css={` | ||
${textStyle('body2')}; | ||
color: ${theme.surfaceContentSecondary}; | ||
margin-top: ${1.5 * GU}px; | ||
`} | ||
> | ||
There was a problem when trying to connect to the Email Notifications | ||
server. Make sure your Internet connection is working and please try | ||
again. | ||
</span> | ||
</div> | ||
</div> | ||
) | ||
}) | ||
|
||
export default VerifyEmailAddress |
Empty file.
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.
It looks like
usePreferences()
also exports this constant.