feat: remove unused FlashMessage component and banner data
This commit is contained in:
parent
634073342b
commit
0545190497
@ -1,37 +0,0 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
type FlashMessageProperties = {
|
||||
message: string
|
||||
type: 'success' | 'error' | 'info'
|
||||
}
|
||||
|
||||
export default function FlashMessage({
|
||||
message,
|
||||
type,
|
||||
}: FlashMessageProperties) {
|
||||
const [visible, setVisible] = useState<boolean>(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (message) {
|
||||
setVisible(true)
|
||||
const timer = setTimeout(() => setVisible(false), 3000)
|
||||
return () => clearTimeout(timer)
|
||||
}
|
||||
}, [message])
|
||||
|
||||
if (!visible) return
|
||||
|
||||
const messageStyles = {
|
||||
success: 'bg-green-100 text-green-800 border-green-300',
|
||||
error: 'bg-red-100 text-red-800 border-red-300',
|
||||
info: 'bg-blue-100 text-blue-800 border-blue-300',
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`fixed top-4 right-4 rounded-lg border p-4 shadow-lg ${messageStyles[type]}`}
|
||||
>
|
||||
{message}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
type TBanner = {
|
||||
id: number
|
||||
urlImage: string
|
||||
alt: string
|
||||
link: string
|
||||
status: 'active' | 'draft' | 'inactive'
|
||||
createdAt?: string
|
||||
}
|
||||
|
||||
export const BANNER: TBanner[] = [
|
||||
{
|
||||
id: 1,
|
||||
urlImage: '/images/banner.png',
|
||||
alt: 'banner',
|
||||
link: '/category/spotlight',
|
||||
status: 'active',
|
||||
createdAt: '2021-08-01',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
urlImage: 'https://placehold.co/1000x65.png',
|
||||
alt: 'banner',
|
||||
status: 'draft',
|
||||
link: '/#',
|
||||
createdAt: '2021-08-01',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
urlImage: 'https://placehold.co/1000x65.png',
|
||||
alt: 'banner',
|
||||
status: 'draft',
|
||||
link: '/#',
|
||||
createdAt: '2021-08-01',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
urlImage: '/images/banner.png',
|
||||
alt: 'banner',
|
||||
link: '/#',
|
||||
status: 'active',
|
||||
createdAt: '2021-08-01',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
urlImage: '/images/banner.png',
|
||||
alt: 'banner',
|
||||
link: '/#',
|
||||
status: 'inactive',
|
||||
createdAt: '2021-08-01',
|
||||
},
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user