@momo-kits/title 0.167.2-beta.1 → 0.168.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.tsx +10 -17
- package/package.json +1 -1
package/index.tsx
CHANGED
|
@@ -79,11 +79,12 @@ const Title: FC<TitleProps> = ({
|
|
|
79
79
|
const titleFontFamily = exportFontFamily('bold');
|
|
80
80
|
const isSection = type === 'section';
|
|
81
81
|
const numberOfLines = showTrailingAction || !!badgeLabel ? 1 : 2;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
let buttonTypo: Typography = 'action_s_bold';
|
|
83
|
+
if (buttonSize === 'small') {
|
|
84
|
+
buttonTypo = 'action_xs_bold';
|
|
85
|
+
}
|
|
86
|
+
const trailingFlexStyle: ViewStyle = { width: '70%' };
|
|
87
|
+
const flexStyle = showTrailingAction ? trailingFlexStyle : undefined;
|
|
87
88
|
const componentName = 'Title';
|
|
88
89
|
|
|
89
90
|
const app = useContext<any>(MiniAppContext);
|
|
@@ -123,6 +124,7 @@ const Title: FC<TitleProps> = ({
|
|
|
123
124
|
};
|
|
124
125
|
|
|
125
126
|
const renderContent = () => {
|
|
127
|
+
const maxWidth = contentWidth > 0 ? contentWidth - badgeWidth : undefined;
|
|
126
128
|
return (
|
|
127
129
|
<View style={styles.contentView}>
|
|
128
130
|
<View
|
|
@@ -141,10 +143,7 @@ const Title: FC<TitleProps> = ({
|
|
|
141
143
|
styleSheet[typography],
|
|
142
144
|
{ fontFamily: titleFontFamily },
|
|
143
145
|
styles.title,
|
|
144
|
-
{
|
|
145
|
-
maxWidth:
|
|
146
|
-
contentWidth > 0 ? contentWidth - badgeWidth : undefined,
|
|
147
|
-
},
|
|
146
|
+
{ maxWidth },
|
|
148
147
|
]}
|
|
149
148
|
>
|
|
150
149
|
{title}
|
|
@@ -184,6 +183,7 @@ const Title: FC<TitleProps> = ({
|
|
|
184
183
|
};
|
|
185
184
|
|
|
186
185
|
const renderActionLeft = () => {
|
|
186
|
+
const trailingBackground = Colors.black_06 + (isSection ? '99' : '4D');
|
|
187
187
|
return (
|
|
188
188
|
<TouchableOpacity
|
|
189
189
|
accessibilityLabel={componentId + '|trailing-touch'}
|
|
@@ -193,14 +193,7 @@ const Title: FC<TitleProps> = ({
|
|
|
193
193
|
>
|
|
194
194
|
{showTrailingAction && !showRightAction && (
|
|
195
195
|
<View
|
|
196
|
-
style={[
|
|
197
|
-
styles.iconLeft,
|
|
198
|
-
{
|
|
199
|
-
backgroundColor: isSection
|
|
200
|
-
? Colors.black_06 + '99'
|
|
201
|
-
: Colors.black_06 + '4D',
|
|
202
|
-
},
|
|
203
|
-
]}
|
|
196
|
+
style={[styles.iconLeft, { backgroundColor: trailingBackground }]}
|
|
204
197
|
>
|
|
205
198
|
<Icon
|
|
206
199
|
source={'arrow_chevron_right_small'}
|