CourseListRow.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. import ScrollRow from "./ScrollRow";
  15. export default class CourseListRow extends Component {
  16. render() {
  17. return (
  18. <View style={styles.courseList}>
  19. <View style={[styles.padding, styles.title]}>
  20. <Text style={styles.font}>{this.props.title}</Text>
  21. <Text style={styles.color}>共{this.props.wareList.length}课</Text>
  22. </View>
  23. <View style={{
  24. flex: 1,
  25. height: 200,
  26. }}>
  27. <ScrollRow itemWidth={106} itemHeight={150} data={this.props.wareList} type={ true } changeUri={ this.props.changeUri } courseId={ this.props.courseId }/>
  28. </View>
  29. </View>
  30. );
  31. }
  32. }
  33. const styles = StyleSheet.create({
  34. courseList: {
  35. width: '100%',
  36. backgroundColor: '#fff',
  37. marginTop: 8,
  38. },
  39. padding: {
  40. paddingLeft: 20,
  41. paddingRight: 20,
  42. },
  43. title: {
  44. display: 'flex',
  45. flexDirection: 'row',
  46. justifyContent: 'space-between',
  47. alignItems: 'center',
  48. },
  49. font: {
  50. paddingTop: 10,
  51. paddingBottom: 10,
  52. fontSize: 18,
  53. color: 'black',
  54. fontWeight: 'bold',
  55. },
  56. clor: {
  57. fontSize: 14,
  58. color: 'black',
  59. },
  60. });