From 39b4a48fef2f2515dedb03c45231977220dd29ea Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:39:52 +0200 Subject: [PATCH] add secondary color type --- src/renderer/components/shared/bsm-button.component.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/shared/bsm-button.component.tsx b/src/renderer/components/shared/bsm-button.component.tsx index 957aee10..1598718d 100644 --- a/src/renderer/components/shared/bsm-button.component.tsx +++ b/src/renderer/components/shared/bsm-button.component.tsx @@ -6,7 +6,7 @@ import { useClickOutside } from "renderer/hooks/use-click-outside.hook"; import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; import { getCorrectTextColor } from "renderer/helpers/correct-text-color"; -type BsmButtonType = "primary"|"success"|"cancel"|"error"; +type BsmButtonType = "primary"|"secondary"|"success"|"cancel"|"error"; type Props = { className?: string, @@ -36,7 +36,7 @@ export function BsmButton({className, style, imgClassName, iconClassName, icon, const ref = useRef(null); useClickOutside(ref, onClickOutside); - const primaryColor = typeColor === "primary" && useThemeColor("first-color"); + const primaryColor = typeColor === "primary" ? useThemeColor("first-color") : typeColor === "secondary" ? secondColor : undefined; const textColor = (() => { if(primaryColor){ return getCorrectTextColor(primaryColor); } @@ -57,7 +57,7 @@ export function BsmButton({className, style, imgClassName, iconClassName, icon, return (