Просмотр исходного кода

Bugfix: style prop added for Site Logo component.

lfabl 1 месяц назад
Родитель
Сommit
f9420fba7e
2 измененных файлов с 10 добавлено и 3 удалено
  1. 6 2
      src/components/siteLogo/index.tsx
  2. 4 1
      src/components/siteLogo/type.ts

+ 6 - 2
src/components/siteLogo/index.tsx

@@ -34,11 +34,13 @@ const SiteLogo = ({
     subTitleVariant,
     icon: IconProp,
     size = "large",
+    subTitleStyle,
     subTitleColor,
     titleVariant,
     imageSource,
     customTheme,
     borderColor,
+    titleStyle,
     imageSpace,
     isDisabled,
     titleColor,
@@ -196,7 +198,8 @@ const SiteLogo = ({
                 ellipsizeMode="tail"
                 numberOfLines={1}
                 style={{
-                    width: "100%"
+                    width: "100%",
+                    ...titleStyle
                 }}
             >
                 {title}
@@ -210,7 +213,8 @@ const SiteLogo = ({
                         ellipsizeMode="tail"
                         numberOfLines={1}
                         style={{
-                            width: "100%"
+                            width: "100%",
+                            ...subTitleStyle
                         }}
                     >
                         {subTitle}

+ 4 - 1
src/components/siteLogo/type.ts

@@ -5,7 +5,8 @@ import {
     type ImageURISource,
     type ImageProps,
     type StyleProp,
-    type ViewStyle
+    type ViewStyle,
+    type TextStyle
 } from "react-native";
 import type {
     NCoreUIKitIcon
@@ -74,9 +75,11 @@ interface ISiteLogoProps {
     isCustomImageSize?: boolean;
     isWorkWithAction?: boolean;
     isWorkWithFlex1?: boolean;
+    subTitleStyle?: TextStyle;
     imageProps?: ImageProps;
     size?: SiteLogoSizeType;
     isShowBorder?: boolean;
+    titleStyle?: TextStyle;
     icon?: NCoreUIKitIcon;
     isShowIcon?: boolean;
     isDisabled?: boolean;