Skip to content

Commit 89bf98c

Browse files
committed
WIP
1 parent fecb37e commit 89bf98c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

app/src/main/java/org/thoughtcrime/securesms/preferences/prosettings/BaseProSettingsScreens.kt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,51 @@ private fun PreviewBaseCellButton(
159159
)
160160
}
161161
}
162+
163+
/**
164+
* A reusable structure for Pro Settings screens for non originating steps
165+
*/
166+
@Composable
167+
fun BaseNonOriginatingProSettingsScreen(
168+
disabled: Boolean,
169+
onBack: () -> Unit,
170+
buttonText: String,
171+
dangerButton: Boolean,
172+
onButtonClick: () -> Unit,
173+
title: String? = null,
174+
content: @Composable () -> Unit
175+
) {
176+
BaseCellButtonProSettingsScreen(
177+
disabled = disabled,
178+
onBack = onBack,
179+
buttonText = buttonText,
180+
dangerButton = dangerButton,
181+
onButtonClick = onButtonClick,
182+
title = title,
183+
content = content
184+
)
185+
}
186+
187+
@Preview
188+
@Composable
189+
private fun PreviewBaseNonOrig(
190+
@PreviewParameter(SessionColorsParameterProvider::class) colors: ThemeColors
191+
) {
192+
PreviewTheme(colors) {
193+
BaseNonOriginatingProSettingsScreen(
194+
disabled = false,
195+
onBack = {},
196+
title = "This is a title",
197+
buttonText = "This is a button",
198+
dangerButton = true,
199+
onButtonClick = {},
200+
content = {
201+
Box(
202+
modifier = Modifier.padding(LocalDimensions.current.smallSpacing)
203+
) {
204+
Text("This is a cell button content screen~")
205+
}
206+
}
207+
)
208+
}
209+
}

0 commit comments

Comments
 (0)