mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
* Support updating email address for email identity * Support unlinking identity * Deprecate AccountInformation component * Invalidate identities after unlinking * Address feedback * Smol * Fix type issues * Update toast message * Set up email change pending badge * Fix * Address feedback * Resolve ts-expect-errors * Fix TS issues + Fix GH icon on light mode + Address feedback
30 lines
950 B
TypeScript
30 lines
950 B
TypeScript
import { Toggle } from 'ui'
|
|
|
|
import Panel from 'components/ui/Panel'
|
|
import { useSendResetMutation } from 'data/telemetry/send-reset-mutation'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
|
|
export const AnalyticsSettings = () => {
|
|
const snap = useAppStateSnapshot()
|
|
const { mutate: sendReset } = useSendResetMutation()
|
|
|
|
const onToggleOptIn = () => {
|
|
const value = !snap.isOptedInTelemetry ? 'true' : 'false'
|
|
snap.setIsOptedInTelemetry(value === 'true')
|
|
if (value === 'false') sendReset()
|
|
}
|
|
|
|
return (
|
|
<Panel title={<h5 key="panel-title">Analytics</h5>}>
|
|
<Panel.Content>
|
|
<Toggle
|
|
checked={snap.isOptedInTelemetry}
|
|
onChange={onToggleOptIn}
|
|
label="Opt-in to send telemetry data from the dashboard"
|
|
descriptionText="By opting into sending telemetry data, Supabase can improve the overall dashboard user experience"
|
|
/>
|
|
</Panel.Content>
|
|
</Panel>
|
|
)
|
|
}
|