Skip to content

Commit

Permalink
99x#29 : converted text component
Browse files Browse the repository at this point in the history
  • Loading branch information
OmalPerera committed Jul 20, 2020
1 parent c9b3d7c commit 4699955
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/atoms/Text.js → src/atoms/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
import React, { Component } from "react";
import { Text } from "react-native";
import { Text , TextProperties} from "react-native";
import PropTypes from "prop-types";
import { commonColors } from "../utils/color";
import { getFontSize } from "../variables/textSizeVariables";

class TextAE extends Component {
export interface Props extends TextProperties{
bold: boolean,
color: string,
size:
"h1" |
"h2" |
"h3" |
"h4" |
"h5" |
"h6" |
"p" |
"callout" |
"sub_heading" |
"footnote" |
"caption_big" |
"caption_small",
align: string,
margin: boolean,
}

interface State{}

class TextAE extends Component<Props, State> {
render() {
const {
color,
Expand Down Expand Up @@ -43,27 +65,6 @@ class TextAE extends Component {
}
}

TextAE.propTypes = {
bold: PropTypes.bool,
color: PropTypes.string,
size: PropTypes.oneOf([
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"p",
"callout",
"sub_heading",
"footnote",
"caption_big",
"caption_small"
]),
align: PropTypes.string,
margin: PropTypes.bool,
...Text.propTypes
};

TextAE.defaultProps = {
size: "p",
Expand Down

0 comments on commit 4699955

Please sign in to comment.