Remove offline mode
The offline mode was removed to focus on resolving connection issues instead of providing a workaround.
This commit is contained in:
@@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ArrowRight, Mail, KeyRound, Eye, EyeOff, AlertTriangle, Loader2, WifiOff, Wifi } from "lucide-react";
|
||||
import { ArrowRight, Mail, KeyRound, Eye, EyeOff, AlertTriangle, Loader2 } from "lucide-react";
|
||||
|
||||
interface LoginFormProps {
|
||||
email: string;
|
||||
@@ -17,8 +17,6 @@ interface LoginFormProps {
|
||||
isSettingUpTables?: boolean;
|
||||
loginError: string | null;
|
||||
handleLogin: (e: React.FormEvent) => Promise<void>;
|
||||
isOfflineMode?: boolean;
|
||||
setIsOfflineMode?: (offline: boolean) => void;
|
||||
}
|
||||
|
||||
const LoginForm: React.FC<LoginFormProps> = ({
|
||||
@@ -31,9 +29,7 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
isLoading,
|
||||
isSettingUpTables = false,
|
||||
loginError,
|
||||
handleLogin,
|
||||
isOfflineMode = false,
|
||||
setIsOfflineMode
|
||||
handleLogin
|
||||
}) => {
|
||||
// CORS 또는 JSON 관련 오류인지 확인
|
||||
const isCorsOrJsonError = loginError &&
|
||||
@@ -42,14 +38,6 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
loginError.includes('네트워크') ||
|
||||
loginError.includes('404') || loginError.includes('Not Found'));
|
||||
|
||||
const toggleOfflineMode = () => {
|
||||
if (setIsOfflineMode) {
|
||||
const newMode = !isOfflineMode;
|
||||
setIsOfflineMode(newMode);
|
||||
localStorage.setItem('offline_mode', newMode.toString());
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="neuro-flat p-8 mb-6">
|
||||
<form onSubmit={handleLogin}>
|
||||
@@ -91,27 +79,6 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={toggleOfflineMode}
|
||||
variant={isOfflineMode ? "destructive" : "outline"}
|
||||
className="w-full mb-3 flex items-center justify-center py-2"
|
||||
>
|
||||
{isOfflineMode ? (
|
||||
<>
|
||||
<WifiOff className="h-4 w-4 mr-2" />
|
||||
오프라인 모드 활성화됨 (클릭하여 비활성화)
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Wifi className="h-4 w-4 mr-2" />
|
||||
온라인 모드 활성화됨 (클릭하여 오프라인 모드로 전환)
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{loginError && (
|
||||
<div className={`p-3 ${isCorsOrJsonError ? 'bg-amber-50 text-amber-800' : 'bg-red-50 text-red-600'} rounded-md text-sm`}>
|
||||
<div className="flex items-start gap-2">
|
||||
@@ -119,18 +86,11 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
<div>
|
||||
<p className="font-medium">{loginError}</p>
|
||||
|
||||
{isCorsOrJsonError && !isOfflineMode && (
|
||||
{isCorsOrJsonError && (
|
||||
<ul className="mt-2 list-disc pl-5 text-xs space-y-1 text-amber-700">
|
||||
<li>설정 페이지에서 다른 CORS 프록시 유형을 시도해 보세요.</li>
|
||||
<li>HTTPS URL을 사용하는 Supabase 인스턴스로 변경해 보세요.</li>
|
||||
<li>네트워크 연결 상태를 확인하세요.</li>
|
||||
<li><button
|
||||
type="button"
|
||||
onClick={toggleOfflineMode}
|
||||
className="text-neuro-income hover:underline inline-flex items-center"
|
||||
>
|
||||
<WifiOff className="h-3 w-3 mr-1" /> 오프라인 모드로 전환하기
|
||||
</button></li>
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
@@ -138,21 +98,6 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isOfflineMode && (
|
||||
<div className="p-3 bg-blue-50 text-blue-800 rounded-md text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<WifiOff className="h-5 w-5 text-blue-500" />
|
||||
<div>
|
||||
<p className="font-medium">오프라인 모드 활성화됨</p>
|
||||
<p className="text-xs mt-1">서버 없이 앱의 기본 기능을 사용할 수 있습니다. 데이터는 로컬에 저장됩니다.</p>
|
||||
<p className="text-xs mt-1 text-blue-600">
|
||||
<strong>중요:</strong> 404 오류가 계속 발생한다면 오프라인 모드를 사용해보세요.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="text-right">
|
||||
<Link to="/forgot-password" className="text-sm text-neuro-income hover:underline">
|
||||
비밀번호를 잊으셨나요?
|
||||
@@ -166,7 +111,7 @@ const LoginForm: React.FC<LoginFormProps> = ({
|
||||
>
|
||||
{isLoading ? "로그인 중..." :
|
||||
isSettingUpTables ? "데이터베이스 설정 중..." :
|
||||
isOfflineMode ? "오프라인 모드로 로그인" : "로그인"}
|
||||
"로그인"}
|
||||
{!isLoading && !isSettingUpTables ?
|
||||
<ArrowRight className="ml-2 h-5 w-5" /> :
|
||||
<Loader2 className="ml-2 h-5 w-5 animate-spin" />}
|
||||
|
||||
Reference in New Issue
Block a user