mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 15:47:08 +00:00
Switch to vite and preact
This commit is contained in:
16
src/app/components/Ad.tsx
Normal file
16
src/app/components/Ad.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useEffect } from 'preact/hooks'
|
||||
|
||||
declare const ethicalads: any
|
||||
|
||||
type AdProps = {
|
||||
type: 'text' | 'image',
|
||||
id: string,
|
||||
}
|
||||
export function Ad({ type, id }: AdProps) {
|
||||
useEffect(() => {
|
||||
document.getElementById('ad-placeholder')?.remove()
|
||||
ethicalads?.load()
|
||||
}, [])
|
||||
|
||||
return <div data-ea-publisher="misode-github-io" data-ea-type={type} class="ad dark flat" id={id}></div>
|
||||
}
|
||||
Reference in New Issue
Block a user