clubzella-comic-test-v1
Version:
A clubzella widget component library for React Native.
36 lines (35 loc) • 1.75 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_native_1 = require("react-native");
var react_1 = __importDefault(require("react"));
var ComicCard_1 = __importDefault(require("./ComicCard"));
var AllComics = function (_a) {
var handleSetComic = _a.handleSetComic, openEpisodesPanel = _a.openEpisodesPanel, setOpenEpisodesPanel = _a.setOpenEpisodesPanel, comics = _a.comics;
return (<>
<react_native_1.View style={{ gap: 10, paddingBottom: 20 }}>
<react_native_1.Text style={{ fontWeight: 600 }}>Comics</react_native_1.Text>
<react_native_1.View>
<react_native_1.View style={{
flexDirection: "row",
justifyContent: "space-between",
flexWrap: "wrap",
gap: 10,
}}>
{comics.map(function (comic, index) {
var _a;
return (<react_native_1.TouchableOpacity key={index} style={{ width: "31%" }} onPress={function () {
handleSetComic(comic);
setOpenEpisodesPanel(!openEpisodesPanel);
}}>
<ComicCard_1.default cover_img={(_a = comic === null || comic === void 0 ? void 0 : comic.file) === null || _a === void 0 ? void 0 : _a.media_url} series={comic === null || comic === void 0 ? void 0 : comic.id} title={comic === null || comic === void 0 ? void 0 : comic.title}/>
</react_native_1.TouchableOpacity>);
})}
</react_native_1.View>
</react_native_1.View>
</react_native_1.View>
</>);
};
exports.default = AllComics;