import React, { useState, useContext } from 'react'; import { SparklesIcon } from '../components/icons'; import { AuthContext } from '../context/AuthContext'; import { KOFI_PAGE_URL } from '../config'; const LoginView: React.FC = () => { const { login } = useContext(AuthContext); const [name, setName] = useState(''); const [secret, setSecret] = useState(''); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const handleLogin = (e: React.FormEvent) => { e.preventDefault(); setError(''); setIsLoading(true); setTimeout(() => { const success = login(name, secret); if (!success) { setError('Invalid credentials. Please check your login name and secret password.'); } // On success, the App component will automatically switch views. setIsLoading(false); }, 500); // Artificial delay for better UX }; return (
Enter the credentials you received after your purchase.
Don't have access?{' '} Purchase on Ko-fi .