UI Refinments Auth Improvments
This commit is contained in:
+24
-5
@@ -10,6 +10,7 @@ export default function LoginPage() {
|
|||||||
const [mode, setMode] = useState<'login' | 'register'>('login');
|
const [mode, setMode] = useState<'login' | 'register'>('login');
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
|
const [confirmPassword, setConfirmPassword] = useState('');
|
||||||
const [handle, setHandle] = useState('');
|
const [handle, setHandle] = useState('');
|
||||||
const [displayName, setDisplayName] = useState('');
|
const [displayName, setDisplayName] = useState('');
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
@@ -18,6 +19,12 @@ export default function LoginPage() {
|
|||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setError('');
|
setError('');
|
||||||
|
|
||||||
|
if (mode === 'register' && password !== confirmPassword) {
|
||||||
|
setError('Passwords do not match');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -198,13 +205,25 @@ export default function LoginPage() {
|
|||||||
required
|
required
|
||||||
minLength={8}
|
minLength={8}
|
||||||
/>
|
/>
|
||||||
{mode === 'register' && (
|
|
||||||
<p style={{ fontSize: '12px', color: 'var(--foreground-tertiary)', marginTop: '4px' }}>
|
|
||||||
Minimum 8 characters
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{mode === 'register' && (
|
||||||
|
<div style={{ marginBottom: '24px' }}>
|
||||||
|
<label style={{ display: 'block', marginBottom: '6px', fontSize: '14px', fontWeight: 500 }}>
|
||||||
|
Confirm Password
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
className="input"
|
||||||
|
value={confirmPassword}
|
||||||
|
onChange={(e) => setConfirmPassword(e.target.value)}
|
||||||
|
placeholder="••••••••"
|
||||||
|
required
|
||||||
|
minLength={8}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-primary btn-lg"
|
className="btn btn-primary btn-lg"
|
||||||
|
|||||||
@@ -315,13 +315,31 @@ export default function MigrationPage() {
|
|||||||
<label style={{ fontSize: '13px', color: 'var(--foreground-tertiary)', display: 'block', marginBottom: '6px' }}>
|
<label style={{ fontSize: '13px', color: 'var(--foreground-tertiary)', display: 'block', marginBottom: '6px' }}>
|
||||||
Export file
|
Export file
|
||||||
</label>
|
</label>
|
||||||
<input
|
<div style={{ position: 'relative' }}>
|
||||||
type="file"
|
<input
|
||||||
accept=".json"
|
type="file"
|
||||||
onChange={(e) => setImportFile(e.target.files?.[0] || null)}
|
id="import-file-input"
|
||||||
className="input"
|
accept=".json"
|
||||||
style={{ padding: '8px' }}
|
onChange={(e) => setImportFile(e.target.files?.[0] || null)}
|
||||||
/>
|
style={{ display: 'none' }}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
htmlFor="import-file-input"
|
||||||
|
className="input"
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
cursor: 'pointer',
|
||||||
|
color: importFile ? 'var(--foreground)' : 'var(--foreground-tertiary)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span>{importFile ? importFile.name : 'Select export file...'}</span>
|
||||||
|
<span className="btn btn-ghost btn-sm" style={{ pointerEvents: 'none' }}>
|
||||||
|
Browse
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ marginBottom: '20px' }}>
|
<div style={{ marginBottom: '20px' }}>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function SettingsPage() {
|
|||||||
Security
|
Security
|
||||||
</div>
|
</div>
|
||||||
<div style={{ color: 'var(--foreground-secondary)', fontSize: '14px' }}>
|
<div style={{ color: 'var(--foreground-secondary)', fontSize: '14px' }}>
|
||||||
Change password, manage sessions
|
Change password
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user