// @flow import React, { useState } from 'react'; import Button from 'component/button'; import I18nMessage from 'component/i18nMessage'; import { FormField } from 'component/common/form-components/form-field'; import { Form } from 'component/common/form-components/form'; import { withRouter } from 'react-router-dom'; // $FlowFixMe cannot resolve ... import image from 'static/img/yrblsec.svg'; const LIMITED = 'limited'; const NONE = 'none'; type Props = { signOut: () => void, setShareDataInternal: (boolean) => void, authenticated: boolean, authenticateIfSharingData: () => void, handleNextPage: () => void, }; function PrivacyAgreement(props: Props) { const { setShareDataInternal, authenticated, signOut, authenticateIfSharingData, handleNextPage } = props; const [share, setShare] = useState(undefined); // preload function handleSubmit() { if (share === LIMITED) { setShareDataInternal(true); } else { setShareDataInternal(false); } if (share === LIMITED) { authenticateIfSharingData(); } handleNextPage(); } return (

{__('Privacy')}

{__( `LBRY takes privacy and choice seriously. Is it ok if we monitor performance and help creators track their views?` )}

{__('Yes, share with LBRY')} 🙂 } onChange={(e) => setShare(LIMITED)} /> {__('No')} 😢 } helper={__(`* Note that as peer-to-peer software, your IP address and potentially other system information can be sent to other users, though this information is not stored permanently.`)} onChange={(e) => setShare(NONE)} /> {authenticated && (

, }} > You are signed in and sharing data with your cloud service provider. %signout_button%.

)}
{share === NONE && (

{__( 'While we respect the desire for maximally private usage, please note that choosing this option hurts the ability for creators to understand how their content is performing.' )}

)}
); } export default withRouter(PrivacyAgreement);