Skip to main content

Consent screen

This screen lets a user visit the privacy and terms URL. The user can then agree by checking off a checkbox and pressing the submit button. At that point, the onAccept callback is triggered.

This page contains the following translation keys:

  • consent_title
  • consent_intro
  • consent_body
  • Read
  • the privacy policy
  • and
  • the terms and conditions
  • I understand
  • Ready to get started?
  • Let's go

Example usage

Here is a simplified version of how this component is used in the template app:

import { useLocal } from '@healthblocks-io/core/local'
import PrivacyConsent from '@healthblocks-io/native/Consent'

function App() {
// Load most important data from async storage
const localState = useLocal()
if (!localState) return null
const [local, setLocal] = localState

// Require language selection
if (!local.language) return ...

// Require onboarding
if (!local.onboarding) return ...

// Store the date of consent to allow for future updates to the terms
if (!local.consent) {
return (
<PrivacyConsent
onAccept={() => setLocal({ consent: new Date().toJSON() })}
/>
)
}
}