mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
use themeColor hook
This commit is contained in:
@@ -3,18 +3,14 @@ import OutsideClickHandler from 'react-outside-click-handler';
|
||||
import React from "react";
|
||||
import { BsmImage } from "./bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { DefaultConfigKey } from "renderer/config/default-configuration.config";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
|
||||
type BsmButtonType = "primary"|"success"|"cancel"|"error";
|
||||
|
||||
export function BsmButton({className, style, imgClassName, icon, image, text, type, active, withBar = true, disabled, onClickOutside, onClick, typeColor}: {className?: string, style?: React.CSSProperties, imgClassName?: string, icon?: BsmIconType, image?: string, text?: string, type?: string, active?: boolean, withBar?: boolean, disabled?: boolean, onClickOutside?: (e: MouseEvent) => void, onClick?: (e: React.MouseEvent) => void, typeColor?:BsmButtonType}) {
|
||||
|
||||
const configService = ConfigurationService.getInstance();
|
||||
|
||||
const t = useTranslation();
|
||||
const secondColor = useObservable(configService.watch("second-color" as DefaultConfigKey));
|
||||
const secondColor = useThemeColor("second-color");
|
||||
|
||||
return (
|
||||
<OutsideClickHandler onOutsideClick={e => onClickOutside && onClickOutside(e)}>
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { DefaultConfigKey } from "renderer/config/default-configuration.config";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
|
||||
export function TabNavBar(props: {tabsText: string[], onTabChange: Function, className?: string}) {
|
||||
|
||||
const configService = ConfigurationService.getInstance();
|
||||
|
||||
const [currentTabIndex, setCurrentTabIndex] = useState(0);
|
||||
const tabsWrapper = useRef(null);
|
||||
const [tabsWidth, setTabsWidth] = useState(0);
|
||||
const t = useTranslation();
|
||||
const secondColor = useObservable(configService.watch("second-color" as DefaultConfigKey));
|
||||
const secondColor = useThemeColor("second-color");
|
||||
|
||||
const selectYear = (tab: string) => {
|
||||
const newIndex = props.tabsText.indexOf(tab);
|
||||
|
||||
Reference in New Issue
Block a user