react-native-hook-image-slider
Version:
React Native Image Slider UI component built with react hooks
33 lines • 1.67 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const React = __importStar(require("react"));
const react_native_1 = require("react-native");
const Content_1 = __importDefault(require("./Content"));
const Pagination_1 = __importDefault(require("./Pagination"));
exports.Slider = ({ images, imageHeight = 300, loadingIndicatorColour = "#000", separatorWidth = 0, separatorColor = "#FFF", activeDotColor = "#000", emptyDotColor = "#FFF" }) => {
const [activeIndex, setActiveIndex] = React.useState(0);
return (<react_native_1.View style={styles(imageHeight).container}>
<Content_1.default images={images} setActiveIndex={setActiveIndex} imageHeight={imageHeight} loadingIndicatorColor={loadingIndicatorColour} separatorColor={separatorColor} separatorWidth={separatorWidth}/>
<Pagination_1.default images={images} activeIndex={activeIndex} activeDotColor={activeDotColor} emptyDotColor={emptyDotColor}/>
</react_native_1.View>);
};
const styles = (imageHeight) => react_native_1.StyleSheet.create({
container: {
position: "relative",
width: "100%",
height: imageHeight,
overflow: "hidden",
},
});
exports.default = exports.Slider;
//# sourceMappingURL=index.js.map