fix(SW-719): use utils inside components folder
This commit is contained in:
@@ -9,9 +9,9 @@ import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import {
|
||||
getBodyFontColor,
|
||||
getScriptFontColor,
|
||||
getTheme,
|
||||
getTitleFontColor,
|
||||
} from "../utils/cardFontColors"
|
||||
import { getTheme } from "../utils/cardTheme"
|
||||
} from "./utils"
|
||||
import { cardVariants } from "./variants"
|
||||
|
||||
import styles from "./card.module.css"
|
||||
|
||||
@@ -4,6 +4,7 @@ import { headingVariants } from "@/components/TempDesignSystem/Text/Title/varian
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { ButtonProps } from "@/components/TempDesignSystem/Button/button"
|
||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||
|
||||
export function getTitleFontColor(
|
||||
@@ -74,3 +75,22 @@ export function getBodyFontColor(
|
||||
return "baseText"
|
||||
}
|
||||
}
|
||||
|
||||
export function getTheme(theme: CardProps["theme"]): ButtonProps["theme"] {
|
||||
switch (theme) {
|
||||
case "two":
|
||||
return "secondaryLight"
|
||||
case "three":
|
||||
return "tertiaryLight"
|
||||
case "primaryDark":
|
||||
return "primaryDark"
|
||||
case "primaryStrong":
|
||||
case "image":
|
||||
return "primaryStrong"
|
||||
case "one":
|
||||
case "primaryDim":
|
||||
case "primaryInverted":
|
||||
default:
|
||||
return "primaryLight"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { ButtonProps } from "@/components/TempDesignSystem/Button/button"
|
||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||
|
||||
export function getTheme(theme: CardProps["theme"]): ButtonProps["theme"] {
|
||||
switch (theme) {
|
||||
case "two":
|
||||
return "secondaryLight"
|
||||
case "three":
|
||||
return "tertiaryLight"
|
||||
case "primaryDark":
|
||||
return "primaryDark"
|
||||
case "primaryStrong":
|
||||
case "image":
|
||||
return "primaryStrong"
|
||||
case "one":
|
||||
case "primaryDim":
|
||||
case "primaryInverted":
|
||||
default:
|
||||
return "primaryLight"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user