j-mendez/react-native-reader

View on GitHub
src/components/body.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { PureComponent } from "react";
import { ScrollView, Text } from "react-native";
import type { BodyProps as Props } from "../types";

export class Body extends PureComponent<Props> {
  render() {
    const { title, styles } = this.props;

    return (
      <ScrollView
        style={[styles.flex, styles.container]}
        contentContainerStyle={this.props.contentContainerStyle}
        testID="reader-body"
      >
        {title ? (
          <Text
            testID="reader-title"
            style={[styles.title, this.props.titleStyle]}
          >
            {title}
          </Text>
        ) : null}
        {this.props.children}
      </ScrollView>
    );
  }
}