mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
Merge 00fd86a3b7 into c99c8070f2
This commit is contained in:
commit
ce3f1afd2e
16
quartz/components/Group.tsx
Normal file
16
quartz/components/Group.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
import { concatenateResources } from "../util/resources"
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
|
||||
interface GroupConfig {
|
||||
components: QuartzComponent[]
|
||||
}
|
||||
|
||||
export default ((config: GroupConfig) => {
|
||||
const Group: QuartzComponent = (props: QuartzComponentProps) =>
|
||||
config.components.map((C: QuartzComponent) => <C {...props} />)
|
||||
|
||||
Group.afterDOMLoaded = concatenateResources(...config.components.map((c) => c.afterDOMLoaded))
|
||||
Group.beforeDOMLoaded = concatenateResources(...config.components.map((c) => c.beforeDOMLoaded))
|
||||
Group.css = concatenateResources(...config.components.map((c) => c.css))
|
||||
return Group
|
||||
}) satisfies QuartzComponentConstructor<GroupConfig>
|
||||
@ -23,6 +23,7 @@ import Breadcrumbs from "./Breadcrumbs"
|
||||
import Comments from "./Comments"
|
||||
import Flex from "./Flex"
|
||||
import ConditionalRender from "./ConditionalRender"
|
||||
import Group from "./Group"
|
||||
|
||||
export {
|
||||
ArticleTitle,
|
||||
@ -50,4 +51,5 @@ export {
|
||||
Comments,
|
||||
Flex,
|
||||
ConditionalRender,
|
||||
Group,
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user