-
-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update "Change Email" and "Change Password" modal designs (#714)
* feat: Add new utility classes * feat: Update "Change Email" modal design * feat: Use .sk-input.contrast className to mimic password wizard inputs * feat: Add explicit labels to password wizard inputs * feat: Make button sizing consistent * refactor: Remove unused dependencies * refactor: Remove unused component
- Loading branch information
1 parent
5da5104
commit 4f56c45
Showing
8 changed files
with
86 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 37 additions & 27 deletions
64
app/assets/javascripts/preferences/panes/account/changeEmail/ChangeEmailForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,47 @@ | ||
import { DecoratedInput } from '@/components/DecoratedInput'; | ||
import { StateUpdater } from 'preact/hooks'; | ||
import { FunctionalComponent } from 'preact'; | ||
import { HtmlInputTypes } from '@/enums'; | ||
|
||
type Props = { | ||
setNewEmail: StateUpdater<string> | ||
setCurrentPassword: StateUpdater<string> | ||
} | ||
setNewEmail: StateUpdater<string>; | ||
setCurrentPassword: StateUpdater<string>; | ||
}; | ||
|
||
const labelClassName = `block mb-1`; | ||
|
||
const inputClassName = 'sk-input contrast'; | ||
|
||
export const ChangeEmailForm: FunctionalComponent<Props> = ({ | ||
setNewEmail, | ||
setCurrentPassword | ||
setCurrentPassword, | ||
}) => { | ||
return ( | ||
( | ||
<> | ||
<div className={'mt-2 mb-3'}> | ||
<DecoratedInput | ||
onChange={(newEmail) => { | ||
setNewEmail(newEmail); | ||
}} | ||
placeholder={'New Email'} | ||
/> | ||
</div> | ||
<div className={'mt-2 mb-3'}> | ||
<DecoratedInput | ||
type={HtmlInputTypes.Password} | ||
onChange={(currentPassword) => { | ||
setCurrentPassword(currentPassword); | ||
}} | ||
placeholder={'Current Password'} | ||
/> | ||
</div> | ||
</> | ||
) | ||
<div className="w-full flex flex-col"> | ||
<div className="mt-2 mb-3"> | ||
<label className={labelClassName} htmlFor="change-email-email-input"> | ||
New Email: | ||
</label> | ||
<input | ||
id="change-email-email-input" | ||
className={inputClassName} | ||
type="email" | ||
onChange={({ target }) => { | ||
setNewEmail((target as HTMLInputElement).value); | ||
}} | ||
/> | ||
</div> | ||
<div className="mb-2"> | ||
<label className={labelClassName} htmlFor="change-email-password-input"> | ||
Current Password: | ||
</label> | ||
<input | ||
id="change-email-password-input" | ||
className={inputClassName} | ||
type="password" | ||
onChange={({ target }) => { | ||
setCurrentPassword((target as HTMLInputElement).value); | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
app/assets/javascripts/preferences/panes/account/changePassword/ChangePasswordForm.tsx
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
app/assets/javascripts/preferences/panes/account/changePassword/ChangePasswordSuccess.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.