CourseListLine.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. * @flow
  7. */
  8. import React, { Component } from "react";
  9. import {
  10. StyleSheet,
  11. Text,
  12. View
  13. } from "react-native";
  14. export default class CourseListLine extends Component {
  15. render() {
  16. return (
  17. <View style={styles.courseList}>
  18. <View style={[styles.padding, styles.title]}>
  19. <Text style={styles.font}>{this.props.title}</Text>
  20. <Text style={styles.color}>共28课</Text>
  21. </View>
  22. </View>
  23. );
  24. }
  25. }
  26. const styles = StyleSheet.create({
  27. courseList: {
  28. width: '100%',
  29. backgroundColor: '#fff',
  30. marginTop: 8,
  31. },
  32. padding: {
  33. paddingLeft: 20,
  34. paddingRight: 20,
  35. },
  36. title: {
  37. display: 'flex',
  38. flexDirection: 'row',
  39. justifyContent: 'space-between',
  40. alignItems: 'center',
  41. },
  42. font: {
  43. paddingTop: 10,
  44. paddingBottom: 10,
  45. fontSize: 18,
  46. color: 'black',
  47. fontWeight: 'bold',
  48. },
  49. clor: {
  50. fontSize: 14,
  51. color: 'black',
  52. },
  53. });