Skip to content

Commit

Permalink
weather fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mayabaxx committed Oct 25, 2023
1 parent 8fac678 commit 899eb24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions ui-display/frontend-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ function App() {
</div>
<div className="right-widget">
<div className="Joke-box">
<h3>
<h2>
Joke of the day:
</h3>
</h2>
<div>
<p className="Joke-Question">
<h2 className="Joke-Question">
What's a bee's favourite novel?
</p>
</h2>
</div>
<div>
<p className="Joke-Answer">
<h2 className="Joke-Answer">
The Great Gats-bee!
</p>
</h2>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const weatherConditionText = {
const Activities = ({ currentCondition }) => {
// hard code this value for now
if (!currentCondition) {
currentCondition = 'Clouds';
currentCondition = 'Clear';
}
// Get the corresponding activity based on the weatherCondition
const activity = weatherActivities[currentCondition] || 'movie';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WeatherWidget extends Component {

componentDidMount() {
this.fetchWeatherCondition();
this.refreshInterval = setInterval(this.fetchWeatherCondition, 3600000);
this.refreshInterval = setInterval(this.fetchWeatherCondition, 10000);
}

componentWillUnmount() {
Expand All @@ -19,7 +19,7 @@ class WeatherWidget extends Component {

fetchWeatherCondition = () => {
const apiKey = 'e032a9d4b172cf16a8f75efac7a4470c';
const stLuciaLat = 27.5021;
const stLuciaLat = -27.5021;
const stLuciaLon = 152.9968;
const apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${stLuciaLat}&lon=${stLuciaLon}&appid=${apiKey}&units=metric`;

Expand Down

0 comments on commit 899eb24

Please sign in to comment.