@momo-kits/collapse 0.81.16 → 0.81.18
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 +8 -2
- package/package.json +2 -2
- package/types.ts +3 -0
package/index.tsx
CHANGED
|
@@ -39,6 +39,7 @@ const Collapse: FC<CollapseProps> = ({
|
|
|
39
39
|
scrollContentMaxHeight = 240,
|
|
40
40
|
titleSize = 'medium',
|
|
41
41
|
useBackgroundCollapseButton = false,
|
|
42
|
+
headerAlign = 'flex-start',
|
|
42
43
|
}) => {
|
|
43
44
|
const {theme} = useContext(ApplicationContext);
|
|
44
45
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -138,6 +139,9 @@ const Collapse: FC<CollapseProps> = ({
|
|
|
138
139
|
borderWidth,
|
|
139
140
|
},
|
|
140
141
|
expanded && radiusStyle,
|
|
142
|
+
{
|
|
143
|
+
alignItems: headerAlign,
|
|
144
|
+
},
|
|
141
145
|
]}>
|
|
142
146
|
{!!image && (
|
|
143
147
|
<Image
|
|
@@ -145,7 +149,7 @@ const Collapse: FC<CollapseProps> = ({
|
|
|
145
149
|
style={[styles.image, {width: imageSize, height: imageSize}]}
|
|
146
150
|
/>
|
|
147
151
|
)}
|
|
148
|
-
<View style={styles.headerContent}>
|
|
152
|
+
<View style={[styles.headerContent]}>
|
|
149
153
|
<View style={styles.flex2}>
|
|
150
154
|
<RNText
|
|
151
155
|
numberOfLines={1}
|
|
@@ -164,7 +168,9 @@ const Collapse: FC<CollapseProps> = ({
|
|
|
164
168
|
</Text>
|
|
165
169
|
)}
|
|
166
170
|
</View>
|
|
167
|
-
<View style={styles.infoWrap
|
|
171
|
+
<View style={[styles.infoWrap, {justifyContent: headerAlign}]}>
|
|
172
|
+
{renderInfo()}
|
|
173
|
+
</View>
|
|
168
174
|
</View>
|
|
169
175
|
{renderCollapseIcon()}
|
|
170
176
|
</TouchableOpacity>
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {TagProps} from '@momo-kits/foundation';
|
|
2
|
+
import {FlexAlignType} from 'react-native';
|
|
2
3
|
|
|
3
4
|
export type CollapseImageSize = 24 | 32 | 40;
|
|
4
5
|
|
|
@@ -45,4 +46,6 @@ export type CollapseProps = {
|
|
|
45
46
|
scrollContentMaxHeight?: number;
|
|
46
47
|
titleSize?: 'small' | 'medium' | 'large';
|
|
47
48
|
useBackgroundCollapseButton?: boolean;
|
|
49
|
+
|
|
50
|
+
headerAlign: 'flex-start' | 'flex-end' | 'center';
|
|
48
51
|
};
|