mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 06:24:22 +02:00
Use classNames util function
This commit is contained in:
parent
2e1f7df7e6
commit
f39e1345b3
@ -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) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user