mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
prettier
This commit is contained in:
parent
7ad5c16495
commit
692815dd8d
@ -2,22 +2,17 @@ import { concatenateResources } from "../util/resources"
|
|||||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||||
|
|
||||||
interface GroupConfig {
|
interface GroupConfig {
|
||||||
components: QuartzComponent[]
|
components: QuartzComponent[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ((config: GroupConfig) => {
|
export default ((config: GroupConfig) => {
|
||||||
const Group: QuartzComponent = (props: QuartzComponentProps) =>
|
const Group: QuartzComponent = (props: QuartzComponentProps) =>
|
||||||
config.components
|
config.components
|
||||||
.map((c: QuartzComponent) => ({ component: c }))
|
.map((c: QuartzComponent) => ({ component: c }))
|
||||||
.map((it: { component: QuartzComponent} ) => (<it.component {...props} />))
|
.map((it: { component: QuartzComponent }) => <it.component {...props} />)
|
||||||
|
|
||||||
|
Group.afterDOMLoaded = concatenateResources(...config.components.map((c) => c.afterDOMLoaded))
|
||||||
Group.afterDOMLoaded = concatenateResources(
|
Group.beforeDOMLoaded = concatenateResources(...config.components.map((c) => c.beforeDOMLoaded))
|
||||||
...config.components.map((c) => c.afterDOMLoaded),
|
Group.css = concatenateResources(...config.components.map((c) => c.css))
|
||||||
)
|
return Group
|
||||||
Group.beforeDOMLoaded = concatenateResources(
|
}) satisfies QuartzComponentConstructor<GroupConfig>
|
||||||
...config.components.map((c) => c.beforeDOMLoaded),
|
|
||||||
)
|
|
||||||
Group.css = concatenateResources(...config.components.map((c) => c.css))
|
|
||||||
return Group
|
|
||||||
}) satisfies QuartzComponentConstructor<GroupConfig>
|
|
||||||
|
|||||||
@ -51,5 +51,5 @@ export {
|
|||||||
Comments,
|
Comments,
|
||||||
Flex,
|
Flex,
|
||||||
ConditionalRender,
|
ConditionalRender,
|
||||||
Group
|
Group,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user