|
|
@@ -18,9 +18,11 @@ import {
|
|
|
EnUsIcon,
|
|
|
TRTRIcon
|
|
|
} from "../../assets/svg";
|
|
|
+import HighlightButton from "../highlightButton";
|
|
|
|
|
|
const PaletteSwitcher: FC<ILocaleSwitcherProps> = ({
|
|
|
variants: variantsProps = [],
|
|
|
+ isWorkWithHighlightButton,
|
|
|
isWorkWithNextShowSystem,
|
|
|
customLocalize,
|
|
|
color,
|
|
|
@@ -99,21 +101,22 @@ const PaletteSwitcher: FC<ILocaleSwitcherProps> = ({
|
|
|
|
|
|
const currentVariant = variants[isWorkWithNextShowSystem ? viewVariantIndex : currentVariantIndex];
|
|
|
|
|
|
- return <Button
|
|
|
- {...props}
|
|
|
- customBorderColor={currentVariant && currentVariant.borderColor ?
|
|
|
+ const allProps = {
|
|
|
+ ...props,
|
|
|
+ customBorderColor: currentVariant && currentVariant.borderColor ?
|
|
|
currentVariant.borderColor
|
|
|
:
|
|
|
- color
|
|
|
- }
|
|
|
- customColor={currentVariant && currentVariant.backgroundColor ?
|
|
|
+ color,
|
|
|
+ customColor: currentVariant && currentVariant.backgroundColor ?
|
|
|
currentVariant.backgroundColor
|
|
|
:
|
|
|
- color
|
|
|
- }
|
|
|
- icon={({
|
|
|
+ color,
|
|
|
+ icon: ({
|
|
|
color,
|
|
|
size
|
|
|
+ }: {
|
|
|
+ color: keyof NCoreUIKit.IconContentColors;
|
|
|
+ size: number;
|
|
|
}) => {
|
|
|
const Icon = currentVariant?.icon as NCoreUIKitIcon;
|
|
|
|
|
|
@@ -122,15 +125,25 @@ const PaletteSwitcher: FC<ILocaleSwitcherProps> = ({
|
|
|
color={color}
|
|
|
size={size}
|
|
|
/>;
|
|
|
- }}
|
|
|
- onPress={() => {
|
|
|
+ },
|
|
|
+ onPress: () => {
|
|
|
NCoreUIKitLocalize.switch({
|
|
|
localeKey: localeKeys[viewVariantIndex] as keyof NCoreUIKit.LocaleKey
|
|
|
});
|
|
|
- }}
|
|
|
- style={[
|
|
|
+ },
|
|
|
+ style: [
|
|
|
style
|
|
|
- ]}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ if(isWorkWithHighlightButton) {
|
|
|
+ return <HighlightButton
|
|
|
+ {...allProps}
|
|
|
+ />;
|
|
|
+ }
|
|
|
+
|
|
|
+ return <Button
|
|
|
+ {...allProps}
|
|
|
/>;
|
|
|
};
|
|
|
export default PaletteSwitcher;
|