mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-24 04:26:22 +00:00
21c6bbf302
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
18 lines
647 B
TypeScript
18 lines
647 B
TypeScript
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
|
|
export default ((component?: QuartzComponent) => {
|
|
if (component) {
|
|
const Component = component
|
|
const MobileOnly: QuartzComponent = (props: QuartzComponentProps) => {
|
|
return <Component displayClass="mobile-only" {...props} />
|
|
}
|
|
|
|
MobileOnly.displayName = component.displayName
|
|
MobileOnly.afterDOMLoaded = component?.afterDOMLoaded
|
|
MobileOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
|
MobileOnly.css = component?.css
|
|
return MobileOnly
|
|
} else {
|
|
return () => <></>
|
|
}
|
|
}) satisfies QuartzComponentConstructor
|