react-native-cacheable-image icon indicating copy to clipboard operation
react-native-cacheable-image copied to clipboard

Suggestion: passing a customised ActivityIndicator or SpinnerComponent

Open gameboyVito opened this issue 8 years ago • 2 comments

I have read your source code and found that there is no way to pass a customised loading spinner to replace the default ActivityIndicator. The default one is ugly and we would like to replace it with our own component. Maybe you can just rewrite this part to support this feature. Or I can just send you a PR if you are acceptable.

render() {        
        if (!this.state.isRemote && !this.props.defaultSource) {
            return this.renderLocal();
        }

        if (this.state.cacheable && this.state.cachedImagePath) {
            return this.renderCache();
        }
        
        if (this.props.defaultSource) {
            return this.renderDefaultSource();
        }

       if (this.props.customSpinner) {
             return (
                 this.props.customSpinner();
            );
       } else {
              return (
                  <ActivityIndicator {...this.props.activityIndicatorProps} />
            );
      }
    }

gameboyVito avatar Apr 08 '17 04:04 gameboyVito

a PR would be welcome for this. Your example above looks good to me.

jayesbe avatar Apr 18 '17 20:04 jayesbe

we can merge it into the dev branch.. which I am planning on being the last branch using react-native-fs .. I plan on converting it to use react-native-fetch-blob after that.

jayesbe avatar Apr 18 '17 20:04 jayesbe