:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { useActions, useValues } from 'kea'
import { Form } from 'kea-forms'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
import { emailChangeVerificationLogic } from 'scenes/settings/user/emailChangeVerificationLogic'
import { EmailChangeVerificationModal } from 'scenes/settings/user/EmailChangeVerificationModal'
import { userLogic } from 'scenes/userLogic'
export function UserDetails(): JSX.Element {
const { userLoading, isUserDetailsSubmitting, userDetailsChanged, user } = useValues(userLogic)
const { cancelEmailChangeRequest } = useActions(userLogic)
const { openModal } = useActions(emailChangeVerificationLogic)
return (
<>
<EmailChangeVerificationModal />
<Form
logic={userLogic}
formKey="userDetails"
enableFormOnSubmit
className="deprecated-space-y-4"
style={{
maxWidth: '28rem',
}}
>
<LemonField name="first_name" label="First name">
<LemonInput
className="ph-ignore-input"
data-attr="settings-update-first-name"
placeholder="Jane"
disabled={userLoading}
/>
</LemonField>
<LemonField name="last_name" label="Last name">
<LemonInput
className="ph-ignore-input"
data-attr="settings-update-last-name"
placeholder="Doe"
disabled={userLoading}
/>
</LemonField>
<LemonField name="email" label="Email">
<LemonInput
className="ph-ignore-input"
data-attr="settings-update-email"
placeholder="[email protected]"
disabled={userLoading}
/>
</LemonField>
{user?.pending_email && (
<div className="flex flex-row gap-2">
<div className="text-danger text-xs font-medium mt-1.25">
Pending verification for {user.pending_email}
</div>
<LemonButton
type="tertiary"
size="xsmall"
data-attr="enter-email-verification-code-button"
onClick={openModal}
>
Enter verification code
</LemonButton>
<LemonButton
type="tertiary"
size="xsmall"
data-attr="cancel-email-change-request-button"
onClick={cancelEmailChangeRequest}
>
Cancel change
</LemonButton>
</div>
)}
<LemonButton
type="primary"
htmlType="submit"
loading={isUserDetailsSubmitting}
disabled={!userDetailsChanged}
data-attr="user-details-submit-bottom"
>
Save name and email
</LemonButton>
</Form>
</>
)
}