-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathText.jsx
More file actions
66 lines (62 loc) · 1.54 KB
/
Copy pathText.jsx
File metadata and controls
66 lines (62 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React from "react";
import PropTypes from "prop-types";
class Text extends React.Component {
constructor(props) {
super(props);
}
render() {
if (this.props.href) {
return (
<a
className={
"text-sm text-primaryColor underline hover:text-hoverColor " +
this.props.className
}
href={this.props.href}
>
{this.props.text}
</a>
);
} else {
let theming = "text-sm ";
switch (this.props.type) {
case "header":
return (
<h1 className={"mb-0 text-4xl font-bold " + this.props.className}>
{this.props.text}
</h1>
);
case "subheader":
return (
<h3 className={"mb-0 text-xl font-bold " + this.props.className}>
{this.props.text}
</h3>
);
case "subtitle":
return (
<h3 className={"text-base font-bold " + this.props.className}>
{this.props.text}
</h3>
);
case "helper":
theming = "text-gray-400 ";
break;
default:
theming = "text-md ";
}
return (
<p className={theming + " mb-0 " + this.props.className}>
{this.props.text}
</p>
);
}
}
}
export default Text;
Text.propTypes = {
text: PropTypes.string.isRequired,
type: PropTypes.string,
// children: PropTypes.arrayOf(PropTypes.element),
className: PropTypes.string,
href: PropTypes.string,
};