Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinBo44 committed Aug 21, 2023
1 parent 1913e79 commit 67f8272
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
24 changes: 8 additions & 16 deletions frontend/src/DayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3074,19 +3074,11 @@ export default function DayView({weather} : {weather: WeatherProps}) {
}
}

/* const filterAcitivities = dayActivities.filter(activity =>
(activity.possibleWhenRaining === isRaining() || !isRaining()) &&
(activity.possibleWhenWarm === isWarm()) &&
(activity.possibleWhenMiddle === isMiddle()) &&
(activity.possibleWhenCold === isCold())
);*/

const filterAcitivities = dayActivities.filter(activity =>
(activity.possibleWhenRaining || !isRaining()) &&
(activity.possibleWhenWarm || !isWarm()) &&
(activity.possibleWhenMiddle || !isMiddle()) &&
(activity.possibleWhenCold || !isCold())
);
const filteredActivities = dayActivities.filter((activity) =>{
return (activity.possibleWhenWarm === isWarm() ||
activity.possibleWhenMiddle === isMiddle() ||
activity.possibleWhenCold === isCold()) && (activity.possibleWhenRaining ? true : activity.possibleWhenRaining === !isRaining)
});

return (
<div className={"flex-container"}>
Expand All @@ -3095,7 +3087,7 @@ export default function DayView({weather} : {weather: WeatherProps}) {
<div>
<h2>{getCurrentDate()}</h2>
<ul>
{filterAcitivities.map(daily =>
{filteredActivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
Expand All @@ -3107,7 +3099,7 @@ export default function DayView({weather} : {weather: WeatherProps}) {
<div>
<h2>{tomorrowWeather.date}</h2>
<ul>
{filterAcitivities.map(daily =>
{filteredActivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
Expand All @@ -3119,7 +3111,7 @@ export default function DayView({weather} : {weather: WeatherProps}) {
<div>
<h2>{dayAfterTomorrowWeather.date}</h2>
<ul>
{filterAcitivities.map(daily =>
{filteredActivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function HomePage(){
useEffect(() => {
axios({
// url: "http://api.weatherapi.com/v1/forecast.json?key=6cc628764c7547e298d143025230108&q="+ort+"&days=3&aqi=yes&alerts=no",
url: "https://api.weatherapi.com/v1/forecast.json?key=6cc628764c7547e298d143025230108&q=Berlin&days=3&aqi=yes&alerts=no",
url: "https://api.weatherapi.com/v1/forecast.json?key=dcf0dc2ec78e416e81375800232108&q=Berlin&days=3&aqi=yes&alerts=no",
method: "get"
}).then(function (response) {
setWeather(response.data);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Menubar/WeatherAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3018,7 +3018,7 @@ export default function WeatherApi() {

useEffect(() => {
axios({
url: "https://api.weatherapi.com/v1/forecast.json?key=6cc628764c7547e298d143025230108&q=Berlin&days=3&aqi=yes&alerts=yes",
url: "https://api.weatherapi.com/v1/forecast.json?key=dcf0dc2ec78e416e81375800232108&q=Berlin&days=3&aqi=yes&alerts=no",
method: "get"
}).then(function (response) {
setWeather(response.data);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Settings() {
wrap={'wrap'}
>
<AddActivity/>
<TextField color={"warning"} size={"small"} placeholder={"Berlin"}
<TextField color={"warning"} size={"small"} placeholder={"Stadt"}
InputProps={{style: {background: 'white'}}}></TextField>
</Grid>
</Grid>
Expand Down

0 comments on commit 67f8272

Please sign in to comment.