feat: enhance Newsletter component with props
This commit is contained in:
commit
16a6a14d67
@ -4,7 +4,7 @@ import { APP } from '~/configs/meta'
|
||||
|
||||
export const Banner = () => {
|
||||
return (
|
||||
<div className="min-h-[65px] sm:mx-10">
|
||||
<div className="min-h-[65px] lg:mx-10">
|
||||
<div className="relative">
|
||||
<Link
|
||||
to="/#"
|
||||
@ -13,7 +13,7 @@ export const Banner = () => {
|
||||
<img
|
||||
src={'/images/banner.png'}
|
||||
alt={APP.title}
|
||||
className="h-[70px] w-[100%] sm:h-full"
|
||||
className="h-[70px] w-[100%] content-center sm:h-full"
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@ -1,37 +1,57 @@
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
import { Button } from '~/components/ui/button'
|
||||
|
||||
export const Newsletter = () => {
|
||||
return (
|
||||
<div className="flex h-[300px] w-full flex-col md:flex-row">
|
||||
<div className="flex w-full flex-col justify-center gap-5 bg-[#2E2F7C] px-6 py-5 text-white sm:px-30 md:w-[50%]">
|
||||
<h2 className="text-2xl font-bold sm:text-4xl">Join Our Newsletter</h2>
|
||||
<p className="text:md sm:text-lg">
|
||||
Tidak ingin ketinggalan Berita Hukum terhangat? Ingin mendapat
|
||||
informasi kajian dan networking terbaru? Ikuti Newsletter kami dan
|
||||
Stay up to Speed!
|
||||
</p>
|
||||
</div>
|
||||
type NewsletterProperties = {
|
||||
className?: string
|
||||
title?: string
|
||||
description?: string
|
||||
textButton?: string
|
||||
onClick?: () => void
|
||||
}
|
||||
export const Newsletter = (property: NewsletterProperties) => {
|
||||
const { className, title, description } = property
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
<div
|
||||
className="flex flex-col justify-center bg-cover bg-center px-20 py-5 sm:w-full md:w-[50%]"
|
||||
style={{
|
||||
backgroundImage: "url('https://placehold.co/400x300.png')",
|
||||
}}
|
||||
className={`absolute flex h-[400px] w-screen flex-col sm:h-[300px] md:flex-row ${twMerge('', className)}`}
|
||||
>
|
||||
<form className="grid gap-5">
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Daftarkan Email Disini"
|
||||
className="w-full rounded-md border border-gray-300 bg-white p-4 text-sm focus:outline-none"
|
||||
/>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="newsPrimary"
|
||||
size="block"
|
||||
>
|
||||
Subscribe
|
||||
</Button>
|
||||
</form>
|
||||
<div className="flex h-1/2 w-full flex-col justify-center gap-5 bg-[#2E2F7C] px-6 py-5 text-white sm:h-full sm:w-[50%] sm:px-30">
|
||||
<h2 className="text-2xl font-bold sm:text-4xl">
|
||||
{title ? `${title}` : 'Join Our Newsletter'}
|
||||
</h2>
|
||||
<p className="text:md sm:text-lg">
|
||||
{description
|
||||
? `${description}`
|
||||
: `Tidak ingin ketinggalan Berita Hukum terhangat?
|
||||
Ingin mendapat informasi kajian dan networking terbaru?
|
||||
Ikuti Newsletter kami dan Stay up to Speed!`}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
backgroundImage: "url('/images/bg-newsletter.png')",
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
}}
|
||||
className="flex h-1/2 w-full flex-col items-center justify-center text-center sm:h-full sm:w-[50%]"
|
||||
>
|
||||
<form className="grid w-[50%] gap-5">
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Daftarkan Email Disini"
|
||||
className="w-full rounded-md border border-gray-300 bg-white p-4 text-sm focus:outline-none"
|
||||
/>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="newsPrimary"
|
||||
size="block"
|
||||
>
|
||||
Subscribe
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import { Field, Input, Label, Select } from '@headlessui/react'
|
||||
import DT from 'datatables.net-dt'
|
||||
import DataTable from 'datatables.net-react'
|
||||
|
||||
import { SearchIcon } from '~/components/icons/search'
|
||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||
|
||||
import { CONTENTS } from './data'
|
||||
@ -34,6 +36,34 @@ 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>
|
||||
</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>
|
||||
</div>
|
||||
<div className="rounded-lg bg-white p-6 shadow-md">
|
||||
<h3 className="py-1 font-semibold text-[#4C5CA0]">Daftar Content</h3>
|
||||
<DataTable
|
||||
|
||||
@ -44,7 +44,7 @@ export const SubscriptionsPage = () => {
|
||||
},
|
||||
]
|
||||
|
||||
const switchViee = () => {
|
||||
const switchView = () => {
|
||||
setSubscribtionOpen(!SubscribtionOpen)
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ export const SubscriptionsPage = () => {
|
||||
<TitleDashboard title="Subscription" />
|
||||
<Button
|
||||
className="float-right mt-7 h-10 w-[160px] rounded-md"
|
||||
onClick={switchViee}
|
||||
onClick={switchView}
|
||||
>
|
||||
{SubscribtionOpen ? 'Subscriptions' : 'Save'}
|
||||
</Button>
|
||||
|
||||
@ -10,7 +10,9 @@ export const NewsPage = () => {
|
||||
<Card>
|
||||
<Carousel {...SPOTLIGHT} />
|
||||
</Card>
|
||||
<Newsletter />
|
||||
<div className="min-h-[400px] sm:min-h-[300px]">
|
||||
<Newsletter className="mr-0 lg:-ml-14" />
|
||||
</div>
|
||||
<Card>
|
||||
<Carousel {...BERITA} />
|
||||
</Card>
|
||||
|
||||
BIN
public/images/bg-newsletter.png
Normal file
BIN
public/images/bg-newsletter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 MiB |
Loading…
x
Reference in New Issue
Block a user