Compare commits
3 Commits
8aeb7a3197
...
1758b7837e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1758b7837e | ||
|
|
dc794a29d3 | ||
|
|
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({
|
||||||
|
|||||||
@ -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((person) => (
|
{filteredOptions?.map((option) => (
|
||||||
<ComboboxOption
|
<ComboboxOption
|
||||||
key={person.id}
|
key={option.id}
|
||||||
value={person}
|
value={option}
|
||||||
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">{person.name}</div>
|
<div className="text-sm/6">{option.name}</div>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
))}
|
))}
|
||||||
</ComboboxOptions>
|
</ComboboxOptions>
|
||||||
|
|||||||
@ -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,10 +58,13 @@ 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="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">
|
||||||
|
Cari User
|
||||||
|
</Label>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
@ -85,6 +89,15 @@ export const ContentsPage = () => {
|
|||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
as={Link}
|
||||||
|
to="/lg-admin/contents/create"
|
||||||
|
className="text-md rounded-md"
|
||||||
|
size="lg"
|
||||||
|
>
|
||||||
|
Create New
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
data={dataTable}
|
data={dataTable}
|
||||||
|
|||||||
@ -52,16 +52,11 @@ 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-center gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<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]">
|
<div className="w-[400px]">
|
||||||
<Field>
|
<Field>
|
||||||
<Label className="mb-2 block text-sm font-medium">
|
<Label className="mb-2 block text-sm font-medium">
|
||||||
@ -82,7 +77,9 @@ export const SubscriptionsPage = () => {
|
|||||||
|
|
||||||
<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>
|
||||||
@ -92,6 +89,15 @@ export const SubscriptionsPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
className="rounded-md"
|
||||||
|
size="lg"
|
||||||
|
onClick={switchView}
|
||||||
|
>
|
||||||
|
Subscription Settings
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
data={SUBSCRIPTIONS}
|
data={SUBSCRIPTIONS}
|
||||||
columns={colTableSubscription}
|
columns={colTableSubscription}
|
||||||
@ -108,7 +114,8 @@ export const SubscriptionsPage = () => {
|
|||||||
|
|
||||||
{!SubscribtionOpen && (
|
{!SubscribtionOpen && (
|
||||||
<>
|
<>
|
||||||
<div className="mb-8 flex items-end gap-5 rounded-lg bg-gray-50 text-[#363636]">
|
<div className="mb-8 flex items-end justify-between">
|
||||||
|
<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">
|
||||||
@ -151,6 +158,14 @@ export const SubscriptionsPage = () => {
|
|||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
className="rounded-md"
|
||||||
|
size="lg"
|
||||||
|
onClick={switchView}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<UiTable
|
<UiTable
|
||||||
data={SUBSETTINGS}
|
data={SUBSETTINGS}
|
||||||
|
|||||||
@ -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