-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCardPage.js
38 lines (33 loc) · 857 Bytes
/
CardPage.js
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
import PropTypes from 'prop-types'
import React, {Component} from "react";
import styles from './CardPage.module.css';
const CardPage = ({title, imgLink, text, width, children}) => (
<div className={styles.card}
style={{
width: width
}}>
{title &&
<div>
<div className={styles.card_top}>
<h1 className={styles.display1}> {title}</h1>
</div>
<hr/>
</div>
}
{text}
{imgLink &&
<div className={styles.card_image}>
<img className={styles.img}
src={imgLink}/>
</div>
}
{children}
</div>
);
CardPage.propTypes = {
title: PropTypes.string,
imgLink: PropTypes.string,
text: PropTypes.string,
width: PropTypes.number,
};
export default CardPage;