ui: crowdfunding card and page as before, slide says big channels pay (#8027)

This commit is contained in:
Evgeny @ SimpleX Chat authored and GitHub committed 2026-11-04 10:04:16 +00:00
1 parent 4ef5fdc566
commit 215c02df71
10 files changed
+28 -18

No files matched your search

@@ -225,7 +225,7 @@ struct ChatListView: View {
}
}
.appSheet(isPresented: $showGetStakeSheet) {
GetStakeView(fromSettings: false)
GetStakeView(fromSettings: false, showFirstImage: true)
}
.onChange(of: activeUserPickerSheet) {
if $0 != nil {
@@ -853,13 +853,13 @@ fileprivate struct InvestInSimpleXChat: View {
.padding(.bottom, 8)
.onTapGesture { showGetStakeSheet = true }
#endif
Text("Learn more on Wefunder.")
.foregroundColor(theme.colors.primary)
(Text("Crowdfunding on Wefunder.") + Text(verbatim: " ") + Text("Learn more").foregroundColor(theme.colors.primary))
.multilineTextAlignment(.leading)
.onTapGesture { showGetStakeSheet = true }
}
.frame(maxWidth: .infinity, alignment: .leading)
.sheet(isPresented: $showGetStakeSheet) {
GetStakeView(fromSettings: false)
GetStakeView(fromSettings: false, showFirstImage: false)
}
}
}
@@ -885,7 +885,7 @@ fileprivate let getStakeSlides: [(image: String, heading: String, info: String?,
),
(
"crowdfunding_4",
"Revenue plan: businesses & channels pay",
"Revenue plan: businesses & big channels pay",
"SimpleX Chat plans to earn from the infrastructure and services that creators, businesses and large communities need as they grow.",
"Read about how we plan to make SimpleX Chat and network profitable, and about all the investment terms on Wefunder."
),
@@ -899,6 +899,7 @@ struct GetStakeView: View {
@Environment(\.dismiss) var dismiss: DismissAction
@EnvironmentObject var chatModel: ChatModel
var fromSettings: Bool
var showFirstImage: Bool
var body: some View {
ZoomablePageView {
@@ -908,7 +909,9 @@ struct GetStakeView: View {
.bold()
.fixedSize(horizontal: false, vertical: true)
.if(!fromSettings) { $0.padding(.top) }
slideImage(getStakeSlides[0])
if showFirstImage {
slideImage(getStakeSlides[0])
}
(Text(verbatim: getStakeSlides[0].text) + Text(verbatim: " Learn more and invest on Wefunder.").bold().foregroundColor(.accentColor))
.multilineTextAlignment(.leading)
.onTapGesture {
@@ -426,7 +426,7 @@ struct SettingsView: View {
if isInUS {
Section(header: Text("Own a part of SimpleX Chat").foregroundColor(theme.colors.secondary)) {
NavigationLink {
GetStakeView(fromSettings: true)
GetStakeView(fromSettings: true, showFirstImage: true)
.navigationBarTitle("", displayMode: .inline)
} label: {
settingsRow("dollarsign.circle", color: theme.colors.secondary) { Text("Crowdfunding on Wefunder") }
@@ -74,7 +74,7 @@ fun GetStakeBanner(showDismiss: Boolean, onTap: () -> Unit, onDismiss: () -> Uni
fun openGetStake(modalManager: ModalManager) {
appPrefs.getStakeBannerTapped.set(true)
modalManager.showModalCloseable(cardScreen = true) { close ->
GetStakeView(inCenterOfWindow = modalManager === ModalManager.center, close = close)
GetStakeView(showFirstImage = true, inCenterOfWindow = modalManager === ModalManager.center, close = close)
}
}
@@ -1136,7 +1136,7 @@ fun isInUs(): Boolean =
@Composable
private fun InvestInSimpleXChatView(modalManager: ModalManager) {
if (!crowdfundingAvailable()) return
val showGetStake = { modalManager.showModalCloseable(cardScreen = true) { close -> GetStakeView(inCenterOfWindow = crowdfundingLayout.inCenterOfWindow(modalManager), close = close) } }
val showGetStake = { modalManager.showModalCloseable(cardScreen = true) { close -> GetStakeView(showFirstImage = false, inCenterOfWindow = crowdfundingLayout.inCenterOfWindow(modalManager), close = close) } }
Column(modifier = Modifier.padding(bottom = 12.dp)) {
Text(
generalGetString(MR.strings.v7_1_invest),
@@ -1163,8 +1163,13 @@ private fun InvestInSimpleXChatView(modalManager: ModalManager) {
)
}
Text(
generalGetString(MR.strings.v7_1_invest_learn_more),
color = MaterialTheme.colors.primary,
buildAnnotatedString {
append(generalGetString(MR.strings.v7_0_invest_descr))
append(" ")
withStyle(SpanStyle(color = MaterialTheme.colors.primary)) {
append(generalGetString(MR.strings.learn_more))
}
},
fontSize = 15.sp,
modifier = Modifier
.pointerHoverIcon(PointerIcon.Hand)
@@ -1206,14 +1211,14 @@ private val getStakeSlides: List<CrowdfundingSlide> = listOf(
),
CrowdfundingSlide(
MR.images.crowdfunding_4,
"Revenue plan: businesses & channels pay",
"Revenue plan: businesses & big channels pay",
"SimpleX Chat plans to earn from the infrastructure and services that creators, businesses and large communities need as they grow.",
"Read about how we plan to make SimpleX Chat and network profitable, and about all the investment terms on Wefunder."
),
)
@Composable
fun GetStakeView(inCenterOfWindow: Boolean = false, close: () -> Unit) {
fun GetStakeView(showFirstImage: Boolean, inCenterOfWindow: Boolean = false, close: () -> Unit) {
val uriHandler = LocalUriHandler.current
val stopped = chatModel.chatRunning.value == false
@@ -1242,7 +1247,9 @@ fun GetStakeView(inCenterOfWindow: Boolean = false, close: () -> Unit) {
// in the center of the window the page is wide enough for the title to fit on one line
val title = "Invest in\nSimpleX Chat"
AppBarTitle(if (inCenterOfWindow) title.replace("\n", " ") else title, withPadding = false)
slideImage(getStakeSlides[0])
if (showFirstImage) {
slideImage(getStakeSlides[0])
}
Text(
buildAnnotatedString {
append(getStakeSlides[0].text)
@@ -1253,7 +1260,7 @@ fun GetStakeView(inCenterOfWindow: Boolean = false, close: () -> Unit) {
}
}
},
Modifier.padding(top = 8.dp),
Modifier.padding(top = if (showFirstImage) 8.dp else 0.dp),
lineHeight = 24.sp
)
@@ -143,7 +143,7 @@ fun SettingsLayout(
SettingsActionItem(
painterResource(MR.images.ic_redeem),
stringResource(MR.strings.v7_0_crowdfunding),
{ ModalManager.start.showModalCloseable(cardScreen = true) { close -> GetStakeView(close = close) } }
{ ModalManager.start.showModalCloseable(cardScreen = true) { close -> GetStakeView(showFirstImage = true, close = close) } }
)
}
}
@@ -2714,6 +2714,7 @@
<string name="v6_5_safe_web_links_descr">- opt-in to send link previews.\n- use SOCKS proxy if enabled.\n- prevent hyperlink phishing.\n- remove link tracking.</string>
<string name="v6_5_non_profit_governance">Non-profit governance</string>
<string name="v6_5_non_profit_governance_descr">To make SimpleX Network last.</string>
<string name="v7_0_invest_descr" translatable="false">Crowdfunding on Wefunder.</string>
<string name="v7_0_crowdfunding" translatable="false">Crowdfunding on Wefunder</string>
<string name="v7_0_invest_learn_more" translatable="false">Learn more on Wefunder</string>
<string name="invest_banner_title" translatable="false">Invest in SimpleX Chat!</string>
@@ -3357,7 +3358,6 @@
<string name="badges_investor_offer_legend">Invest $1000+ and get a free legend badge.</string>
<string name="badges_investor_offer_learn_more">Learn more on Wefunder</string>
<string name="v7_1_invest">Own a part of SimpleX Chat! 🚀</string>
<string name="v7_1_invest_learn_more">Learn more on Wefunder.</string>
<string name="v7_1_supporter_badge_title">Supporter badges</string>
<string name="v7_1_supporter_badge_body">Send larger files\navailable for longer.</string>
<string name="v7_1_supporter_badge_descr">Larger files available for longer.</string>
+1 -1
View File
@@ -356,7 +356,7 @@ The badge alert banner always offers the X; only the pitch waits to be tapped on
Both are in `AppPreferences.hintPreferences`, so "Reset all hints" restores the banner. The X is never offered below the onboarding cards, so the banner cannot be dismissed before the user has a chat.
Tapping the card runs `openGetStake()`, which opens `GetStakeView` as a card modal.
Tapping the card runs `openGetStake()`, which opens `GetStakeView(showFirstImage = true)` as a card modal — `showFirstImage` decides whether the page repeats the first slide's image, which only What's New shows above its own link.
### Shared card chrome
Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 154 KiB