@zhenryx/react-native-components 0.1.1 → 0.1.2
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/dist/Header/Header.d.ts
CHANGED
|
@@ -4,8 +4,11 @@ export interface HeaderProps {
|
|
|
4
4
|
title?: string;
|
|
5
5
|
backGroundColor?: string;
|
|
6
6
|
leftComponent?: ReactNode;
|
|
7
|
+
leftComponentStyle?: StyleProp<ViewStyle>;
|
|
7
8
|
centerComponent?: ReactNode;
|
|
9
|
+
centerComponentStyle?: StyleProp<ViewStyle>;
|
|
8
10
|
rightComponent?: ReactNode;
|
|
11
|
+
rightComponentStyle?: StyleProp<ViewStyle>;
|
|
9
12
|
containerStyle?: StyleProp<ViewStyle>;
|
|
10
13
|
titleStyle?: StyleProp<TextStyle>;
|
|
11
14
|
showBack?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,SAAS,EAAgC,MAAM,cAAc,CAAA;AAIlG,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,SAAS,EAAgC,MAAM,cAAc,CAAA;AAIlG,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,mBAAmB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyDxC,CAAA"}
|
package/dist/Header/Header.js
CHANGED
|
@@ -28,7 +28,7 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
const react_native_1 = require("react-native");
|
|
29
29
|
const Text_1 = require("../Text/Text");
|
|
30
30
|
const ThemeConfig_1 = require("../ThemeConfig/ThemeConfig");
|
|
31
|
-
const Header = ({ title = '自定义头部导航', backGroundColor, leftComponent, centerComponent, rightComponent, containerStyle, titleStyle: customTitleStyle, showBack = true, onBack }) => {
|
|
31
|
+
const Header = ({ title = '自定义头部导航', backGroundColor, leftComponent, leftComponentStyle, centerComponent, centerComponentStyle, rightComponent, rightComponentStyle, containerStyle, titleStyle: customTitleStyle, showBack = true, onBack }) => {
|
|
32
32
|
const { theme } = (0, ThemeConfig_1.useTheme)();
|
|
33
33
|
const headerStyle = (0, react_1.useMemo)(() => ({
|
|
34
34
|
minHeight: theme['$header-height'] || 44,
|
|
@@ -57,13 +57,13 @@ const Header = ({ title = '自定义头部导航', backGroundColor, leftComponen
|
|
|
57
57
|
return <Text_1.Text style={[defaultTitleStyle, customTitleStyle]}>{title}</Text_1.Text>;
|
|
58
58
|
};
|
|
59
59
|
return (<react_native_1.View style={[headerStyle, containerStyle]}>
|
|
60
|
-
<react_native_1.View style={styles.leftContainer}>
|
|
60
|
+
<react_native_1.View style={[styles.leftContainer, leftComponentStyle]}>
|
|
61
61
|
{renderLeft()}
|
|
62
62
|
</react_native_1.View>
|
|
63
|
-
<react_native_1.View style={styles.centerContainer}>
|
|
63
|
+
<react_native_1.View style={[styles.centerContainer, centerComponentStyle]}>
|
|
64
64
|
{renderCenter()}
|
|
65
65
|
</react_native_1.View>
|
|
66
|
-
<react_native_1.View style={styles.rightContainer}>
|
|
66
|
+
<react_native_1.View style={[styles.rightContainer, rightComponentStyle]}>
|
|
67
67
|
{rightComponent}
|
|
68
68
|
</react_native_1.View>
|
|
69
69
|
</react_native_1.View>);
|
|
@@ -80,6 +80,8 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
80
80
|
},
|
|
81
81
|
rightContainer: {
|
|
82
82
|
flex: 1,
|
|
83
|
+
justifyContent: 'flex-end',
|
|
84
|
+
flexDirection: 'row',
|
|
83
85
|
},
|
|
84
86
|
icon_return: {
|
|
85
87
|
width: 18,
|