Skip to content

Commit 9d70893

Browse files
committed
#fade styling
1 parent bde0411 commit 9d70893

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ This library accepts all the props of [ScrollView](https://reactnative.dev/docs/
2929
| allowDivider | Allow divider at fade end. | false | Boolean. |
3030
| isRtl | For RTL Layouts | false | Boolean. |
3131

32+
### Styling
33+
For styling pass these props.
34+
35+
`startFadeStyle`, `endFadeStyle` and `dividerStyle`.
3236

3337
### Events
3438
| Name | Callback param | Description |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-faded-scrollview",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "A simple and customizable React Native component that allows you to add fade effect in ScrollView at both ends.",
55
"main": "src/index.js",
66
"scripts": {

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ export default class RNFadedScrollView extends Component {
8282
return (this.props.horizontal ?
8383
<LinearGradient
8484
start={{ x: this.props.isRtl ? 0 : 1, y: 0 }} end={{ x: this.props.isRtl ? 1 : 0, y: 0 }}
85-
style={{ position: 'absolute', start: 0, width: this.props.fadeSize, height: '100%' }}
85+
style={[{ position: 'absolute', start: 0, width: this.props.fadeSize, height: '100%' }, this.props.startFadeStyle]}
8686
colors={this.props.fadeColors}
8787
pointerEvents={'none'}
8888
/> :
8989
<LinearGradient
9090
start={{ x: 0, y: 1 }} end={{ x: 0, y: 0 }}
91-
style={{ position: 'absolute', top: 0, width: '100%', height: this.props.fadeSize }}
91+
style={[{ position: 'absolute', top: 0, width: '100%', height: this.props.fadeSize }, this.props.startFadeStyle]}
9292
colors={this.props.fadeColors}
9393
pointerEvents={'none'}
9494
/>
@@ -99,14 +99,14 @@ export default class RNFadedScrollView extends Component {
9999
return (this.props.horizontal ?
100100
<LinearGradient
101101
start={{ x: this.props.isRtl ? 1 : 0, y: 0 }} end={{ x: this.props.isRtl ? 0 : 1, y: 0 }}
102-
style={{ position: 'absolute', end: 0, width: this.props.fadeSize, height: '100%' }}
102+
style={[{ position: 'absolute', end: 0, width: this.props.fadeSize, height: '100%' }, this.props.endFadeStyle]}
103103
colors={this.props.fadeColors}
104104
pointerEvents={'none'}
105105
/>
106106
:
107107
<LinearGradient
108108
start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }}
109-
style={{ position: 'absolute', bottom: 0, width: '100%', height: this.props.fadeSize }}
109+
style={[{ position: 'absolute', bottom: 0, width: '100%', height: this.props.fadeSize }, this.props.endFadeStyle]}
110110
colors={this.props.fadeColors}
111111
pointerEvents={'none'}
112112
/>)

0 commit comments

Comments
 (0)