feat: restructure ads mgmt by creating a new layout for ads creation and updating related schemas
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
import Autoplay from 'embla-carousel-autoplay'
|
||||
import useEmblaCarousel from 'embla-carousel-react'
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import { BANNER } from '~/data/contents'
|
||||
|
||||
export const Banner = () => {
|
||||
const [emblaReference] = useEmblaCarousel({ loop: true }, [Autoplay()])
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div className="relative">
|
||||
<div
|
||||
className="embla overflow-hidden"
|
||||
ref={emblaReference}
|
||||
>
|
||||
<div className="embla__container flex">
|
||||
{BANNER.map(({ urlImage, alt, link }, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="embla__slide max-h-[100px] min-h-[65px] w-full min-w-0 flex-none"
|
||||
>
|
||||
<Link
|
||||
to={link}
|
||||
className="mt-2 h-full py-2"
|
||||
>
|
||||
<img
|
||||
src={urlImage}
|
||||
alt={alt}
|
||||
className="h-[70px] w-[100%] content-center sm:h-full"
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -25,6 +25,7 @@ type TInputProperties<T extends FieldValues> = Omit<
|
||||
rules?: RegisterOptions
|
||||
containerClassName?: string
|
||||
labelClassName?: string
|
||||
category?: string
|
||||
}
|
||||
|
||||
export const InputFile = <TFormValues extends Record<string, unknown>>(
|
||||
@@ -40,6 +41,7 @@ export const InputFile = <TFormValues extends Record<string, unknown>>(
|
||||
className,
|
||||
containerClassName,
|
||||
labelClassName,
|
||||
category,
|
||||
...restProperties
|
||||
} = properties
|
||||
const { setIsUploadOpen, uploadedFile, setUploadedFile, isUploadOpen } =
|
||||
@@ -86,7 +88,7 @@ export const InputFile = <TFormValues extends Record<string, unknown>>(
|
||||
size="fit"
|
||||
className="absolute right-3 h-[42px]"
|
||||
onClick={() => {
|
||||
setIsUploadOpen(name as TUpload)
|
||||
setIsUploadOpen((category || name) as TUpload)
|
||||
}}
|
||||
>
|
||||
<CloudArrowUpIcon className="h-4 w-4 text-gray-500/50" />
|
||||
|
||||
Reference in New Issue
Block a user