Skip to content

Commit

Permalink
implement button actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mebarbosa committed Feb 5, 2025
1 parent 7bc169f commit 0ca7209
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ import au.com.shiftyjelly.pocketcasts.images.R as IR
import au.com.shiftyjelly.pocketcasts.localization.R as LR

@Composable
fun SuggestedFoldersPaywall(modifier: Modifier = Modifier) {
fun SuggestedFoldersPaywall(
onUseTheseFolders: () -> Unit,
onMaybeLater: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier
.wrapContentSize()
Expand Down Expand Up @@ -97,13 +101,13 @@ fun SuggestedFoldersPaywall(modifier: Modifier = Modifier) {
backgroundColor = MaterialTheme.theme.colors.primaryInteractive01,
),
includePadding = false,
onClick = { },
onClick = onUseTheseFolders,
)

RowOutlinedButton(
text = stringResource(id = LR.string.maybe_later),
modifier = Modifier.padding(bottom = 16.dp),
onClick = {},
onClick = onMaybeLater,
includePadding = false,
colors = ButtonDefaults.outlinedButtonColors(contentColor = MaterialTheme.theme.colors.primaryIcon01, backgroundColor = Color.Transparent),
fontSize = 18.sp,
Expand Down Expand Up @@ -149,7 +153,10 @@ private fun FolderItem(folderName: String, folderColor: Color, podcastUuids: Lis
@Composable
private fun SuggestedFoldersPagePreview(@PreviewParameter(ThemePreviewParameterProvider::class) themeType: Theme.ThemeType) {
AppTheme(themeType) {
SuggestedFoldersPaywall()
SuggestedFoldersPaywall(
onUseTheseFolders = {},
onMaybeLater = {},
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import android.widget.FrameLayout
import androidx.core.view.doOnLayout
import au.com.shiftyjelly.pocketcasts.compose.AppTheme
import au.com.shiftyjelly.pocketcasts.compose.extensions.contentWithoutConsumedInsets
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingFlow
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingLauncher
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingUpgradeSource
import au.com.shiftyjelly.pocketcasts.ui.theme.Theme
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
Expand All @@ -27,7 +30,17 @@ class SuggestedFoldersPaywallBottomSheet : BottomSheetDialogFragment() {
savedInstanceState: Bundle?,
) = contentWithoutConsumedInsets {
AppTheme(theme.activeTheme) {
SuggestedFoldersPaywall()
SuggestedFoldersPaywall(
onUseTheseFolders = {
dismiss()
val source = OnboardingUpgradeSource.PROFILE
val onboardingFlow = OnboardingFlow.PlusAccountUpgrade(source)
OnboardingLauncher.openOnboardingFlow(activity, onboardingFlow)
},
onMaybeLater = {
dismiss()
},
)
}
}

Expand Down

0 comments on commit 0ca7209

Please sign in to comment.