Skip to content

Commit

Permalink
Cleaned up commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
janewaitara committed Apr 1, 2024
1 parent f9350c5 commit c4a4277
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,157 +339,6 @@ fun AllProjectsScreenContent(
}
}
}
/*
* if (projectsScreenState.data.filteredProjects.isEmpty()) {
if (searchedText.isEmpty()) {
EmptyStateSection(
filter = projectsScreenState.data.selectedProjectStatus,
projects = projectsScreenState.data.projects
)
} else {
ErrorStateSlot(
illustration = R.drawable.empty_state,
description = R.string.projectsErrorText,
searchParam = searchedText,
filter = projectsScreenState.data.selectedProjectStatus,
)
}
} else {
LazyVerticalStaggeredGrid(
columns = rememberProjectsColumns(windowWidthSizeClass = windowWidthSizeClass),
contentPadding = PaddingValues(bottom = Space20dp),
modifier = Modifier
.fillMaxSize()
.padding(start = Space20dp, end = Space20dp),
verticalArrangement = Arrangement.spacedBy(Space16dp),
horizontalArrangement = Arrangement.spacedBy(Space16dp)
) {
items(projectsScreenState.data.filteredProjects) { project ->
ProjectItem(
// modifier = Modifier.padding(Space8dp),
project = project,
onClickProject = onClickProject
)
}
}
}
* */

/*if (projectsScreenState.data.projects.isEmpty()) {
if (projectsScreenState.isLoading) {
ShimmerEffectComposable()
} else {
EmptyStateSlot(
illustration = R.drawable.add_project,
title = R.string.allProjects,
description = R.string.allProjectsEmptyText,
)
}
} else {
Column(modifier = modifier) {
WelcomeMessageSection(
modifier = Modifier
.fillMaxWidth()
.padding(
start = Space20dp,
end = Space20dp,
),
projects = projectsScreenState.data.projects
)
Spacer(modifier = Modifier.height(Space24dp))
RequestNotifications(
hasRequestedNotificationPermission = projectsScreenState.data.hasRequestedNotificationPermission,
onClickNotBtn = onClickNotBtn
)
Row(
modifier = Modifier
.fillMaxWidth()
.padding(
start = Space20dp,
end = Space20dp,
),
verticalAlignment = Alignment.CenterVertically,
) {
SearchBar(
modifier = Modifier.weight(1f),
searchParamType = stringResource(id = R.string.projects),
searchedText = searchedText,
onSearchParamChanged = onSearchParamChanged
)
Spacer(modifier = Modifier.width(8.dp))
IconButton(
modifier = Modifier
.size(48.dp)
.clip(MaterialTheme.shapes.small)
.background(MaterialTheme.colorScheme.surface),
onClick = onClickFilterBtn,
) {
Icon(
painter = painterResource(id = R.drawable.ic_filter),
contentDescription = "Filter projects",
tint = MaterialTheme.colorScheme.onSurface
)
}
}
Spacer(modifier = Modifier.height(Space16dp))
LazyRow(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
contentPadding = PaddingValues(horizontal = Space20dp),
horizontalArrangement = Arrangement.spacedBy(Space8dp)
) {
itemsIndexed(projectsScreenState.data.filtersStatus) { _, filter ->
com.mumbicodes.projectie.presentation.designsystem.components.FilterChip(
text = filter,
selected = filter == projectsScreenState.data.selectedProjectStatus,
onClick = onClickFilterStatus,
)
}
}
Spacer(modifier = Modifier.height(Space8dp))
if (projectsScreenState.data.filteredProjects.isEmpty()) {
if (searchedText.isEmpty()) {
EmptyStateSection(
filter = projectsScreenState.data.selectedProjectStatus,
projects = projectsScreenState.data.projects
)
} else {
ErrorStateSlot(
illustration = R.drawable.empty_state,
description = R.string.projectsErrorText,
searchParam = searchedText,
filter = projectsScreenState.data.selectedProjectStatus,
)
}
} else {
LazyVerticalStaggeredGrid(
columns = rememberProjectsColumns(windowWidthSizeClass = windowWidthSizeClass),
contentPadding = PaddingValues(bottom = Space20dp),
modifier = Modifier
.fillMaxSize()
.padding(start = Space20dp, end = Space20dp),
verticalArrangement = Arrangement.spacedBy(Space16dp),
horizontalArrangement = Arrangement.spacedBy(Space16dp)
) {
items(projectsScreenState.data.filteredProjects) { project ->
ProjectItem(
// modifier = Modifier.padding(Space8dp),
project = project,
onClickProject = onClickProject
)
}
}
}
}
}*/
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,3 @@ val filters = listOf(
"In Progress",
"Completed",
)

data class AllProjectsScreenStates(
val isLoading: Boolean = false,
val data: AllProjectsStates = AllProjectsStates(),
)

0 comments on commit c4a4277

Please sign in to comment.