feat(frontend): Add V1.0.1 preloader and version string to LoginView
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Database, Lock, User, ArrowRight, ShieldCheck } from 'lucide-react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Database, Lock, User, ArrowRight, ShieldCheck, Loader2 } from 'lucide-react';
|
||||
import { HybridBackend } from '../services/backend.ts';
|
||||
|
||||
interface LoginViewProps {
|
||||
@@ -11,6 +11,12 @@ export const LoginView: React.FC<LoginViewProps> = ({ onLoginSuccess }) => {
|
||||
const [password, setPassword] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const [isInitializing, setIsInitializing] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => setIsInitializing(false), 1000);
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
@@ -31,6 +37,16 @@ export const LoginView: React.FC<LoginViewProps> = ({ onLoginSuccess }) => {
|
||||
}
|
||||
};
|
||||
|
||||
if (isInitializing) {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4">
|
||||
<Loader2 className="animate-spin text-blue-600 mb-4" size={48} />
|
||||
<h2 className="text-gray-500 font-bold uppercase tracking-widest text-sm">Inicializando Sistema...</h2>
|
||||
<span className="text-gray-400 text-xs mt-2 font-mono font-bold bg-gray-200 px-2 py-1 rounded">V1.0.1</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 flex items-center justify-center p-4">
|
||||
<div className="max-w-md w-full bg-white rounded-2xl shadow-xl overflow-hidden border border-gray-100">
|
||||
@@ -97,8 +113,11 @@ export const LoginView: React.FC<LoginViewProps> = ({ onLoginSuccess }) => {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div className="mt-8 flex items-center justify-center gap-2 text-gray-400 text-[10px] font-bold uppercase">
|
||||
<ShieldCheck size={12}/> AMBIENTE SEGURO E CRIPTOGRAFADO
|
||||
<div className="mt-8 flex flex-col items-center justify-center gap-2 text-gray-400 text-[10px] font-bold uppercase">
|
||||
<div className="flex items-center gap-1">
|
||||
<ShieldCheck size={12}/> AMBIENTE SEGURO E CRIPTOGRAFADO
|
||||
</div>
|
||||
<span className="bg-gray-100 text-gray-500 px-2 py-1 rounded font-mono">V1.0.1</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user