Compare commits
No commits in common. "aca894729e47280919b626773c06377b41eb47d0" and "1758b7837ed37acab832f1137680fdff630d23c5" have entirely different histories.
aca894729e
...
1758b7837e
@ -3,7 +3,6 @@ import { useState } from 'react'
|
|||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
|
|
||||||
import { PlusIcon } from '~/components/icons/plus'
|
import { PlusIcon } from '~/components/icons/plus'
|
||||||
import { Button } from '~/components/ui/button'
|
|
||||||
import { UiTable } from '~/components/ui/table'
|
import { UiTable } from '~/components/ui/table'
|
||||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||||
import { BANNER } from '~/data/contents'
|
import { BANNER } from '~/data/contents'
|
||||||
@ -20,7 +19,6 @@ export const AdvertisementsPage = ({
|
|||||||
}: BannerUploadProperties) => {
|
}: BannerUploadProperties) => {
|
||||||
const [banner, setBanner] = useState<File | null>()
|
const [banner, setBanner] = useState<File | null>()
|
||||||
const [link, setLink] = useState<string>('')
|
const [link, setLink] = useState<string>('')
|
||||||
const [listAdvertisement, setListAdvertisement] = useState(true)
|
|
||||||
|
|
||||||
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const file = event.target.files?.[0] || undefined
|
const file = event.target.files?.[0] || undefined
|
||||||
@ -74,14 +72,9 @@ export const AdvertisementsPage = ({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const switchView = () => {
|
|
||||||
setListAdvertisement(!listAdvertisement)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<TitleDashboard title="Advertisement" />
|
<TitleDashboard title="Advertisement" />
|
||||||
{listAdvertisement && (
|
|
||||||
<div className="flex gap-5">
|
<div className="flex gap-5">
|
||||||
<div className="w-[400px] rounded-xl bg-gray-50 py-6">
|
<div className="w-[400px] rounded-xl bg-gray-50 py-6">
|
||||||
<Field className="mb-6">
|
<Field className="mb-6">
|
||||||
@ -132,24 +125,13 @@ export const AdvertisementsPage = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button
|
|
||||||
size="lg"
|
|
||||||
className="mt-6 ml-auto flex-none rounded"
|
|
||||||
onClick={switchView}
|
|
||||||
>
|
|
||||||
List Advertisement
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{!listAdvertisement && (
|
|
||||||
<UiTable
|
<UiTable
|
||||||
data={dataBanner}
|
data={dataBanner}
|
||||||
columns={dataColumns}
|
columns={dataColumns}
|
||||||
slots={dataSlot}
|
slots={dataSlot}
|
||||||
title="Daftar Banner"
|
title="Daftar Banner"
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,6 +52,7 @@ export const ContentsPage = () => {
|
|||||||
searching: true,
|
searching: true,
|
||||||
ordering: true,
|
ordering: true,
|
||||||
info: true,
|
info: true,
|
||||||
|
// scrollY: '50vh',
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user