Skip to content

Commit 5c49abd

Browse files
author
Hannah Dunsmore
committed
updated rover imager component
1 parent 8a20857 commit 5c49abd

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import "./App.scss";
33
import RoverDetails from "./Components/RoverDetails/RoverDetails";
4+
import PhotoOfTheDay from "./Components/photoOfTheDay/photoOfTheDay";
45

56
function App() {
67
return <RoverDetails />;

src/Components/MissionManifest/MissionManifest.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
body{
44
background-color: $blueBackground;
55
}
6+
7+
#loading-text {
8+
text-align: center;
9+
font-family: $PublicSans;
10+
color: whitesmoke;
11+
margin: 30px 0;
12+
}
613
#mission-manifest-container {
714
font-family: $MartianMono;
815
width: 40vw;

src/Components/MissionManifest/MissionManifest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function MissionManifest(props: MissionManifestProps) {
4747
}, [props.roverType]);
4848

4949
if (!manifestData) {
50-
return <p>Loading...</p>;
50+
return <p id="loading-text">Loading...</p>;
5151
} else {
5252
return (
5353
<div

src/Components/RoverImages/RoverImages.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import "../../Styles/GlobalStyles.scss";
2+
3+
14
body {
25
background: #062356;
36
color: #fffff2;
@@ -14,6 +17,13 @@ body {
1417
font-size: 50px;
1518
}
1619

20+
h2 {
21+
font-family: $PublicSans;
22+
text-align: center;
23+
padding: 100px auto;
24+
font-size: 0.8rem;
25+
}
26+
1727

1828
@media (max-width: 898px) {
1929
.sliderContainer {

src/Components/RoverImages/RoverImages.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "slick-carousel/slick/slick.css";
44
import "slick-carousel/slick/slick-theme.css";
55
import "./RoverImages.scss";
66
import { ClipLoader } from "react-spinners";
7-
import { MissionManifestProps } from "../RoverDetails/RoverDetails";
7+
import { MissionManifestProps, rovers } from "../RoverDetails/RoverDetails";
88

99
type RoverResponse = {
1010
id: number;
@@ -61,6 +61,9 @@ function RoverImages(props: MissionManifestProps) {
6161
fetchData();
6262
}, [props.roverType]);
6363

64+
let firstLetter = props.roverType.charAt(0).toUpperCase;
65+
66+
6467
if (error) {
6568
return (
6669
<div>
@@ -83,7 +86,7 @@ function RoverImages(props: MissionManifestProps) {
8386
/>
8487
</div>
8588
);
86-
} else {
89+
} else if (props.roverType === rovers.CURIOSITY) {
8790
return (
8891
<div className="sliderContainer">
8992
<Slider {...sliderSettings}>
@@ -93,6 +96,8 @@ function RoverImages(props: MissionManifestProps) {
9396
</Slider>
9497
</div>
9598
);
99+
} else {
100+
return <h2>Sorry no images taken by the rover today. <br/> The rover's mission has been completed! </h2>
96101
}
97102
}
98103

0 commit comments

Comments
 (0)