Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinBo44 committed Aug 21, 2023
1 parent 06c839d commit 11f2ba1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
12 changes: 10 additions & 2 deletions frontend/src/DayView.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
*{

}

h2{
text-align: center;
}

.flex-container {
display: flex;
justify-content: space-evenly;
flex-direction: row;
flex-wrap: wrap;
flex-flow: row wrap;
}

.activityOutput{
Expand All @@ -17,7 +20,7 @@ h2{
border-radius: 15px;
margin: 10px;
padding-left: 10px;
width: 500px;
width: 350px;
}

.btnDetails{
Expand All @@ -27,3 +30,8 @@ h2{
border-radius: 15px;
}

.activityBox{
font-family: "Roboto", Helvetica, sans-serif;
font-weight: normal;
text-align: center;
}
21 changes: 11 additions & 10 deletions frontend/src/DayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Weather, Activity} from "./HomePage.tsx";

type WeatherProps = {
weather: Weather | undefined;
dayActivities: Activity;
dayActivities: Activity[];
}


Expand Down Expand Up @@ -48,13 +48,13 @@ export default function DayView(props: WeatherProps) {
}

function isMiddle() {
if (props.weather.current.temp_c <= 24 && props.weather.current.temp_c >= 17){
if (props.weather.current.temp_c >= 10 && props.weather.current.temp_c <= 24){
return true;
}
}

function isCold() {
if (props.weather.current.temp_c <= 16) {
if (props.weather.current.temp_c < 10) {
return true;
}
}
Expand All @@ -68,7 +68,8 @@ export default function DayView(props: WeatherProps) {
const filterAcitivities = props.dayActivities.filter((activity) =>{
return (activity.possibleWhenWarm === isWarm() ||
activity.possibleWhenMiddle === isMiddle() ||
activity.possibleWhenCold === isCold()) && (activity.possibleWhenRaining ? true : activity.possibleWhenRaining === !isRaining)
activity.possibleWhenCold === isCold()) &&
(activity.possibleWhenRaining ? true : activity.possibleWhenRaining === !isRaining)
});

// const filterAcitivities = props.dayActivities.filter(activity =>
Expand All @@ -85,11 +86,11 @@ export default function DayView(props: WeatherProps) {
<div>
{/*<h2>{getCurrentDate()}</h2>*/}
<h2>Heute</h2>
<ul>
<div className={"activityBox"}>
{filterAcitivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
</div>
</div>
)}
</div>
Expand All @@ -98,11 +99,11 @@ export default function DayView(props: WeatherProps) {
<div>
{/*<h2>{tomorrowWeather.date}</h2>*/}
<h2>Morgen</h2>
<ul>
<div className={"activityBox"}>
{filterAcitivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
</div>
</div>
) : <p>No forecast for tomorrow available</p>}
</div>
Expand All @@ -111,11 +112,11 @@ export default function DayView(props: WeatherProps) {
<div>
{/*<h2>{dayAfterTomorrowWeather.date}</h2>*/}
<h2>Übermorgen</h2>
<ul>
<div className={"activityBox"}>
{filterAcitivities.map(daily =>
<ActivityCard key={daily.id} dayActivity={daily} />
)}
</ul>
</div>
</div>
) : <p>keine Daten verfügbar</p>}
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Menubar/AddActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function AddActivity(props) {
checked={possibleWhenWarm}
onChange={updatePossibleWhenWarm}/>

<FormControlLabel control={<Checkbox/>} label="Mittel (15°C - 25°C)"
<FormControlLabel control={<Checkbox/>} label="Mittel (15°C - 24°C)"
checked={possibleWhenMiddle}
onChange={() => updatePossibleWhenMiddle()}/>

Expand Down

0 comments on commit 11f2ba1

Please sign in to comment.