install shadcdn and move login dialog to a separate component
This commit is contained in:
parent
4c7fe8927b
commit
a8ee95b9d9
13 changed files with 1141 additions and 73 deletions
33
crawler/frontend/src/components/LoginModal.tsx
Normal file
33
crawler/frontend/src/components/LoginModal.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { login } from '@/auth/authService';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import React from 'react';
|
||||
import '../assets/LoginModal.css';
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from './ui/dialog';
|
||||
|
||||
|
||||
interface ModalProps {
|
||||
isOpen: boolean;
|
||||
}
|
||||
|
||||
const Modal: React.FC<ModalProps> = ({
|
||||
isOpen,
|
||||
}) => {
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<Dialog open={isOpen}>
|
||||
<form>
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Login to Wrongmove</DialogTitle>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button onClick={login}>Login</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</form>
|
||||
</Dialog>
|
||||
)
|
||||
};
|
||||
|
||||
export default Modal;
|
||||
Loading…
Add table
Add a link
Reference in a new issue