Use classNames util function

This commit is contained in:
Emile Bangma 2025-05-10 15:42:54 +00:00 committed by GitHub
parent 2e1f7df7e6
commit f39e1345b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { concatenateResources } from "../util/resources" import { concatenateResources } from "../util/resources"
import { classNames } from "../util/lang"
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
type FlexConfig = { type FlexConfig = {
@ -21,11 +22,10 @@ export default ((config: FlexConfig) => {
const direction = config.direction ?? "row" const direction = config.direction ?? "row"
const wrap = config.wrap ?? "nowrap" const wrap = config.wrap ?? "nowrap"
const gap = config.gap ?? "1rem" const gap = config.gap ?? "1rem"
const displayClass = `${props.displayClass ?? ""} flex-component`
return ( return (
<div <div
class={`${displayClass}`} class={classNames(props.displayClass, "flex-component")}
style={`flex-direction: ${direction}; flex-wrap: ${wrap}; gap: ${gap};`} style={`flex-direction: ${direction}; flex-wrap: ${wrap}; gap: ${gap};`}
> >
{config.components.map((c) => { {config.components.map((c) => {