-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6375 from blockchain/feat/v5-card-GROWUX-3672
feat(v5card): add v5 linkout card to homescreen
- Loading branch information
Showing
11 changed files
with
122 additions
and
3 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
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
5 changes: 5 additions & 0 deletions
5
packages/blockchain-info-components/src/Images/img/arrow-right-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
packages/blockchain-info-components/src/Images/img/super-app-icon.svg
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
54 changes: 54 additions & 0 deletions
54
packages/blockchain-wallet-v4-frontend/src/components/Navbar/SuperAppLink/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,54 @@ | ||
import React from 'react' | ||
import { FormattedMessage } from 'react-intl' | ||
import { useSelector } from 'react-redux' | ||
import Cookies from 'universal-cookie' | ||
|
||
import { getIsSuperAppEnabled } from '@core/redux/walletOptions/selectors' | ||
import { Image, Text } from 'blockchain-info-components' | ||
import { Separator } from 'layouts/Wallet/components' | ||
|
||
import { Container, LeftContainer, SeparatorWrapper, TextContainer } from './styles' | ||
|
||
export const Divider = () => ( | ||
<SeparatorWrapper> | ||
<Separator /> | ||
</SeparatorWrapper> | ||
) | ||
|
||
const SuperAppLink = () => { | ||
const isSuperAppEnabled = useSelector(getIsSuperAppEnabled).getOrElse(false) | ||
const cookies = new Cookies() | ||
const hasSuperAppAccess = cookies.get('wallet_v5_ui_available') | ||
|
||
const handleClick = () => { | ||
cookies.set('opt_out_wallet_v5_ui', 'false', { path: '/' }) | ||
window.location.reload() | ||
} | ||
|
||
if (!isSuperAppEnabled || !hasSuperAppAccess) return null | ||
|
||
return ( | ||
<> | ||
<Divider /> | ||
<Container onClick={handleClick}> | ||
<LeftContainer> | ||
<Image name='super-app-icon' size='32px' /> | ||
<TextContainer> | ||
<Text color='alertsNegative' weight={500} lineHeight='18px' size='12px'> | ||
<FormattedMessage defaultMessage='NEW' id='scene.wallet.menu.new' /> | ||
</Text> | ||
<Text weight={600} lineHeight='21px' size='14px'> | ||
<FormattedMessage | ||
defaultMessage='Try the new wallet' | ||
id='scene.wallet.menu.try-new-wallet' | ||
/> | ||
</Text> | ||
</TextContainer> | ||
</LeftContainer> | ||
<Image name='arrow-right-circle' size='16px' /> | ||
</Container> | ||
</> | ||
) | ||
} | ||
|
||
export default SuperAppLink |
36 changes: 36 additions & 0 deletions
36
packages/blockchain-wallet-v4-frontend/src/components/Navbar/SuperAppLink/styles.ts
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,36 @@ | ||
import styled from 'styled-components' | ||
|
||
import { media } from 'services/styles' | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
gap: 12px; | ||
padding: 16px; | ||
background-color: ${({ theme }) => theme.grey000}; | ||
border-radius: 16px; | ||
cursor: pointer; | ||
width: 100%; | ||
box-sizing: border-box; | ||
${media.tablet` | ||
margin-bottom: 8px; | ||
`} | ||
` | ||
|
||
export const TextContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
` | ||
|
||
export const LeftContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
` | ||
export const SeparatorWrapper = styled.div` | ||
width: calc(100% - 32px); | ||
margin: 8px 16px; | ||
box-sizing: border-box; | ||
` |
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