Skip to content

Commit

Permalink
remove drawer from discover and search
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Jan 30, 2024
1 parent f8ace72 commit e67a24e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyHorizontalGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan
import androidx.compose.material3.Card
import androidx.compose.material3.DrawerState
import androidx.compose.material3.ListItem
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -46,19 +44,15 @@ import dev.dimension.flare.ui.presenter.home.DiscoverPresenter
import dev.dimension.flare.ui.presenter.home.DiscoverState
import dev.dimension.flare.ui.presenter.invoke
import dev.dimension.flare.ui.screen.destinations.ProfileRouteDestination
import dev.dimension.flare.ui.screen.destinations.QuickMenuDialogRouteDestination
import dev.dimension.flare.ui.theme.screenHorizontalPadding
import kotlinx.coroutines.launch
import org.koin.compose.koinInject

@Destination(
wrappers = [ThemeWrapper::class],
)
@Composable
internal fun DiscoverRoute(
navigator: DestinationsNavigator,
drawerState: DrawerState,
) {
val scope = rememberCoroutineScope()
internal fun DiscoverRoute(navigator: DestinationsNavigator) {
val state by producePresenter("discoverSearchPresenter") { discoverSearchPresenter() }
Scaffold(
topBar = {
Expand All @@ -71,9 +65,7 @@ internal fun DiscoverRoute(
DiscoverSearch(
state = state,
onAccountClick = {
scope.launch {
drawerState.open()
}
navigator.navigate(QuickMenuDialogRouteDestination)
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.Card
import androidx.compose.material3.DrawerState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand All @@ -24,7 +23,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
Expand Down Expand Up @@ -56,11 +54,11 @@ import dev.dimension.flare.ui.presenter.home.ActiveAccountState
import dev.dimension.flare.ui.presenter.home.SearchPresenter
import dev.dimension.flare.ui.presenter.home.SearchState
import dev.dimension.flare.ui.presenter.invoke
import dev.dimension.flare.ui.screen.destinations.QuickMenuDialogRouteDestination
import dev.dimension.flare.ui.screen.profile.CommonProfileHeader
import dev.dimension.flare.ui.screen.profile.ProfileHeaderLoading
import dev.dimension.flare.ui.theme.screenHorizontalPadding
import io.ktor.http.decodeURLQueryComponent
import kotlinx.coroutines.launch
import org.koin.compose.koinInject

@Destination(
Expand All @@ -78,16 +76,12 @@ import org.koin.compose.koinInject
fun SearchRoute(
keyword: String,
navigator: DestinationsNavigator,
drawerState: DrawerState,
) {
val scope = rememberCoroutineScope()
SearchScreen(
initialQuery = keyword,
onBack = { navigator.navigateUp() },
onAccountClick = {
scope.launch {
drawerState.open()
}
navigator.navigate(QuickMenuDialogRouteDestination)
},
)
}
Expand Down

0 comments on commit e67a24e

Please sign in to comment.