From c4a42772427f02b31dfba15b3539ec891b234a58 Mon Sep 17 00:00:00 2001 From: Waitara Date: Mon, 1 Apr 2024 22:07:42 +0300 Subject: [PATCH] Cleaned up commented code --- .../allProjects/AllProjectsScreenRoute.kt | 151 ------------------ .../screens/allProjects/AllProjectsStates.kt | 5 - 2 files changed, 156 deletions(-) diff --git a/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsScreenRoute.kt b/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsScreenRoute.kt index 0e074e0..649ac40 100644 --- a/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsScreenRoute.kt +++ b/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsScreenRoute.kt @@ -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 diff --git a/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsStates.kt b/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsStates.kt index b6227ca..42ce542 100644 --- a/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsStates.kt +++ b/app/src/main/java/com/mumbicodes/projectie/presentation/screens/allProjects/AllProjectsStates.kt @@ -47,8 +47,3 @@ val filters = listOf( "In Progress", "Completed", ) - -data class AllProjectsScreenStates( - val isLoading: Boolean = false, - val data: AllProjectsStates = AllProjectsStates(), -)