mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-18 22:02:30 +00:00
fix indexing causing main thread freeze, various polish
This commit is contained in:
parent
e0ebee5aa9
commit
ab9da02c60
33 changed files with 255 additions and 141 deletions
quartz/components
20
quartz/components/DesktopOnly.tsx
Normal file
20
quartz/components/DesktopOnly.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
|
||||
export default ((component?: QuartzComponent) => {
|
||||
if (component) {
|
||||
const Component = component
|
||||
function DesktopOnly(props: QuartzComponentProps) {
|
||||
return <div class="desktop-only">
|
||||
<Component {...props} />
|
||||
</div>
|
||||
}
|
||||
|
||||
DesktopOnly.displayName = component.displayName
|
||||
DesktopOnly.afterDOMLoaded = component?.afterDOMLoaded
|
||||
DesktopOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
||||
DesktopOnly.css = component?.css
|
||||
return DesktopOnly
|
||||
} else {
|
||||
return () => <></>
|
||||
}
|
||||
}) satisfies QuartzComponentConstructor
|
Loading…
Add table
Add a link
Reference in a new issue