Compare commits

..

5 Commits

5 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@ import { FC, HTMLProps } from "react";
import clsx from "clsx"; import clsx from "clsx";
const styleClasses = { 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) => { const Container: FC<HTMLProps<HTMLDivElement>> = (props) => {

View File

@ -108,10 +108,10 @@ const Sidebar = () => {
</ul> </ul>
</nav> </nav>
</div> </div>
<div className="flex flex-shrink-0 py-4 px-5 justify-between items-center border-t border-gray-200"> <div className="flex flex-shrink-0 py-4 px-5 justify-between items-center border-t border-gray-200 space-x-4">
<div className="flex flex-row justify-center items-center space-x-4"> <SidebarTab onClick={navFactory("/me")}>
<p>admin</p> <span className="ml-3">admin</span>
</div> </SidebarTab>
<div className="w-6 h-6"> <div className="w-6 h-6">
<LogoutIcon <LogoutIcon
className="cursor-pointer" className="cursor-pointer"

View File

@ -1,6 +1,5 @@
import { useFormik } from "formik"; import { useFormik } from "formik";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { useLoginMutation } from "../../../generated/graphql"; import { useLoginMutation } from "../../../generated/graphql";
@ -23,12 +22,11 @@ const LoginPage = () => {
}); });
useEffect(() => { useEffect(() => {
if (!loginMutation.data) return; if (!loginMutation.data) {
if (Object.hasOwn(loginMutation.data.login, "message")) {
setSubmitError(loginMutation.data.login.message);
return; return;
} } else if (loginMutation.data.login.__typename == "CommonError") {
if (Object.hasOwn(loginMutation.data.login, "token")) { setSubmitError(loginMutation.data.login.message);
} else if (loginMutation.data.login.__typename == "AuthSuccess") {
localStorage.setItem("token", loginMutation.data.login.token); localStorage.setItem("token", loginMutation.data.login.token);
navigator("/services"); navigator("/services");
} }

View File

@ -14,6 +14,7 @@ import {
} from "../../../generated/graphql"; } from "../../../generated/graphql";
import { queryClient } from "../../../main"; import { queryClient } from "../../../main";
import { useFormik } from "formik"; import { useFormik } from "formik";
import Header1 from "../../atoms/Header1";
const ServicesPage = () => { const ServicesPage = () => {
const [toggleCreate, setToggleCreate] = useState(false); const [toggleCreate, setToggleCreate] = useState(false);
@ -89,8 +90,8 @@ const ServicesPage = () => {
return ( return (
<DashboardLayout> <DashboardLayout>
<Container className="px-2"> <Container>
<h1 className="text-3xl font-bold mt-12 mb-8">Services</h1> <Header1>Services</Header1>
<div className="mb-4 flex items-end justify-between"> <div className="mb-4 flex items-end justify-between">
<TextField <TextField
label="Search" label="Search"

View File

@ -1,5 +1,6 @@
mutation Login($credentials: LoginInput!) { mutation Login($credentials: LoginInput!) {
login(body: $credentials) { login(body: $credentials) {
__typename
... on AuthSuccess { ... on AuthSuccess {
user { user {
name name