Rounds out the full rewrite with the remaining feature domains: group management (admin panel, mute, files, announcements, QR-based invite/join), contacts (friend profile, add-friend, blocklist, new-friends), favorites (real media rendering across text/image/video/voice/file/link), settings (profile/security/privacy/general/about), calls (Agora-backed audio/video signaling + call history), and system messages/file assistant. Also folds in a large batch of live-verified fixes surfaced by repeated fresh code-review passes and hands-on E2E testing against the real backend, including: WS reconnect not resubscribing any topic after a disconnect, missing x-im-client-mid on every send path (protocol compliance for retry dedup), group mute/member-settings/self-profile endpoint corrections, relationship-state type fixes across search/QR/ friend-profile, tenant-switch logout gap, password-policy now read from the real per-tenant config instead of guessed, NavRail highlight/ aria-current desync, several call-state-machine races, and responsive layout fixes across all four breakpoints (mobile/tablet/laptop/desktop) including a full mobile rebuild of favorites, call UI, and the settings home/sub-list split. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { useState } from 'react';
|
|
|
|
import { Icon } from '@/app/Icon';
|
|
|
|
interface PasswordInputProps {
|
|
value: string;
|
|
onChange: (value: string) => void;
|
|
placeholder: string;
|
|
autoComplete?: string;
|
|
error?: string;
|
|
maxLength?: number;
|
|
}
|
|
|
|
export function PasswordInput({ value, onChange, placeholder, autoComplete, error, maxLength }: PasswordInputProps) {
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
return (
|
|
<div className="flex flex-col gap-1.5">
|
|
<div
|
|
className={`flex h-[50px] items-center rounded-lg bg-surface-input px-3.5 has-focus:border has-focus:shadow-focus-ring ${
|
|
error ? 'border border-danger-text' : 'has-focus:border-focus-border'
|
|
}`}
|
|
>
|
|
<input
|
|
type={visible ? 'text' : 'password'}
|
|
value={value}
|
|
onChange={(e) => onChange(e.target.value)}
|
|
placeholder={placeholder}
|
|
autoComplete={autoComplete}
|
|
maxLength={maxLength}
|
|
className="w-full bg-transparent text-[15px] outline-none"
|
|
/>
|
|
<button
|
|
type="button"
|
|
onClick={() => setVisible((v) => !v)}
|
|
aria-label={visible ? '隐藏密码' : '显示密码'}
|
|
className="text-text-placeholder-2"
|
|
>
|
|
<Icon name={visible ? 'visibility' : 'visibility_off'} className="text-[20px]" />
|
|
</button>
|
|
</div>
|
|
{error ? <div className="text-xs text-danger-border">{error}</div> : null}
|
|
</div>
|
|
);
|
|
}
|