-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add mobile universal link button (#186)
* feat: add mobile universal link button * chore: move the button to white listed route * fix: remove https from url param * chore: add url input * chore: improve link handling and wording
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useState } from 'react'; | ||
import { Button, Card, Input } from '../../App.styles'; | ||
|
||
export function MobileUniversalLink() { | ||
const [url, setUrl] = useState('wallet.xverse.app/explore'); | ||
|
||
const link = `https://connect.xverse.app/browser?url=${url}`; | ||
|
||
const handleClick = () => { | ||
window.open(link, '_blank', 'noopener,noreferrer'); | ||
}; | ||
|
||
return ( | ||
<Card> | ||
<h3>Mobile App Universal Link</h3> | ||
<div> | ||
If Xverse app is installed, it will open the browser withing the app using the url param | ||
</div> | ||
<div>If Xverse app is not installed, it will prompt the user to install the app</div> | ||
<div style={{ marginTop: 15, marginBottom: 15 }}> | ||
<div>Url param</div> | ||
<Input type="text" value={url} onChange={(e) => setUrl(e.target.value)} /> | ||
</div> | ||
<div style={{ marginTop: 15, marginBottom: 15 }}> | ||
<div>Full link</div> | ||
<div>{link}</div> | ||
</div> | ||
<Button onClick={handleClick}>Use Universal Link</Button> | ||
</Card> | ||
); | ||
} |
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