Skip to content

Commit 79df38d

Browse files
FlurinFlurin
Flurin
authored and
Flurin
committed
css
1 parent 9a093eb commit 79df38d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

soemi-woeb/src/App.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ function App() {
66
const [planet, setPlanet] = useState(null)
77

88
const handleRestCall = async () => {
9-
const temp = await getTemp();
10-
const imgRes = await fetch(`http://sömi-weather.ch/api/get-the-star-wars-planets-mapping-for-the-current-temperature-completely-and-utterly-accurate?temp=${temp}`)
11-
console.log(imgRes);
12-
const imgJson = await imgRes.json();
13-
console.log(imgJson);
14-
setPlanet(imgJson);
9+
$("body").css("cursor", "progress");
10+
try {
11+
const temp = await getTemp();
12+
const imgRes = await fetch(`http://sömi-weather.ch/api/get-the-star-wars-planets-mapping-for-the-current-temperature-completely-and-utterly-accurate?temp=${temp}`)
13+
console.log(imgRes);
14+
const imgJson = await imgRes.json();
15+
console.log(imgJson);
16+
setPlanet(imgJson);
17+
} catch (error) {
18+
console.log("error")
19+
}finally{
20+
$("body").css("cursor", "default");
21+
}
1522
};
1623

1724
const getTemp = async () => {
@@ -84,7 +91,7 @@ export function Planet({ planet }) {
8491
return (
8592
<>
8693
<h1>Name: {name}</h1>
87-
<img src={image} alt="Star Wars Planet"/>
94+
<img src={image} alt="Star Wars Planet" style="width: 50%;"/>
8895
</>
8996
);
9097
}

0 commit comments

Comments
 (0)