import { gql, useMutation } from "@apollo/client";
import {
Box,
Button,
FormControl,
FormHelperText,
FormLabel,
Input,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalHeader,
ModalOverlay,
Tab,
TabList,
TabPanel,
TabPanels,
Tabs,
} from "@chakra-ui/react";
import React from "react";
import { ErrorMessage, getGraphQLErrorMessage } from "../util";
export default function LoginModal({ isOpen, onClose }) {
return (
Welcome back to Dress to Impress! ✨
Log in
Create account
onClose()} />
);
}
function LoginForm({ onSuccess }) {
const [username, setUsername] = React.useState("");
const [password, setPassword] = React.useState("");
const [
sendLoginMutation,
{ loading, error, data, called, reset },
] = useMutation(gql`
mutation LoginForm_Login($username: String!, $password: String!) {
login(username: $username, password: $password) {
id
username
}
}
`);
return (
);
}
function CreateAccountForm() {
const onSubmit = (e) => {
e.preventDefault();
alert("TODO: Create account!");
};
return (
);
}