feat: refactor login handling to use staff-login page and update related imports
This commit is contained in:
parent
8aeb7a3197
commit
6d8e352ffc
@ -1,7 +1,7 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
|
|
||||||
import { HttpServer } from '~/libs/http-server'
|
import { HttpServer } from '~/libs/http-server'
|
||||||
import type { TLoginSchema } from '~/pages/admin-login'
|
import type { TLoginSchema } from '~/pages/staff-login'
|
||||||
|
|
||||||
const loginResponseSchema = z.object({
|
const loginResponseSchema = z.object({
|
||||||
data: z.object({
|
data: z.object({
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { Field, Input, Label, Select } from '@headlessui/react'
|
import { Field, Input, Label, Select } from '@headlessui/react'
|
||||||
import DT from 'datatables.net-dt'
|
import DT from 'datatables.net-dt'
|
||||||
import DataTable from 'datatables.net-react'
|
import DataTable from 'datatables.net-react'
|
||||||
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
import { SearchIcon } from '~/components/icons/search'
|
import { SearchIcon } from '~/components/icons/search'
|
||||||
import { Button } from '~/components/ui/button'
|
import { Button } from '~/components/ui/button'
|
||||||
@ -57,33 +58,45 @@ export const ContentsPage = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<TitleDashboard title="Konten" />
|
<TitleDashboard title="Konten" />
|
||||||
<div className="mb-8 flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<div className="mb-8 flex items-end justify-between">
|
||||||
<div className="w-[400px]">
|
<div className="flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||||
<Field>
|
<div className="w-[400px]">
|
||||||
<Label className="mb-2 block text-sm font-medium">Cari User</Label>
|
<Field>
|
||||||
<div className="relative">
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
<Input
|
Cari User
|
||||||
type="text"
|
</Label>
|
||||||
placeholder="Cari Nama"
|
<div className="relative">
|
||||||
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
<Input
|
||||||
/>
|
type="text"
|
||||||
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
placeholder="Cari Nama"
|
||||||
<SearchIcon className="h-5 w-5" />
|
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||||
|
/>
|
||||||
|
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
||||||
|
<SearchIcon className="h-5 w-5" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Field>
|
||||||
</Field>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="w-[235px]">
|
<div className="w-[235px]">
|
||||||
<Field>
|
<Field>
|
||||||
<Label className="mb-2 block text-sm font-medium">Status</Label>
|
<Label className="mb-2 block text-sm font-medium">Status</Label>
|
||||||
<Select className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none">
|
<Select className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none">
|
||||||
<option>Pilih Status</option>
|
<option>Pilih Status</option>
|
||||||
<option>Aktif</option>
|
<option>Aktif</option>
|
||||||
<option>Nonaktif</option>
|
<option>Nonaktif</option>
|
||||||
</Select>
|
</Select>
|
||||||
</Field>
|
</Field>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
as={Link}
|
||||||
|
to="/lg-admin/contents/create"
|
||||||
|
className="text-md rounded-md"
|
||||||
|
size="lg"
|
||||||
|
>
|
||||||
|
Create New
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { AdminLoginPage } from '~/pages/admin-login'
|
import { AdminLoginPage } from '~/pages/staff-login'
|
||||||
|
|
||||||
const AuthLayout = () => <AdminLoginPage />
|
const AuthLayout = () => <AdminLoginPage />
|
||||||
export default AuthLayout
|
export default AuthLayout
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { XiorError } from 'xior'
|
|||||||
|
|
||||||
import { getStaff } from '~/apis/admin/get-staff'
|
import { getStaff } from '~/apis/admin/get-staff'
|
||||||
import { staffLoginRequest } from '~/apis/admin/login-staff'
|
import { staffLoginRequest } from '~/apis/admin/login-staff'
|
||||||
import { loginSchema, type TLoginSchema } from '~/pages/admin-login'
|
import { loginSchema, type TLoginSchema } from '~/pages/staff-login'
|
||||||
import { generateStaffTokenCookie } from '~/utils/token'
|
import { generateStaffTokenCookie } from '~/utils/token'
|
||||||
|
|
||||||
import type { Route } from './+types/actions.login'
|
import type { Route } from './+types/actions.login'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user