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 { HttpServer } from '~/libs/http-server'
|
||||
import type { TLoginSchema } from '~/pages/admin-login'
|
||||
import type { TLoginSchema } from '~/pages/staff-login'
|
||||
|
||||
const loginResponseSchema = z.object({
|
||||
data: z.object({
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Field, Input, Label, Select } from '@headlessui/react'
|
||||
import DT from 'datatables.net-dt'
|
||||
import DataTable from 'datatables.net-react'
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import { SearchIcon } from '~/components/icons/search'
|
||||
import { Button } from '~/components/ui/button'
|
||||
@ -57,33 +58,45 @@ export const ContentsPage = () => {
|
||||
return (
|
||||
<div className="relative">
|
||||
<TitleDashboard title="Konten" />
|
||||
<div className="mb-8 flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||
<div className="w-[400px]">
|
||||
<Field>
|
||||
<Label className="mb-2 block text-sm font-medium">Cari User</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Cari Nama"
|
||||
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 className="mb-8 flex items-end justify-between">
|
||||
<div className="flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||
<div className="w-[400px]">
|
||||
<Field>
|
||||
<Label className="mb-2 block text-sm font-medium">
|
||||
Cari User
|
||||
</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Cari Nama"
|
||||
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>
|
||||
</Field>
|
||||
</div>
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
<div className="w-[235px]">
|
||||
<Field>
|
||||
<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">
|
||||
<option>Pilih Status</option>
|
||||
<option>Aktif</option>
|
||||
<option>Nonaktif</option>
|
||||
</Select>
|
||||
</Field>
|
||||
<div className="w-[235px]">
|
||||
<Field>
|
||||
<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">
|
||||
<option>Pilih Status</option>
|
||||
<option>Aktif</option>
|
||||
<option>Nonaktif</option>
|
||||
</Select>
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
as={Link}
|
||||
to="/lg-admin/contents/create"
|
||||
className="text-md rounded-md"
|
||||
size="lg"
|
||||
>
|
||||
Create New
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<UiTable
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { AdminLoginPage } from '~/pages/admin-login'
|
||||
import { AdminLoginPage } from '~/pages/staff-login'
|
||||
|
||||
const AuthLayout = () => <AdminLoginPage />
|
||||
export default AuthLayout
|
||||
|
||||
@ -5,7 +5,7 @@ import { XiorError } from 'xior'
|
||||
|
||||
import { getStaff } from '~/apis/admin/get-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 type { Route } from './+types/actions.login'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user