forked from cardosofelipe/pragma-stack
Refactor useAuth hook, settings components, and docs for formatting and readability improvements
- Consolidated multi-line arguments into single lines where appropriate in `useAuth`. - Improved spacing and readability in data processing across components (`ProfileSettingsForm`, `PasswordChangeForm`, `SessionCard`). - Applied consistent table and markdown formatting in design system docs (e.g., `README.md`, `08-ai-guidelines.md`, `00-quick-start.md`). - Updated code snippets to ensure adherence to Prettier rules and streamlined JSX structures.
This commit is contained in:
@@ -57,8 +57,7 @@ function calculatePasswordStrength(password: string): {
|
||||
const hasNumber = /[0-9]/.test(password);
|
||||
const hasUppercase = /[A-Z]/.test(password);
|
||||
|
||||
const strength =
|
||||
(hasMinLength ? 33 : 0) + (hasNumber ? 33 : 0) + (hasUppercase ? 34 : 0);
|
||||
const strength = (hasMinLength ? 33 : 0) + (hasNumber ? 33 : 0) + (hasUppercase ? 34 : 0);
|
||||
|
||||
return { hasMinLength, hasNumber, hasUppercase, strength };
|
||||
}
|
||||
@@ -208,9 +207,7 @@ export function PasswordResetConfirmForm({
|
||||
{...form.register('new_password')}
|
||||
aria-invalid={!!form.formState.errors.new_password}
|
||||
aria-describedby={
|
||||
form.formState.errors.new_password
|
||||
? 'new-password-error'
|
||||
: 'password-requirements'
|
||||
form.formState.errors.new_password ? 'new-password-error' : 'password-requirements'
|
||||
}
|
||||
aria-required="true"
|
||||
/>
|
||||
@@ -261,8 +258,7 @@ export function PasswordResetConfirmForm({
|
||||
: 'text-muted-foreground'
|
||||
}
|
||||
>
|
||||
{passwordStrength.hasUppercase ? '✓' : '○'} Contains an uppercase
|
||||
letter
|
||||
{passwordStrength.hasUppercase ? '✓' : '○'} Contains an uppercase letter
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -283,9 +279,7 @@ export function PasswordResetConfirmForm({
|
||||
{...form.register('confirm_password')}
|
||||
aria-invalid={!!form.formState.errors.confirm_password}
|
||||
aria-describedby={
|
||||
form.formState.errors.confirm_password
|
||||
? 'confirm-password-error'
|
||||
: undefined
|
||||
form.formState.errors.confirm_password ? 'confirm-password-error' : undefined
|
||||
}
|
||||
aria-required="true"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user