forked from bloominstituteoftechnology/nasa-photo-of-the-day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NasaCard.jsx
57 lines (41 loc) · 1.09 KB
/
NasaCard.jsx
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
import React from "react";
import styled from "styled-components";
import { Spinner } from "reactstrap";
const Card = styled.div`
overflow: hidden;
max-width: 800px;
margin: 0 auto;
border: 10px solid #696969;
border-radius: 20px;
padding: 0;
`;
const CardImg = styled.img`
width: 100%;
height: 400px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
`;
const CardText = styled.div`
max-width: 75%;
margin: 0 auto
`;
function NasaCard(props) {
const { imgUrl, title, desc, date } = props
return (
<Card>
<div className="image-container">
<CardImg src={imgUrl} alt="Daily Photo from NASA" />
</div>
<h1 className="card-title">{title}</h1>
<CardText className="card-description">
<div style = {{display: "flex", justifyContent: "center", margin: "20px 0"}}>
<Spinner color="primary" />
<p style = {{margin: "0 20px"}}>{date}</p>
<Spinner color="primary"/>
</div>
<p>{desc}</p>
</CardText>
</Card>
)
}
export default NasaCard;