Skip to content

Commit 36fa1f6

Browse files
committed
New Prop: disableTextDecoration
1 parent 7b16cfe commit 36fa1f6

File tree

5 files changed

+52
-34
lines changed

5 files changed

+52
-34
lines changed

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,25 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
8484

8585
### Configuration - Props
8686

87-
| Property | Type | Default | Description |
88-
| ------------- | :-------: | :------------: | --------------------------------------------------------------------- |
89-
| text | string | Call my mom 😇 | set the checkbox's text |
90-
| textColor | color | #757575 | change the text's color |
91-
| fontFamily | string | default | set your own font family |
92-
| fontSize | number | 16 | change the text's font size |
93-
| isChecked | boolean | false | set the default checkbox value |
94-
| checkboxSize | number | 25 | change the checkbox's size |
95-
| borderRadius | number | size/2 | change the checkbox's border radius if you do not want the circle one |
96-
| borderColor | color | #f09f48 | change the checkbox's border color |
97-
| fillColor | color | #f09f48 | change the checkbox's filled color |
98-
| unfillColor | color | transparent | change the checkbox's un-filled color when it's not checked |
99-
| iconComponent | component | Icon | set your own icon component |
100-
| onPress | function | null | set your own onPress functionality after the bounce effect |
101-
| iconSize | number | 15 | change the react-native-vector-icons' size |
102-
| iconName | string | check | change the react-native-vector-icons' name |
103-
| iconType | string | Entypo | change the react-native-vector-icons' type |
104-
| iconColor | string | #fdfdfd | change the react-native-vector-icons' color |
87+
| Property | Type | Default | Description |
88+
| --------------------- | :-------: | :------------: | --------------------------------------------------------------------- |
89+
| text | string | Call my mom 😇 | set the checkbox's text |
90+
| textColor | color | #757575 | change the text's color |
91+
| fontFamily | string | default | set your own font family |
92+
| fontSize | number | 16 | change the text's font size |
93+
| isChecked | boolean | false | set the default checkbox value |
94+
| checkboxSize | number | 25 | change the checkbox's size |
95+
| borderRadius | number | size/2 | change the checkbox's border radius if you do not want the circle one |
96+
| borderColor | color | #f09f48 | change the checkbox's border color |
97+
| fillColor | color | #f09f48 | change the checkbox's filled color |
98+
| unfillColor | color | transparent | change the checkbox's un-filled color when it's not checked |
99+
| iconComponent | component | Icon | set your own icon component |
100+
| onPress | function | null | set your own onPress functionality after the bounce effect |
101+
| iconSize | number | 15 | change the react-native-vector-icons' size |
102+
| iconName | string | check | change the react-native-vector-icons' name |
103+
| iconType | string | Entypo | change the react-native-vector-icons' type |
104+
| iconColor | string | #fdfdfd | change the react-native-vector-icons' color |
105+
| disableTextDecoration | boolean | false | enable/disable text decoration for Text |
105106

106107
### Future Plans
107108

example/App.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import { View, Image, StatusBar, SafeAreaView } from "react-native";
3-
import BouncyCheckbox from "react-native-bouncy-checkbox";
4-
import { AppleHeader } from "@freakycoder/react-native-header-view";
53
import BottomSearchBar from "react-native-bottom-search-bar";
4+
import { AppleHeader } from "@freakycoder/react-native-header-view";
5+
import BouncyCheckbox from "react-native-bouncy-checkbox";
66

77
const App = () => {
88
return (
@@ -49,6 +49,7 @@ const App = () => {
4949
/>
5050
<BouncyCheckbox
5151
isChecked
52+
disableTextDecoration
5253
text="Try new gym routine"
5354
fontFamily="JosefinSans-Regular"
5455
/>

lib/src/BouncyCheckbox.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class BouncyCheckbox extends Component {
7272
};
7373

7474
render() {
75-
const { text, textColor, fontFamily, fontSize } = this.props;
75+
const {
76+
text,
77+
textColor,
78+
fontFamily,
79+
fontSize,
80+
disableTextDecoration
81+
} = this.props;
7682

7783
return (
7884
<TouchableOpacity
@@ -86,7 +92,8 @@ class BouncyCheckbox extends Component {
8692
this.state.checked,
8793
textColor,
8894
fontFamily,
89-
fontSize
95+
fontSize,
96+
disableTextDecoration
9097
)}
9198
>
9299
{text}
@@ -111,23 +118,25 @@ BouncyCheckbox.propTypes = {
111118
iconName: PropTypes.string,
112119
iconSize: PropTypes.number,
113120
iconType: PropTypes.string,
114-
iconColor: PropTypes.string
121+
iconColor: PropTypes.string,
122+
disableTextDecoration: PropTypes.bool
115123
};
116124

117125
BouncyCheckbox.defaultProps = {
118126
fontSize: 16,
127+
iconSize: 15,
119128
checkboxSize: 25,
120-
borderRadius: 25 / 2,
121129
isChecked: false,
122-
text: "Call my mom 😇",
130+
iconName: "check",
131+
iconType: "Entypo",
123132
textColor: "#757575",
133+
borderRadius: 25 / 2,
124134
fillColor: "#ffc484",
135+
iconColor: "#fdfdfd",
136+
text: "Call my mom 😇",
125137
borderColor: "#ffc484",
126138
unfillColor: "transparent",
127-
iconName: "check",
128-
iconSize: 15,
129-
iconType: "Entypo",
130-
iconColor: "#fdfdfd"
139+
disableTextDecoration: false
131140
};
132141

133142
export default BouncyCheckbox;

lib/src/BouncyCheckbox.style.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ export const iconContainer = (
1818
};
1919
};
2020

21-
export const textStyle = (checked, textColor, fontFamily, fontSize) => {
21+
export const textStyle = (
22+
checked,
23+
textColor,
24+
fontFamily,
25+
fontSize,
26+
disableTextDecoration
27+
) => {
2228
return {
29+
fontSize,
2330
fontFamily,
24-
fontSize: 16,
25-
color: "#757575",
26-
textDecorationLine: checked ? "line-through" : "none"
31+
color: textColor,
32+
textDecorationLine:
33+
!disableTextDecoration && checked ? "line-through" : "none"
2734
};
2835
};
2936

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bouncy-checkbox",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Fully customizable animated bouncy checkbox for React Native",
55
"keywords": [
66
"bouncy",

0 commit comments

Comments
 (0)