Skip to content

Commit b6064d8

Browse files
fix: Header clear icon press is inactive and remove unwanted closeIconSize prop from window header
1 parent a3cf932 commit b6064d8

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ Here are the custom style options for the notification inbox:
186186
height?: number;
187187
titleFontWeight?: TextStyle['fontWeight'];
188188
titleSize?: number;
189-
closeIconSize?: number;
190189
}
191190
windowContainer?: {
192191
padding?: number;

src/components/header.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ const Header = (props: {
3838
<Text numberOfLines={1} style={[style.headerTitle, styles.headerTitle]}>
3939
{title}
4040
</Text>
41-
{!hideClearAll && <View style={style.clearIconContainer}>
42-
<ClearIcon styles={styles} />
43-
<TouchableOpacity disabled={clearAllDisabled} onPress={onPressClearAll}>
41+
{!hideClearAll && (
42+
<TouchableOpacity
43+
disabled={clearAllDisabled}
44+
onPress={onPressClearAll}
45+
style={style.clearIconContainer}
46+
>
47+
<ClearIcon styles={styles} />
4448
<Text style={styles.headerAction}>{Constants.CLEAR_ALL_LABEL}</Text>
4549
</TouchableOpacity>
46-
</View>}
50+
)}
4751
</View>
4852
);
4953
};
@@ -55,7 +59,7 @@ const style = StyleSheet.create({
5559
justifyContent: 'space-between',
5660
alignItems: 'center',
5761
paddingVertical: 10,
58-
paddingHorizontal: 15,
62+
paddingHorizontal: 15
5963
},
6064
clearIconContainer: {
6165
flexDirection: 'row',

src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export type StyleProps = {
147147
height?: number;
148148
titleFontWeight?: TextStyle['fontWeight'];
149149
titleSize?: number;
150-
closeIconSize?: number;
151150
titlePadding?: number;
152151
borderWidth?: number;
153152
};

src/utils/commonUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const applyTheme = (
151151
clearIconContainer: {
152152
width: customStyles.clearAllIcon?.size || defaultStyles.clearAllIcon.size,
153153
height: customStyles.clearAllIcon?.size || defaultStyles.clearAllIcon.size,
154-
marginRight: (customStyles.clearAllIcon?.size || defaultStyles.clearAllIcon.size) * 0.2
154+
marginRight: (customStyles.clearAllIcon?.size || defaultStyles.clearAllIcon.size) * 0.3
155155
},
156156
timerIcon: {
157157
borderColor: theme.colors?.timerIcon || DefaultTheme[mode].colors.timerIcon,

src/utils/constants.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export const defaultStyles = {
112112
height: 50,
113113
titleFontWeight: '500',
114114
titleSize: 20,
115-
closeIconSize: 20,
116115
titlePadding: 0,
117116
borderWidth: 0.6
118117
},
@@ -139,6 +138,6 @@ export const defaultStyles = {
139138
size: 12
140139
},
141140
clearAllIcon: {
142-
size: 18
141+
size: 16
143142
}
144143
};

0 commit comments

Comments
 (0)