react-native-awesome-medialib
Version:
A useful media selector module base on native component
89 lines (75 loc) • 1.96 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.albumListStyle = exports.albumItemStyle = exports.processAlbumModel = exports.showToast = void 0;
var _reactNative = require("react-native");
var _reactNativeRootToast = _interopRequireDefault(require("react-native-root-toast"));
var _reactNativeIphoneXHelper = require("react-native-iphone-x-helper");
var _Colors = require("../utils/Colors");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const showToast = (title, position = 120) => {
_reactNativeRootToast.default.show(title, {
containerStyle: {
borderRadius: 19,
width: 251
},
textStyle: {
fontSize: 14,
fontWeight: 'bold'
},
position,
backgroundColor: _Colors.black444,
shadow: false,
opacity: 1
});
};
exports.showToast = showToast;
const processAlbumModel = source => source.map(item => ({
index: item.index,
count: item.count,
cover: item.cover,
name: item.name
}));
exports.processAlbumModel = processAlbumModel;
const albumItemStyle = _reactNative.StyleSheet.create({
container: {
flex: 1,
height: 112,
backgroundColor: _Colors.black1A,
flexDirection: 'row',
alignItems: 'center'
},
cover: {
marginLeft: 16,
width: 80,
height: 80
},
textContainer: {
flexDirection: 'column',
marginLeft: 16
},
name: {
fontSize: 16,
fontWeight: '600',
color: _Colors.white
},
count: {
fontSize: 12,
fontWeight: '400',
color: _Colors.grayB2,
marginTop: 4
}
});
exports.albumItemStyle = albumItemStyle;
const albumListStyle = _reactNative.StyleSheet.create({
list: {
position: 'absolute',
top: (0, _reactNativeIphoneXHelper.isIphoneX)() ? 88 : 64,
bottom: 0,
width: '100%',
backgroundColor: _Colors.black1A
}
});
exports.albumListStyle = albumListStyle;
//# sourceMappingURL=Utils.js.map