Compare commits
No commits in common. "1758b7837ed37acab832f1137680fdff630d23c5" and "8aeb7a3197d5d20ee5bc7816efb39345c83ed4a6" have entirely different histories.
1758b7837e
...
8aeb7a3197
@ -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/staff-login'
|
import type { TLoginSchema } from '~/pages/admin-login'
|
||||||
|
|
||||||
const loginResponseSchema = z.object({
|
const loginResponseSchema = z.object({
|
||||||
data: z.object({
|
data: z.object({
|
||||||
|
|||||||
@ -96,14 +96,14 @@ export const Combobox = <TFormValues extends Record<string, unknown>>(
|
|||||||
'bg-white transition duration-100 ease-in data-[leave]:data-[closed]:opacity-0',
|
'bg-white transition duration-100 ease-in data-[leave]:data-[closed]:opacity-0',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{filteredOptions?.map((option) => (
|
{filteredOptions?.map((person) => (
|
||||||
<ComboboxOption
|
<ComboboxOption
|
||||||
key={option.id}
|
key={person.id}
|
||||||
value={option}
|
value={person}
|
||||||
className="group flex cursor-default items-center gap-2 rounded-lg px-3 py-1.5 select-none data-[focus]:bg-white/10"
|
className="group flex cursor-default items-center gap-2 rounded-lg px-3 py-1.5 select-none data-[focus]:bg-white/10"
|
||||||
>
|
>
|
||||||
<CheckIcon className="invisible size-4 group-data-[selected]:visible" />
|
<CheckIcon className="invisible size-4 group-data-[selected]:visible" />
|
||||||
<div className="text-sm/6">{option.name}</div>
|
<div className="text-sm/6">{person.name}</div>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
))}
|
))}
|
||||||
</ComboboxOptions>
|
</ComboboxOptions>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
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'
|
||||||
@ -58,45 +57,33 @@ export const ContentsPage = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<TitleDashboard title="Konten" />
|
<TitleDashboard title="Konten" />
|
||||||
<div className="mb-8 flex items-end justify-between">
|
<div className="mb-8 flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||||
<div className="flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<div className="w-[400px]">
|
||||||
<div className="w-[400px]">
|
<Field>
|
||||||
<Field>
|
<Label className="mb-2 block text-sm font-medium">Cari User</Label>
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
<div className="relative">
|
||||||
Cari User
|
<Input
|
||||||
</Label>
|
type="text"
|
||||||
<div className="relative">
|
placeholder="Cari Nama"
|
||||||
<Input
|
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||||
type="text"
|
/>
|
||||||
placeholder="Cari Nama"
|
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
||||||
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
<SearchIcon className="h-5 w-5" />
|
||||||
/>
|
|
||||||
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
|
||||||
<SearchIcon className="h-5 w-5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Field>
|
</div>
|
||||||
</div>
|
</Field>
|
||||||
|
</div>
|
||||||
<div className="w-[235px]">
|
|
||||||
<Field>
|
<div className="w-[235px]">
|
||||||
<Label className="mb-2 block text-sm font-medium">Status</Label>
|
<Field>
|
||||||
<Select className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none">
|
<Label className="mb-2 block text-sm font-medium">Status</Label>
|
||||||
<option>Pilih Status</option>
|
<Select className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none">
|
||||||
<option>Aktif</option>
|
<option>Pilih Status</option>
|
||||||
<option>Nonaktif</option>
|
<option>Aktif</option>
|
||||||
</Select>
|
<option>Nonaktif</option>
|
||||||
</Field>
|
</Select>
|
||||||
</div>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
|
||||||
as={Link}
|
|
||||||
to="/lg-admin/contents/create"
|
|
||||||
className="text-md rounded-md"
|
|
||||||
size="lg"
|
|
||||||
>
|
|
||||||
Create New
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
|
|||||||
@ -52,50 +52,44 @@ export const SubscriptionsPage = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<TitleDashboard title="Subscription" />
|
<TitleDashboard title="Subscription" />
|
||||||
|
<Button
|
||||||
|
className="float-right mt-7 h-10 w-[160px] rounded-md"
|
||||||
|
onClick={switchView}
|
||||||
|
>
|
||||||
|
{SubscribtionOpen ? 'Subscriptions' : 'Save'}
|
||||||
|
</Button>
|
||||||
|
|
||||||
{SubscribtionOpen && (
|
{SubscribtionOpen && (
|
||||||
<>
|
<>
|
||||||
<div className="mb-8 flex items-end justify-between">
|
<div className="mb-8 flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||||
<div className="flex items-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<div className="w-[400px]">
|
||||||
<div className="w-[400px]">
|
<Field>
|
||||||
<Field>
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
Cari User
|
||||||
Cari User
|
</Label>
|
||||||
</Label>
|
<div className="relative">
|
||||||
<div className="relative">
|
<Input
|
||||||
<Input
|
type="text"
|
||||||
type="text"
|
placeholder="Cari Nama"
|
||||||
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"
|
||||||
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">
|
||||||
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
<SearchIcon className="h-5 w-5" />
|
||||||
<SearchIcon className="h-5 w-5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Field>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<Button
|
<div className="w-[235px]">
|
||||||
className="rounded-md"
|
<Field>
|
||||||
size="lg"
|
<Label className="mb-2 block text-sm font-medium">Status</Label>
|
||||||
onClick={switchView}
|
<Select className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none">
|
||||||
>
|
<option>Pilih Status</option>
|
||||||
Subscription Settings
|
<option>Aktif</option>
|
||||||
</Button>
|
<option>Nonaktif</option>
|
||||||
|
</Select>
|
||||||
|
</Field>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
@ -114,57 +108,48 @@ export const SubscriptionsPage = () => {
|
|||||||
|
|
||||||
{!SubscribtionOpen && (
|
{!SubscribtionOpen && (
|
||||||
<>
|
<>
|
||||||
<div className="mb-8 flex items-end justify-between">
|
<div className="mb-8 flex items-end gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
||||||
<div className="flex items-end gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<div className="w-[300px]">
|
||||||
<div className="w-[300px]">
|
<Field>
|
||||||
<Field>
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
Subscription Name
|
||||||
Subscription Name
|
</Label>
|
||||||
</Label>
|
<div className="relative">
|
||||||
<div className="relative">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
placeholder="Subscription Name"
|
|
||||||
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Field>
|
|
||||||
</div>
|
|
||||||
<div className="w-[300px]">
|
|
||||||
<Field>
|
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
|
||||||
Subscription Price
|
|
||||||
</Label>
|
|
||||||
<div className="relative">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
placeholder="Subscription Price"
|
|
||||||
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="w-[300px]">
|
|
||||||
<Field>
|
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
|
||||||
Subscription Length (Days)
|
|
||||||
</Label>
|
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Subscription Length (Days)"
|
placeholder="Subscription Name"
|
||||||
className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||||
></Input>
|
/>
|
||||||
</Field>
|
</div>
|
||||||
</div>
|
</Field>
|
||||||
|
</div>
|
||||||
|
<div className="w-[300px]">
|
||||||
|
<Field>
|
||||||
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
|
Subscription Price
|
||||||
|
</Label>
|
||||||
|
<div className="relative">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Subscription Price"
|
||||||
|
className="w-full rounded-lg bg-white p-2 pr-10 pl-4 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="w-[300px]">
|
||||||
|
<Field>
|
||||||
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
|
Subscription Length (Days)
|
||||||
|
</Label>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Subscription Length (Days)"
|
||||||
|
className="w-full rounded-lg bg-white p-2 shadow focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||||
|
></Input>
|
||||||
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
|
||||||
className="rounded-md"
|
|
||||||
size="lg"
|
|
||||||
onClick={switchView}
|
|
||||||
>
|
|
||||||
Save
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { AdminLoginPage } from '~/pages/staff-login'
|
import { AdminLoginPage } from '~/pages/admin-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/staff-login'
|
import { loginSchema, type TLoginSchema } from '~/pages/admin-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