Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed extra space on the course tab #271

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -364,7 +364,6 @@ internal fun CourseOutlineScreen(
)
}
}
item { Spacer(Modifier.height(28.dp)) }
if (uiState.datesBannerInfo.isBannerAvailableForDashboard()) {
item {
Box(
Expand All @@ -373,13 +372,11 @@ internal fun CourseOutlineScreen(
) {
if (windowSize.isTablet) {
CourseDatesBannerTablet(
modifier = Modifier.padding(bottom = 16.dp),
banner = uiState.datesBannerInfo,
resetDates = onResetDatesClick,
)
} else {
CourseDatesBanner(
modifier = Modifier.padding(bottom = 16.dp),
banner = uiState.datesBannerInfo,
resetDates = onResetDatesClick,
)
Expand All @@ -392,11 +389,13 @@ internal fun CourseOutlineScreen(
Box(listPadding) {
if (windowSize.isTablet) {
ResumeCourseTablet(
modifier = Modifier.padding(vertical = 16.dp),
block = uiState.resumeComponent,
onResumeClick = onResumeClick
)
} else {
ResumeCourse(
modifier = Modifier.padding(vertical = 16.dp),
block = uiState.resumeComponent,
onResumeClick = onResumeClick
)
Expand All @@ -406,9 +405,6 @@ internal fun CourseOutlineScreen(
}

if (isCourseNestedListEnabled) {
item {
Spacer(Modifier.height(16.dp))
}
uiState.courseStructure.blockData.forEach { section ->
val courseSubSections =
uiState.courseSubSections[section.id]
Expand Down Expand Up @@ -509,11 +505,12 @@ internal fun CourseOutlineScreen(

@Composable
private fun ResumeCourse(
modifier: Modifier = Modifier,
block: Block,
onResumeClick: (String) -> Unit,
) {
Column(
modifier = Modifier.fillMaxWidth()
modifier = modifier.fillMaxWidth()
) {
Text(
text = stringResource(id = org.openedx.course.R.string.course_continue_with),
Expand Down Expand Up @@ -560,11 +557,12 @@ private fun ResumeCourse(

@Composable
private fun ResumeCourseTablet(
modifier: Modifier = Modifier,
block: Block,
onResumeClick: (String) -> Unit,
) {
Row(
modifier = Modifier.fillMaxWidth(),
modifier = modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) {
Column(
Expand Down Expand Up @@ -700,7 +698,7 @@ private fun CourseOutlineScreenTabletPreview() {
@Composable
private fun ResumeCoursePreview() {
OpenEdXTheme {
ResumeCourse(mockChapterBlock) {}
ResumeCourse(block = mockChapterBlock) {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ fun SubSectionUnitsList(

@Composable
fun CourseDatesBanner(
modifier: Modifier,
modifier: Modifier = Modifier,
banner: CourseDatesBannerInfo,
resetDates: () -> Unit,
) {
Expand Down Expand Up @@ -1104,7 +1104,7 @@ fun CourseDatesBanner(

@Composable
fun CourseDatesBannerTablet(
modifier: Modifier,
modifier: Modifier = Modifier,
banner: CourseDatesBannerInfo,
resetDates: () -> Unit,
) {
Expand Down
Loading