Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Slot } from '@radix-ui/react-slot'
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
|
||||
import { subtitleVariants } from './variants'
|
||||
import { subtitleVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import { Children, ReactNode } from 'react'
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import { Children, ReactNode } from "react"
|
||||
|
||||
interface SubtitleProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'>,
|
||||
extends
|
||||
Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof subtitleVariants> {
|
||||
asChild?: boolean
|
||||
}
|
||||
@@ -16,7 +17,7 @@ interface SubtitleProps
|
||||
*/
|
||||
export default function Subtitle({
|
||||
asChild = false,
|
||||
className = '',
|
||||
className = "",
|
||||
color,
|
||||
textAlign,
|
||||
textTransform,
|
||||
@@ -26,7 +27,7 @@ export default function Subtitle({
|
||||
if (checkForEmptyChildren(props.children) === 0) {
|
||||
return null
|
||||
}
|
||||
const Comp = asChild ? Slot : 'p'
|
||||
const Comp = asChild ? Slot : "p"
|
||||
const classNames = subtitleVariants({
|
||||
className,
|
||||
color,
|
||||
@@ -39,7 +40,7 @@ export default function Subtitle({
|
||||
|
||||
function checkForEmptyChildren(children: ReactNode) {
|
||||
return Children.toArray(children).filter((child) => {
|
||||
if (child === '') {
|
||||
if (child === "") {
|
||||
return false
|
||||
} else if (child == null) {
|
||||
return false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from './subtitle.module.css'
|
||||
import styles from "./subtitle.module.css"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
@@ -32,10 +32,10 @@ const config = {
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
color: 'black',
|
||||
textAlign: 'left',
|
||||
textTransform: 'regular',
|
||||
type: 'one',
|
||||
color: "black",
|
||||
textAlign: "left",
|
||||
textTransform: "regular",
|
||||
type: "one",
|
||||
},
|
||||
} as const
|
||||
|
||||
|
||||
Reference in New Issue
Block a user