VerticalNewsCard.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { Image, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native'
  2. import React from 'react'
  3. import metrics from '../../../theme/metrics'
  4. import fonts from '../../../theme/fonts'
  5. import colors from '../../../theme/colors'
  6. import images from '../../../assets/images/images'
  7. const VerticalNewsCard = ({image,headline,tagline,style, onPress}) => {
  8. return (
  9. <TouchableWithoutFeedback onPress={onPress}>
  10. <View style={[styles.cardContainer, style]}>
  11. <View style={styles.imagesContainer}>
  12. <Image source={image ?? images.verticalCard} style={styles.image}/>
  13. </View>
  14. <View style={styles.textContainer}>
  15. <Text style={styles.headline}> {headline ?? "Aston Villa avoid relegation on final day"}</Text>
  16. <Text style={styles.tagline}>{tagline ?? "The reason behind their disappointment is that iPir disappointment is that iPhonsers have been."}</Text>
  17. </View>
  18. </View>
  19. </TouchableWithoutFeedback>
  20. )
  21. }
  22. export default VerticalNewsCard
  23. const styles = StyleSheet.create({
  24. cardContainer: {
  25. width: 'auto',
  26. maxWidth: fonts.getSize(210),
  27. backgroundColor: colors.white,
  28. borderRadius: fonts.getSize(4),
  29. height: fonts.getSize(300),
  30. maxHeight: fonts.getSize(300),
  31. marginRight: fonts.getSize(16),
  32. paddingBottom:fonts.getSize(24)
  33. },
  34. textContainer:{
  35. width: fonts.getSize(210),
  36. maxWidth: metrics.screenWidth,
  37. height:"50%",
  38. paddingHorizontal: fonts.getSize(14),
  39. paddingVertical: fonts.getSize(8)
  40. },
  41. imagesContainer:{
  42. width: '100%',
  43. height: '50%'
  44. },
  45. image:{
  46. borderRadius: fonts.getSize(4),
  47. width:'100%',
  48. height:'100%'
  49. },
  50. headline: {
  51. fontFamily: fonts.type.medium,
  52. textDecorationLine: 'underline',
  53. fontSize: fonts.getSize(16),
  54. color: colors.black,
  55. paddingBottom: fonts.getSize(8)
  56. },
  57. tagline: {
  58. fontSize: fonts.getSize(12),
  59. fontFamily: fonts.type.regular,
  60. maxHeight: '40%',
  61. overflow: 'hidden',
  62. }
  63. })