settings: donation links are back, in their own section above About

This commit is contained in:
Seb3thehacker committed 2026-10-13 17:39:15 -07:00
1 parent cae05ecdc0
commit 71397a0777
2 files changed
+35 -1

No files matched your search

@@ -15,8 +15,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
/** Where Gearslip lives outside the app: the chat room and the code. */
/** Where Gearslip lives outside the app: donations, the chat room, and the code. */
internal object GearslipLinks {
const val SPONSORS = "https://github.com/sponsors/Seb3thehacker"
const val LIBERAPAY = "https://liberapay.com/Seb3thehacker"
const val MATRIX = "https://matrix.to/#/!mf0_mgBd5KqKpc9FfX_wHp1jFCcwAtPrndIn_oGIyMk?via=matrix.org"
const val SOURCE = "https://github.com/Seb3thehacker/gearslip"
const val CARS = "$SOURCE/blob/main/CARS.md"
@@ -28,6 +30,34 @@ internal object GearslipLinks {
}
}
/** The two ways to donate, each opening in the browser. */
@Composable
internal fun DonateRows() {
val context = LocalContext.current
val arrow = @Composable {
Icon(
Icons.AutoMirrored.Filled.KeyboardArrowRight,
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
SettingsRow(
"GitHub Sponsors",
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.SPONSORS) },
subtitle = "Give once or monthly",
icon = Icons.Filled.Favorite,
trailing = arrow,
)
SettingsDivider()
SettingsRow(
"Liberapay",
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.LIBERAPAY) },
subtitle = "Give weekly or monthly, through a nonprofit",
icon = Icons.Filled.Favorite,
trailing = arrow,
)
}
/** The About section's links: the chat room, the source code, and credits. */
@Composable
internal fun AboutLinkRows() {
@@ -131,6 +131,10 @@ fun SettingsScreen(
) { UsageStatsRows() }
SettingsSection("Updates") { UpdateRow() }
CertificateSection()
SettingsSection(
"Support Gearslip",
footer = "Gearslip is free, with no ads and no tracking. Donations keep it going.",
) { DonateRows() }
AboutSection(onOpenWhatsNew, onReplayTutorial, onReplayIntro)
Spacer(Modifier.height(16.dp))
}