Skip to content

Commit 0b3acb4

Browse files
committed
chore(token/discovery): remove PTR; add back draggability to sheet
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent b3c2d21 commit 0b3acb4

2 files changed

Lines changed: 14 additions & 32 deletions

File tree

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/AppRoute.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ sealed interface AppRoute : NavKey, Parcelable {
123123
data object SellReceipt : Token
124124

125125
@Serializable
126-
data object Discovery: AppRoute, NonDraggableRoute
126+
data object Discovery: AppRoute
127127

128128
}
129129
@Serializable

apps/flipcash/features/discovery/src/main/kotlin/com/flipcash/app/discovery/internal/TokenDiscoveryScreenContent.kt

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -121,37 +121,19 @@ private fun TokenDiscoveryScreenContent(
121121
}
122122
},
123123
) { padding ->
124-
val ptrState = rememberPullToRefreshState()
125-
LaunchedEffect(state.tokens) {
126-
when (state.tokens) {
127-
is Loadable.Error -> Unit
128-
is Loadable.Loaded -> listState.scrollToItem(0)
129-
is Loadable.Loading -> ptrState.animateToHidden()
130-
}
131-
}
132-
PullToRefreshBox(
133-
modifier = Modifier
134-
.fillMaxSize(),
135-
isRefreshing = false,
136-
state = ptrState,
137-
onRefresh = {
138-
dispatch(TokenDiscoveryViewModel.Event.Refresh)
139-
},
140-
) {
141-
AnimatedContent(
142-
targetState = state.tokens,
143-
transitionSpec = { fadeIn(tween()) togetherWith fadeOut(tween()) },
144-
contentKey = { it::class }, // only crossfade on type change, not data updates
145-
) { tokens ->
146-
TokenLeaderboard(
147-
category = state.category,
148-
state = listState,
149-
tokens = tokens,
150-
padding = padding,
151-
showGradientAtEnd = !state.createEnabled,
152-
dispatch = dispatch
153-
)
154-
}
124+
AnimatedContent(
125+
targetState = state.tokens,
126+
transitionSpec = { fadeIn(tween()) togetherWith fadeOut(tween()) },
127+
contentKey = { it::class }, // only crossfade on type change, not data updates
128+
) { tokens ->
129+
TokenLeaderboard(
130+
category = state.category,
131+
state = listState,
132+
tokens = tokens,
133+
padding = padding,
134+
showGradientAtEnd = !state.createEnabled,
135+
dispatch = dispatch
136+
)
155137
}
156138
}
157139
}

0 commit comments

Comments
 (0)