2025-11-18 01:37:56 +09:00
|
|
|
|
"use client";
|
|
|
|
|
|
import React from "react";
|
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
type LoginOptionProps = {
|
2025-11-25 10:30:17 +09:00
|
|
|
|
onClick?: () => void;
|
|
|
|
|
|
className?: string;
|
2025-11-18 01:37:56 +09:00
|
|
|
|
loginErrorModalEnabled?: boolean;
|
|
|
|
|
|
setLoginErrorModalEnabled?: (enabled: boolean) => void;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default function LoginOption({
|
2025-11-25 10:30:17 +09:00
|
|
|
|
className,
|
2025-11-18 01:37:56 +09:00
|
|
|
|
loginErrorModalEnabled,
|
|
|
|
|
|
setLoginErrorModalEnabled,
|
|
|
|
|
|
}: LoginOptionProps) {
|
|
|
|
|
|
|
|
|
|
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-25 10:30:17 +09:00
|
|
|
|
return (
|
2025-11-18 01:37:56 +09:00
|
|
|
|
<div>
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
onClick={() => setIsOpen(!isOpen)}
|
|
|
|
|
|
className={`fixed bottom-2 right-2 bg-red-400 cursor-pointer rounded-full w-[40px] h-[40px] shadow-xl z-100`}
|
|
|
|
|
|
>
|
|
|
|
|
|
</button>
|
2025-11-25 10:30:17 +09:00
|
|
|
|
{isOpen && (
|
2025-11-18 01:37:56 +09:00
|
|
|
|
<div className="fixed inset-0 flex items-center justify-center z-50">
|
2025-11-18 03:27:30 +09:00
|
|
|
|
<div className="w-[500px] h-[600px] flex bg-white/80 p-10 border rounded-lg relative">
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
aria-label="닫기"
|
|
|
|
|
|
onClick={() => setIsOpen(false)}
|
|
|
|
|
|
className="absolute top-3 right-3 inline-flex items-center justify-center rounded-full w-8 h-8 bg-gray-200 hover:bg-gray-300 text-gray-700"
|
|
|
|
|
|
>
|
|
|
|
|
|
×
|
|
|
|
|
|
</button>
|
2025-11-25 10:30:17 +09:00
|
|
|
|
<ul className="flex flex-col gap-4">
|
|
|
|
|
|
<li className="flex items-center justify-between">
|
|
|
|
|
|
<p className="mr-4">login error modal</p>
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
aria-label="login error modal 토글"
|
|
|
|
|
|
aria-pressed={!!loginErrorModalEnabled}
|
|
|
|
|
|
onClick={() => setLoginErrorModalEnabled?.(!loginErrorModalEnabled)}
|
|
|
|
|
|
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${loginErrorModalEnabled ? 'bg-blue-600' : 'bg-gray-300'}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<span
|
|
|
|
|
|
className={`inline-block h-5 w-5 transform rounded-full bg-white transition ${loginErrorModalEnabled ? 'translate-x-5' : 'translate-x-1'}`}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
2025-11-18 01:37:56 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
2025-11-25 10:30:17 +09:00
|
|
|
|
);
|
2025-11-18 01:37:56 +09:00
|
|
|
|
}
|