mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 08:12:26 +01:00
settings: donation links are back, in their own section above About
This commit is contained in:
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.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
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 {
|
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 MATRIX = "https://matrix.to/#/!mf0_mgBd5KqKpc9FfX_wHp1jFCcwAtPrndIn_oGIyMk?via=matrix.org"
|
||||||
const val SOURCE = "https://github.com/Seb3thehacker/gearslip"
|
const val SOURCE = "https://github.com/Seb3thehacker/gearslip"
|
||||||
const val CARS = "$SOURCE/blob/main/CARS.md"
|
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. */
|
/** The About section's links: the chat room, the source code, and credits. */
|
||||||
@Composable
|
@Composable
|
||||||
internal fun AboutLinkRows() {
|
internal fun AboutLinkRows() {
|
||||||
|
|||||||
@@ -131,6 +131,10 @@ fun SettingsScreen(
|
|||||||
) { UsageStatsRows() }
|
) { UsageStatsRows() }
|
||||||
SettingsSection("Updates") { UpdateRow() }
|
SettingsSection("Updates") { UpdateRow() }
|
||||||
CertificateSection()
|
CertificateSection()
|
||||||
|
SettingsSection(
|
||||||
|
"Support Gearslip",
|
||||||
|
footer = "Gearslip is free, with no ads and no tracking. Donations keep it going.",
|
||||||
|
) { DonateRows() }
|
||||||
AboutSection(onOpenWhatsNew, onReplayTutorial, onReplayIntro)
|
AboutSection(onOpenWhatsNew, onReplayTutorial, onReplayIntro)
|
||||||
Spacer(Modifier.height(16.dp))
|
Spacer(Modifier.height(16.dp))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user