Use PasswordInput on GitSettings page

This commit is contained in:
Alex Gleason committed 2025-09-22 02:22:37 -05:00
1 parent 35ac22c74f
commit 79be6c8252
2 files changed
+6 -9

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ const PasswordInput = React.forwardRef<HTMLInputElement, React.InputHTMLAttribut
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded-sm disabled:cursor-not-allowed disabled:opacity-50"
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
disabled={props.disabled}
aria-label={showPassword ? "Hide password" : "Show password"}
>
+5 -8
View File
@@ -11,6 +11,7 @@ import { useGitHubOAuth } from '@/hooks/useGitHubOAuth';
import { useIsMobile } from '@/hooks/useIsMobile';
import { useNavigate } from 'react-router-dom';
import type { GitCredential } from '@/contexts/GitSettingsContext';
import { PasswordInput } from '@/components/ui/password-input';
interface PresetProvider {
id: string;
@@ -191,9 +192,8 @@ export function GitSettings() {
</div>
<div className="grid gap-2">
<Label htmlFor={`${origin}-password`}>{t('password')}</Label>
<Input
<PasswordInput
id={`${origin}-password`}
type="password"
placeholder={t('enterPassword')}
value={credential?.password || ''}
onChange={(e) => handleUpdateCredential(origin, { password: e.target.value })}
@@ -260,9 +260,8 @@ export function GitSettings() {
</div>
) : (
<div className="flex gap-2">
<Input
<PasswordInput
placeholder={t('enterToken')}
type="password"
className="flex-1"
value={presetTokens[preset.id] || ''}
onChange={(e) => setPresetTokens(prev => ({
@@ -287,9 +286,8 @@ export function GitSettings() {
) : (
// Standard rendering for other providers
<div className="flex gap-2">
<Input
<PasswordInput
placeholder={t('enterToken')}
type="password"
className="flex-1"
value={presetTokens[preset.id] || ''}
onChange={(e) => setPresetTokens(prev => ({
@@ -346,9 +344,8 @@ export function GitSettings() {
</div>
<div className="grid gap-2">
<Label htmlFor="custom-password">{t('password')}</Label>
<Input
<PasswordInput
id="custom-password"
type="password"
placeholder={t('enterPassword')}
value={customPassword}
onChange={(e) => setCustomPassword(e.target.value)}