-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(announcemenets): refactor (#6287)
- Loading branch information
1 parent
245c5cb
commit bb0b09b
Showing
15 changed files
with
85 additions
and
155 deletions.
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
81 changes: 0 additions & 81 deletions
81
packages/blockchain-wallet-v4-frontend/src/components/Announcements/Static/index.js
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
packages/blockchain-wallet-v4-frontend/src/components/Announcements/Static/index.tsx
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,49 @@ | ||
import React, { useState } from 'react' | ||
import { shallowEqual, useDispatch, useSelector } from 'react-redux' | ||
import styled from 'styled-components' | ||
|
||
import { getEmail, getEmailVerified } from '@core/redux/settings/selectors' | ||
import { actions } from 'data' | ||
import { media } from 'services/styles' | ||
|
||
import EmailReminder from './template.email' | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
padding: 8px 20px 8px 20px; | ||
align-items: center; | ||
justify-content: space-between; | ||
background: ${(props) => props.theme.blue600}; | ||
overflow: hidden; | ||
${media.tablet` | ||
display: none; | ||
`}; | ||
` | ||
|
||
const StaticAnnouncementsContainer = () => { | ||
const [emailReminded, setEmailReminded] = useState(false) | ||
|
||
const { data: emailVerified } = useSelector(getEmailVerified, shallowEqual) | ||
const { data: email } = useSelector(getEmail, shallowEqual) | ||
|
||
const dispatch = useDispatch() | ||
|
||
const onEmailResend = () => { | ||
if (emailReminded) return | ||
dispatch(actions.modules.securityCenter.resendVerifyEmail(email, 'BANNER')) | ||
setEmailReminded(true) | ||
setTimeout(() => { | ||
setEmailReminded(false) | ||
}, 3000) | ||
} | ||
|
||
if (!emailVerified) return null | ||
|
||
return ( | ||
<Wrapper> | ||
<EmailReminder onEmailResend={onEmailResend} email={email} emailReminded={emailReminded} /> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
export default StaticAnnouncementsContainer |
17 changes: 0 additions & 17 deletions
17
packages/blockchain-wallet-v4-frontend/src/components/Announcements/Static/selectors.js
This file was deleted.
Oops, something went wrong.
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
19 changes: 0 additions & 19 deletions
19
packages/blockchain-wallet-v4-frontend/src/components/Announcements/index.js
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
packages/blockchain-wallet-v4-frontend/src/components/Announcements/index.tsx
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,2 @@ | ||
export { default as ServiceAnnouncement } from './Service' | ||
export { default as StaticAnnouncement } from './Static' |
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
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