mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
21 lines
647 B
TypeScript
21 lines
647 B
TypeScript
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||
|
|
||
|
export default ((component?: QuartzComponent) => {
|
||
|
if (component) {
|
||
|
const Component = component
|
||
|
function MobileOnly(props: QuartzComponentProps) {
|
||
|
return <div class="mobile-only">
|
||
|
<Component {...props} />
|
||
|
</div>
|
||
|
}
|
||
|
|
||
|
MobileOnly.displayName = component.displayName
|
||
|
MobileOnly.afterDOMLoaded = component?.afterDOMLoaded
|
||
|
MobileOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
||
|
MobileOnly.css = component?.css
|
||
|
return MobileOnly
|
||
|
} else {
|
||
|
return () => <></>
|
||
|
}
|
||
|
}) satisfies QuartzComponentConstructor
|