Skip to content

Commit

Permalink
Merge pull request #401 from WalletConnect/refactor/website-link-esca…
Browse files Browse the repository at this point in the history
…pe-hatch

refactor: website link escape hatch
  • Loading branch information
enesozturk authored Jan 15, 2024
2 parents 047faf4 + 27a0ba0 commit 5695f43
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
19 changes: 18 additions & 1 deletion src/components/utils/PwaModal/PwaModal.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PwaModal {
padding: 3em;
padding: 3rem;
padding-bottom: 2rem;
display: flex;
flex-direction: column;
text-align: center;
Expand Down Expand Up @@ -47,4 +48,20 @@
display: inline-block;
}
}

&__footer {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 0.5rem;

&__title {
color: var(--fg-color-2);
}

&__link {
color: var(--accent-color-1);
text-decoration: none;
}
}
}
18 changes: 16 additions & 2 deletions src/components/utils/PwaModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'

import { detect } from 'detect-browser'
import { Link } from 'react-router-dom'

import BackgroundImage from '@/assets/IntroBackground.png'
import AndroidShareIcon from '@/components/general/Icon/AndroidShare'
import IShareIcon from '@/components/general/Icon/IShare'
import WalletConnectIcon from '@/components/general/Icon/WalletConnectIcon'
import { Modal } from '@/components/general/Modal/Modal'
import Text from '@/components/general/Text'
import { web3InboxURLs } from '@/constants/navigation'
import { pwaModalService } from '@/utils/store'

import './PwaModal.scss'
Expand Down Expand Up @@ -40,7 +41,7 @@ export const getPlatformInstallText = () => {
return 'Install App'
case 'safari':
case 'ios':
return 'Add to homescreen'
return 'Add to Home Screen'
default:
return 'Install'
}
Expand Down Expand Up @@ -70,6 +71,19 @@ export const PwaModal: React.FC = () => {
<span className="PwaModal__share-icon">{getMobilePlatformIcon()}</span>
<Text variant="small-500"> and “{getPlatformInstallText()}</Text>
</div>
<div className="PwaModal__footer">
<Text className="PwaModal__footer__title" variant="small-400">
Learn more at&nbsp;
</Text>
<Link
className="PwaModal__footer__link"
to={web3InboxURLs.website}
target="_blank"
rel="noreferrer noopener"
>
<Text variant="small-400">web3inbox.com</Text>
</Link>
</div>
</div>
</Modal>
)
Expand Down
17 changes: 17 additions & 0 deletions src/pages/Login/Login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
overflow-x: hidden;
padding: 1rem 0.085em;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 4rem;

@supports (height: 100dvh) {
height: 100dvh;
Expand All @@ -38,6 +40,21 @@
&__connect-button {
min-width: fit-content;
}

&__footer {
display: flex;
flex-direction: column;
align-items: center;

&__title {
color: var(--fg-color-2);
}

&__link {
color: var(--accent-color-1);
text-decoration: none;
}
}
}
}

Expand Down
17 changes: 16 additions & 1 deletion src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { useContext, useEffect } from 'react'

import { useWeb3Modal } from '@web3modal/wagmi/react'
import { useLocation, useNavigate } from 'react-router-dom'
import { Link, useLocation, useNavigate } from 'react-router-dom'

import Button from '@/components/general/Button'
import IntroWallet from '@/components/general/Icon/IntroWallet'
import IntroContent from '@/components/general/IntroContent'
import Text from '@/components/general/Text'
import TransitionDiv from '@/components/general/TransitionDiv'
import Sidebar from '@/components/layout/Sidebar'
import { web3InboxURLs } from '@/constants/navigation'
import W3iContext from '@/contexts/W3iContext/context'

import './Login.scss'
Expand Down Expand Up @@ -55,6 +57,19 @@ const Login: React.FC = () => {
}
icon={<IntroWallet />}
/>
<div className="Main__footer">
<Text className="Main__footer__title" variant="small-400">
Learn more at
</Text>
<Link
className="Main__footer__link"
to={web3InboxURLs.website}
target="_blank"
rel="noreferrer noopener"
>
<Text variant="small-400">web3inbox.com</Text>
</Link>
</div>
</main>
</TransitionDiv>
)
Expand Down

1 comment on commit 5695f43

@vercel
Copy link

@vercel vercel bot commented on 5695f43 Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.