Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand Down Expand Up @@ -161,28 +162,35 @@ fun GameDetailsContent(gameCard: DetailsCardData) {
Text("No Scoring Summary") // TODO: Make state when there are no scores
}
} else {
Spacer(modifier = Modifier.height(40.dp))
if (gameCard.daysUntilGame != null && gameCard.hoursUntilGame != null) {
TimeUntilStartCard(
gameCard.daysUntilGame,
gameCard.hoursUntilGame
val context = LocalContext.current
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Spacer(modifier = Modifier.height(40.dp))

if (gameCard.daysUntilGame != null && gameCard.hoursUntilGame != null) {
TimeUntilStartCard(
gameCard.daysUntilGame,
gameCard.hoursUntilGame
)
}

Spacer(modifier = Modifier.weight(1f))

ButtonPrimary(
"Add to Calendar",
painterResource(R.drawable.ic_calendar),
onClick = {
gameCard.toCalendarEvent()?.let { event ->
addToCalendar(context = context, event)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit: I don't think you need to pass in context as a named parameter, feels a bit redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addTocalendar still does not work, so I think I will be working on that as the first issue.

}
}
)
}

}
}
if (!gameCard.isPastStartTime) {
val context = LocalContext.current
Spacer(modifier = Modifier.height(84.dp))
ButtonPrimary(
"Add to Calendar",
painterResource(R.drawable.ic_calendar),
onClick = {
gameCard.toCalendarEvent()?.let { event ->
addToCalendar(context = context, event)
}
}
)
}

}
}