1- import { AuthUpdateDto } from '@baca/api/types'
21import { Box , Button , Row } from '@baca/design-system'
32import { useUpdatePasswordForm } from '@baca/hooks/forms/useUpdatePasswordForm'
43import React from 'react'
54import { useTranslation } from 'react-i18next'
65
76import { ProfileControlledInput } from './ProfileControlledInput'
87
9- interface ProfilePasswordFormProps {
10- onSubmit : ( data : AuthUpdateDto ) => void
11- }
12-
13- export const ProfilePasswordForm = ( { onSubmit } : ProfilePasswordFormProps ) => {
8+ export const ProfilePasswordForm = ( ) => {
149 const { t } = useTranslation ( )
1510 const { control, errors, submit, isSubmitting } = useUpdatePasswordForm ( )
1611
@@ -23,15 +18,13 @@ export const ProfilePasswordForm = ({ onSubmit }: ProfilePasswordFormProps) => {
2318 placeholder = { t ( 'form.placeholders.old_password' ) }
2419 control = { control }
2520 errors = { errors }
26- // secureTextEntry
2721 />
2822 < ProfileControlledInput
2923 label = { t ( 'form.labels.new_password' ) }
3024 name = "password"
3125 placeholder = { t ( 'form.placeholders.new_password' ) }
3226 control = { control }
3327 errors = { errors }
34- // secureTextEntry
3528 />
3629 < Row maxW = { 800 } justifyContent = "flex-end" >
3730 < Button
@@ -47,89 +40,3 @@ export const ProfilePasswordForm = ({ onSubmit }: ProfilePasswordFormProps) => {
4740 </ Box >
4841 )
4942}
50-
51- // import { Box, Button } from '@baca/design-system'
52- // import { useTranslation } from '@baca/hooks'
53- // import { useUpdatePasswordForm } from '@baca/hooks/forms/useUpdatePasswordForm'
54- // import { ProfileControlledInput } from './ProfileControlledInput'
55- // import { AuthUpdateDto } from '@baca/api/types'
56-
57- // interface ProfilePasswordFormProps {
58- // onSubmit: (data: AuthUpdateDto) => void
59- // }
60-
61- // export const ProfilePasswordForm = ({ onSubmit }: ProfilePasswordFormProps) => {
62- // const { t } = useTranslation()
63- // const { control, errors, isSubmitting, submit } = useUpdatePasswordForm()
64-
65- // return (
66- // <Box
67- // /* as="form" onSubmit={submit} */ borderColor="border.secondary"
68- // borderTopWidth={1}
69- // py={6}
70- // >
71- // <ProfileControlledInput
72- // label={t('form.labels.old_password')}
73- // name="oldPassword"
74- // placeholder={t('form.placeholders.old_password')}
75- // control={control}
76- // errors={errors}
77- // // isPassword
78- // />
79- // <ProfileControlledInput
80- // label={t('form.labels.new_password')}
81- // name="password"
82- // placeholder={t('form.placeholders.new_password')}
83- // control={control}
84- // errors={errors}
85- // // isPassword
86- // />
87- // <Button type="submit" isLoading={isSubmitting}>
88- // {t('common.change')}
89- // </Button>
90- // </Box>
91- // )
92- // }
93-
94- // import { Box, Spacer, Button } from '@baca/design-system'
95- // import { useForm, Controller } from 'react-hook-form'
96- // import { ProfileControlledInput } from './ProfileControlledInput'
97- // import { useTranslation } from '@baca/hooks'
98- // import { AuthUpdateDto } from '@baca/api/types'
99-
100- // interface ProfilePasswordFormProps {
101- // onSubmit: (data: AuthUpdateDto) => void
102- // }
103-
104- // export const ProfilePasswordForm = ({ onSubmit }: ProfilePasswordFormProps) => {
105- // const {
106- // control,
107- // handleSubmit,
108- // formState: { errors },
109- // } = useForm<AuthUpdateDto>()
110- // const { t } = useTranslation()
111-
112- // return (
113- // <Box as="form" onSubmit={handleSubmit(onSubmit)}>
114- // <ProfileControlledInput
115- // label={t('form.labels.old_password')}
116- // name="oldPassword"
117- // placeholder={t('form.placeholders.old_password')}
118- // control={control}
119- // errors={errors}
120- // isPassword
121- // />
122- // <Spacer y={4} />
123- // <ProfileControlledInput
124- // label={t('form.labels.new_password')}
125- // name="password"
126- // placeholder={t('form.placeholders.new_password')}
127- // control={control}
128- // errors={errors}
129- // isPassword
130- // />
131- // <Spacer y={4} />
132- // <Button type="submit">{t('form.buttons.update_password')}</Button>
133- // </Box>
134- // )
135- // }
0 commit comments