Compare commits
5 Commits
cce376a703
...
99b78b9197
Author | SHA1 | Date | |
---|---|---|---|
99b78b9197 | |||
c5308eb430 | |||
61154028a3 | |||
5f34e04c1d | |||
5927739f7d |
@ -2,7 +2,7 @@ import { FC, HTMLProps } from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
const styleClasses = {
|
||||
base: "w-full lg:w-1/2 mx-auto",
|
||||
base: "w-full lg:w-1/2 mx-auto px-2",
|
||||
};
|
||||
|
||||
const Container: FC<HTMLProps<HTMLDivElement>> = (props) => {
|
||||
|
@ -108,10 +108,10 @@ const Sidebar = () => {
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div className="flex flex-shrink-0 py-4 px-5 justify-between items-center border-t border-gray-200">
|
||||
<div className="flex flex-row justify-center items-center space-x-4">
|
||||
<p>admin</p>
|
||||
</div>
|
||||
<div className="flex flex-shrink-0 py-4 px-5 justify-between items-center border-t border-gray-200 space-x-4">
|
||||
<SidebarTab onClick={navFactory("/me")}>
|
||||
<span className="ml-3">admin</span>
|
||||
</SidebarTab>
|
||||
<div className="w-6 h-6">
|
||||
<LogoutIcon
|
||||
className="cursor-pointer"
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { useFormik } from "formik";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useLoginMutation } from "../../../generated/graphql";
|
||||
|
||||
@ -23,12 +22,11 @@ const LoginPage = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!loginMutation.data) return;
|
||||
if (Object.hasOwn(loginMutation.data.login, "message")) {
|
||||
setSubmitError(loginMutation.data.login.message);
|
||||
if (!loginMutation.data) {
|
||||
return;
|
||||
}
|
||||
if (Object.hasOwn(loginMutation.data.login, "token")) {
|
||||
} else if (loginMutation.data.login.__typename == "CommonError") {
|
||||
setSubmitError(loginMutation.data.login.message);
|
||||
} else if (loginMutation.data.login.__typename == "AuthSuccess") {
|
||||
localStorage.setItem("token", loginMutation.data.login.token);
|
||||
navigator("/services");
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import {
|
||||
} from "../../../generated/graphql";
|
||||
import { queryClient } from "../../../main";
|
||||
import { useFormik } from "formik";
|
||||
import Header1 from "../../atoms/Header1";
|
||||
|
||||
const ServicesPage = () => {
|
||||
const [toggleCreate, setToggleCreate] = useState(false);
|
||||
@ -89,8 +90,8 @@ const ServicesPage = () => {
|
||||
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<Container className="px-2">
|
||||
<h1 className="text-3xl font-bold mt-12 mb-8">Services</h1>
|
||||
<Container>
|
||||
<Header1>Services</Header1>
|
||||
<div className="mb-4 flex items-end justify-between">
|
||||
<TextField
|
||||
label="Search"
|
||||
|
@ -1,5 +1,6 @@
|
||||
mutation Login($credentials: LoginInput!) {
|
||||
login(body: $credentials) {
|
||||
__typename
|
||||
... on AuthSuccess {
|
||||
user {
|
||||
name
|
||||
|
Reference in New Issue
Block a user