Files
supabase/apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx
Joshen Lim 40ca927808 Chore/support updating email and unlinking identities (#33966)
* 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
2025-03-21 17:15:05 +08:00

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>
)
}