lbry-android-sdk/app/src/styles/discover.js

141 lines
3.1 KiB
JavaScript
Raw Normal View History

import { Dimensions, PixelRatio, StyleSheet } from 'react-native';
2018-06-19 22:58:26 +02:00
import Colors from './colors';
const screenDimension = Dimensions.get('window');
const screenWidth = screenDimension.width;
const screenHeight = screenDimension.height;
const screenWidthPixels = PixelRatio.getPixelSizeForLayoutSize(screenWidth);
const screenHeightPixels = PixelRatio.getPixelSizeForLayoutSize(screenHeight);
// calculate thumbnail width and height based on device's aspect ratio
const horizontalMargin = 48; // left and right margins (24 + 24)
const verticalMargin = (screenWidthPixels > 720 && screenHeightPixels > 1920) ? 0 : ((screenWidthPixels <= 720) ? 20 : 16);
const mediaWidth = screenWidth - horizontalMargin;
const mediaHeight = ((screenWidth / screenHeight) * ((screenWidthPixels <= 720) ? screenWidth : mediaWidth)) - verticalMargin;
const discoverStyle = StyleSheet.create({
container: {
2018-05-25 00:47:55 +02:00
flex: 1
},
scrollContainer: {
flex: 1,
2018-06-05 20:52:10 +02:00
marginBottom: 60,
paddingTop: 12
},
trendingContainer: {
flex: 1,
marginBottom: 60,
paddingTop: 30
},
2018-05-25 00:47:55 +02:00
busyContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row'
},
title: {
fontFamily: 'Inter-UI-Regular',
fontSize: 20,
textAlign: 'center',
2018-05-25 00:47:55 +02:00
marginLeft: 10
},
categoryName: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 20,
marginLeft: 24,
marginTop: 16,
marginBottom: 16,
2018-06-19 22:58:26 +02:00
color: Colors.Black
},
fileItem: {
marginLeft: 24,
marginRight: 24,
marginBottom: 48
},
fileItemMedia: {
width: mediaWidth,
height: mediaHeight,
alignItems: 'center',
justifyContent: 'center'
},
fileItemName: {
fontFamily: 'Inter-UI-Bold',
marginTop: 8,
fontSize: 18
},
channelName: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 16,
marginTop: 4,
2018-06-19 22:58:26 +02:00
color: Colors.LbryGreen
},
filePriceContainer: {
backgroundColor: '#61fcd8',
justifyContent: 'center',
position: 'absolute',
right: 16,
top: 16,
width: 56,
height: 24,
2018-06-19 22:58:26 +02:00
borderRadius: 4
},
filePriceText: {
fontFamily: 'Inter-UI-Bold',
fontSize: 12,
textAlign: 'center',
color: '#0c604b'
},
drawerMenuButton: {
height: '100%',
justifyContent: 'center'
},
drawerHamburger: {
marginLeft: 16,
marginRight: 16
},
rightHeaderIcon: {
marginRight: 16
},
overlay: {
flex: 1,
opacity: 1,
backgroundColor: '#222222',
alignItems: 'center',
justifyContent: 'center',
padding: 32,
position: 'absolute',
left: 0,
top: 0,
width: '100%',
height: '100%'
},
overlayText: {
color: Colors.White,
fontSize: 14,
textAlign: 'center',
fontFamily: 'Inter-UI-Regular'
},
rewardTitleContainer: {
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between'
},
rewardIcon: {
2018-11-21 11:09:54 +01:00
color: Colors.Red,
flex: 0.1,
textAlign: 'right',
marginTop: 6
},
rewardTitle: {
flex: 0.9
},
menuText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16
},
titleText: {
fontFamily: 'Inter-UI-Regular'
}
});
export default discoverStyle;