-
Notifications
You must be signed in to change notification settings - Fork 7
feat(PostInstall): add consent screen about data sharing #1191
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
Open
sidvishnoi
wants to merge
11
commits into
main
Choose a base branch
from
extension-consent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fa21ef3
feat(PostInstall): add consent screen about data sharing
sidvishnoi e2ae4ea
design variant 2 (not split layout anymore)
sidvishnoi 8e12e9b
design finalize
sidvishnoi c01c82a
design cleanup
sidvishnoi 23753bc
integrate consent request
sidvishnoi 3933797
don't forget to return `consent` to popup
sidvishnoi 45e4e37
tests: give sharing consent in setup
sidvishnoi 02d35b0
move tooltip behind "info" icon
sidvishnoi af1b15e
PostInstallConsent: move all strings to `_locales/en/messages.json`
sidvishnoi 4b483cf
popup/ConsentRequired: move all strings to `_locales/en/messages.json`
sidvishnoi 7439345
fixup! PostInstallConsent: move all strings to `_locales/en/messages.…
sidvishnoi 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 hidden or 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 hidden or 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,178 @@ | ||
import React from 'react'; | ||
import { getBrowserName } from '@/shared/helpers'; | ||
import { useBrowser, useTranslation } from '@/app/lib/context'; | ||
|
||
export default () => { | ||
return ( | ||
<div | ||
className="flex min-h-screen flex-col items-center bg-fixed sm:overflow-hidden landscape:justify-center" | ||
style={{ | ||
backgroundImage: `url("/assets/images/bg-tile.svg")`, | ||
backgroundSize: '40vmax', | ||
}} | ||
> | ||
<div className="flex min-h-screen w-full max-w-screen-2xl flex-1 grid-cols-2 flex-col items-stretch gap-6 p-3 sm:p-8 landscape:grid landscape:p-4"> | ||
<Header /> | ||
<div className="flex items-center"> | ||
<Main /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const Header = () => { | ||
const t = useTranslation(); | ||
return ( | ||
<div className="text-center landscape:mt-[33vh]"> | ||
<img | ||
src="/assets/images/logo.svg" | ||
className="mx-auto mb-4 w-16 text-center landscape:w-36 landscape:2xl:w-48" | ||
alt="" | ||
/> | ||
<p className="text-xl font-bold text-secondary-dark landscape:mb-2 landscape:text-3xl landscape:2xl:mb-3 landscape:2xl:text-4xl"> | ||
{t('tagline_text_1')} | ||
</p> | ||
<p className="text-xl font-light text-secondary-dark landscape:text-3xl landscape:2xl:text-4xl"> | ||
{t('tagline_text_2')} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
const Main = () => { | ||
const _t = useTranslation(); | ||
|
||
return ( | ||
<div className="mx-auto flex w-full max-w-2xl flex-col gap-4 rounded-lg border border-gray-200 bg-gray-50/75 p-3 shadow-md backdrop-blur-0 sm:p-8"> | ||
<h2 className="rounded-sm bg-gray-100 p-2 text-center text-base font-semibold sm:rounded-2xl sm:p-4 sm:text-lg"> | ||
Welcome to the Web Monetization Extension | ||
</h2> | ||
|
||
<div className="space-y-4 bzg-white zp-4"> | ||
<p> | ||
To get started, we want to be transparent about what data is shared | ||
and how it’s used. | ||
</p> | ||
<p> | ||
By continuing, you give your consent to share the following | ||
information: | ||
</p> | ||
|
||
<DataShared /> | ||
<DataNotShared /> | ||
<Permissions /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
function DataShared() { | ||
const browser = useBrowser(); | ||
|
||
const browserName = getBrowserName(browser, navigator.userAgent); | ||
const [extensionName, setExtensionName] = React.useState(''); | ||
React.useEffect(() => { | ||
browser.management.getSelf().then((s) => { | ||
setExtensionName(s.name); | ||
}); | ||
}, [browser]); | ||
|
||
return ( | ||
<div className="space-y-2"> | ||
<h3 className="font-semibold">Data Shared</h3> | ||
<div> | ||
<h4 className="font-medium">With your wallet provider</h4> | ||
<ul className="list-disc ml-4"> | ||
<li> | ||
When you connect your wallet (if you choose automatic key addition): | ||
<ul className="list-disc ml-4"> | ||
<li>Browser name ({browserName})</li> | ||
<li> | ||
Extension name {extensionName ? `(${extensionName})` : ''} | ||
</li> | ||
</ul> | ||
</li> | ||
<li>You’ll always be asked for consent before any connection.</li> | ||
<li> | ||
Your IP address,{' '} | ||
<span | ||
className="underline decoration-dotted decoration-gray-400" | ||
title="via the `Accept-Language` HTTP header" | ||
> | ||
language | ||
</span>{' '} | ||
and{' '} | ||
<span | ||
className="underline decoration-dotted decoration-gray-400" | ||
title="via the `User-Agent` HTTP header" | ||
> | ||
browser version information | ||
</span>{' '} | ||
when making automatic or manual payments. | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div> | ||
<h4 className="font-medium"> | ||
With the wallets used on websites you visit that use Web Monetization: | ||
</h4> | ||
<ul className="list-disc ml-4"> | ||
<li> | ||
Your IP address,{' '} | ||
<span | ||
className="underline decoration-dotted decoration-gray-400" | ||
title="via the `Accept-Language` HTTP header" | ||
> | ||
language | ||
</span>{' '} | ||
and{' '} | ||
<span | ||
className="underline decoration-dotted decoration-gray-400" | ||
title="via the `User-Agent` HTTP header" | ||
> | ||
browser version information | ||
</span>{' '} | ||
. | ||
</li> | ||
<li>Your wallet address.</li> | ||
</ul> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function DataNotShared() { | ||
return ( | ||
<div className="space-y-2"> | ||
<h3 className="font-semibold">What’s not shared</h3> | ||
<ul className="list-disc ml-4"> | ||
<li> | ||
Your wallet address, balance, or currency are not shared with websites | ||
you visit. | ||
</li> | ||
<li>Your browsing history — it stays private in your browser.</li> | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
function Permissions() { | ||
return ( | ||
<div className="space-y-2"> | ||
<h3 className="font-semibold">Extension Permissions</h3> | ||
<p> | ||
This extension requires certain{' '} | ||
<a | ||
href="https://github.com/interledger/web-monetization-extension/blob/main/docs/PERMISSIONS.md" | ||
className="group pr-1 text-primary outline-current hover:underline" | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
> | ||
permissions for basic functionality. | ||
</a> | ||
</p> | ||
</div> | ||
); | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as PostInstall } from './PostInstall'; | ||
export { default as Consent } from './PostInstallConsent'; |
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.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Looks good @sidvishnoi
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Good point on (3). I don't have any better suggestions though.
This is the latest state:

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.
LGTM
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.
Same here