Skip to content

Commit 020f1a2

Browse files
committed
unused variable corrections
1 parent 73c2633 commit 020f1a2

File tree

4 files changed

+16
-28
lines changed

4 files changed

+16
-28
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "./App.scss";
3-
import {BrowserRouter as Router, Routes, Route, Link} from 'react-router-dom';
3+
import {BrowserRouter as Router, Routes, Route} from 'react-router-dom';
44
import PhotoOfTheDay from './Components/photoOfTheDay'
55

66

src/Components/photoOfTheDay.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,13 @@ $general-font: "Public Sans";
3333
color: $text-color;
3434
padding: 5px;
3535
text-align: center;
36+
display: none;
37+
}
38+
39+
.photoTitle {
40+
width: 70%;
41+
margin: auto;
42+
color: $text-color;
43+
padding: 5px;
44+
text-align: center;
3645
}

src/Components/photoOfTheDay.spec.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,3 @@ describe (PhotoOfTheDay, ()=>{
4141
})})
4242

4343
})
44-
45-
// describe (PhotoOfTheDay, ()=>{
46-
47-
// it ("Should render fallback image", async ()=>{
48-
// global.fetch = jest.fn(() =>
49-
// Promise.resolve(
50-
// new Response(
51-
// JSON.stringify({
52-
// title: "Astronomy Picture of the Day",
53-
// explanation: "An amazing view of the International Space Station transiting the Sun.",
54-
// })
55-
// )))
56-
// render(<PhotoOfTheDay/>)
57-
// const testImage = document.querySelector("img") as HTMLImageElement;
58-
// await waitFor(() => {
59-
// expect(testImage).toBeInTheDocument;
60-
61-
// })})
62-
// })

src/Components/photoOfTheDay.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useEffect, useState } from "react";
2-
import { data } from "react-router";
32
import "./photoOfTheDay.scss";
43

54

@@ -9,11 +8,10 @@ export default function PhotoOfTheDay () {
98
const [title, setTitle] = useState<string>()
109
const [explanation,setExplanation] = useState<string>()
1110

12-
13-
const fallBackImageDates = ["2025-05-08" , "2025-05-13", "2025-04-24" , "2025-03-26" , "2025-04-13" , "2025-03-23" , "2025-01-15" , "2024-11-10" , "2024-03-22" , "2023-08-10"]
14-
const photoAddress = "https://api.nasa.gov/planetary/apod?&api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy"
15-
1611
useEffect (() => {
12+
const photoAddress = "https://api.nasa.gov/planetary/apod?api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy"
13+
const fallBackImageDates = ["2025-05-08" , "2025-05-13", "2025-04-24" , "2025-03-26" , "2025-04-13" , "2025-03-23" , "2025-01-15" , "2024-11-10" , "2024-03-22" , "2023-08-10"]
14+
1715
fetch(photoAddress)
1816
.then(response => response.json())
1917
.then( data => {
@@ -42,12 +40,12 @@ export default function PhotoOfTheDay () {
4240
return (
4341
<div> <link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"></link>
4442
<div className="photoOfTheDayContainer">
45-
<img src={photo} className="photo-of-the-day" width="100%" alt-text={title}/>
43+
<img src={photo} className="photo-of-the-day" width="100%" alt={title}/>
4644

4745
</div>
48-
<div className="explanation">Astronomy Photo of the Day</div>
46+
<div className="photoTitle">Astronomy Photo of the Day</div>
4947
<div className="explanation">
50-
{/* {explanation} */}
48+
{explanation}
5149
</div>
5250
</div>
5351
)

0 commit comments

Comments
 (0)