import styled from '@emotion/styled'; import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator'; import {Button} from 'sentry/components/button'; import type {FormProps} from 'sentry/components/forms/form'; import Form from 'sentry/components/forms/form'; import JsonForm from 'sentry/components/forms/jsonForm'; import PanelAlert from 'sentry/components/panels/panelAlert'; import PanelItem from 'sentry/components/panels/panelItem'; import accountPasswordFields from 'sentry/data/forms/accountPassword'; import {t} from 'sentry/locale'; import ConfigStore from 'sentry/stores/configStore'; type OnSubmitSuccess = Parameters>; function PasswordForm() { function handleSubmitSuccess(_change: OnSubmitSuccess[0], model: OnSubmitSuccess[1]) { // Reset form on success model.resetForm(); addSuccessMessage('Password has been changed'); } function handleSubmitError() { addErrorMessage('Error changing password'); } const user = ConfigStore.get('user'); return (
( )} renderHeader={() => ( {t('Changing your password will invalidate all logged in sessions.')} )} /> ); } const Actions = styled(PanelItem)` justify-content: flex-end; `; export default PasswordForm;