diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt index 77b4c40d7d..68fa25d553 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt @@ -183,6 +183,8 @@ fun ChatListView(chatModel: ChatModel, userPickerState: MutableStateFlow WhatsNewView(close = close, updatedConditions = showUpdatedConditions) } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/WhatsNewView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/WhatsNewView.kt index f95ffc1961..2de63005e1 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/WhatsNewView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/WhatsNewView.kt @@ -19,6 +19,7 @@ import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import chat.simplex.common.BuildConfigCommon import chat.simplex.common.model.ChatController.appPrefs import chat.simplex.common.model.ChatModel import chat.simplex.common.model.* @@ -916,6 +917,11 @@ private val versionDescriptions: List = listOf( version = "v7.0", post = null, features = listOf( + VersionFeature.FeatureView( + icon = null, + titleId = MR.strings.v7_0_invest, + view = { _ -> InvestInSimpleXChatView() } + ), VersionFeature.FeatureDescription( icon = MR.images.ic_alternate_email, titleId = MR.strings.v7_0_simplex_names, @@ -950,6 +956,58 @@ fun shouldShowWhatsNew(m: ChatModel): Boolean { return v != lastVersion } +private const val WEFUNDER_URL = "https://wefunder.com/simplexchat" + +@Composable +private fun InvestInSimpleXChatView() { + if (platform.androidIsPlayStoreBuild) { + LaunchedEffect(Unit) { if (androidPlayStoreCountry.value == null) platform.androidLoadPlayStoreCountry() } + if (androidPlayStoreCountry.value != "US") return + } + val uriHandler = LocalUriHandler.current + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(bottom = 12.dp)) { + Column(modifier = Modifier.weight(1f)) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(bottom = 4.dp) + ) { + Icon(painterResource(MR.images.ic_redeem), stringResource(MR.strings.v7_0_invest), tint = MaterialTheme.colors.secondary) + Text( + generalGetString(MR.strings.v7_0_invest), + maxLines = 2, + overflow = TextOverflow.Ellipsis, + style = MaterialTheme.typography.h4, + fontWeight = FontWeight.Medium, + modifier = Modifier.padding(bottom = 6.dp) + ) + } + Text(generalGetString(MR.strings.v7_0_invest_descr), fontSize = 15.sp, modifier = Modifier.padding(bottom = 4.dp)) + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier + .clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = null + ) { + uriHandler.openExternalLink(WEFUNDER_URL) + } + ) { + Text(stringResource(MR.strings.v7_0_invest_learn_more), color = MaterialTheme.colors.primary, fontSize = 15.sp) + Icon(painterResource(MR.images.ic_open_in_new), stringResource(MR.strings.v7_0_invest_learn_more), tint = MaterialTheme.colors.primary) + } + } + if (BuildConfigCommon.SIMPLEX_ASSETS) { + Image( + painterResource(if (isInDarkTheme()) MR.images.own_stake_light else MR.images.own_stake), + contentDescription = null, + modifier = Modifier.width(80.dp) + ) + } + } +} + @Composable fun CreateUpdateAddressShortLinkView(modalManager: ModalManager) { val clipboard = LocalClipboardManager.current diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml index 7950e7cc1c..0cb36fc0c2 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -2736,6 +2736,9 @@ - opt-in to send link previews.\n- use SOCKS proxy if enabled.\n- prevent hyperlink phishing.\n- remove link tracking. Non-profit governance To make SimpleX Network last. + Invest in SimpleX Chat + Equity crowdfunding launched! + Learn more on Wefunder SimpleX public names (BETA) Public names for your channel or business. Better channels 📢 diff --git a/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake.svg b/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake.svg new file mode 100644 index 0000000000..cd6f033c62 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake_light.svg b/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake_light.svg new file mode 100644 index 0000000000..cd6f033c62 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/resources/assets/default/MR/images/own_stake_light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/multiplatform/resources/MR/images/own_stake@2x.png b/assets/multiplatform/resources/MR/images/own_stake@2x.png new file mode 100644 index 0000000000..fadf1b9599 Binary files /dev/null and b/assets/multiplatform/resources/MR/images/own_stake@2x.png differ diff --git a/assets/multiplatform/resources/MR/images/own_stake@3x.png b/assets/multiplatform/resources/MR/images/own_stake@3x.png new file mode 100644 index 0000000000..106ee804ca Binary files /dev/null and b/assets/multiplatform/resources/MR/images/own_stake@3x.png differ diff --git a/assets/multiplatform/resources/MR/images/own_stake_light@2x.png b/assets/multiplatform/resources/MR/images/own_stake_light@2x.png new file mode 100644 index 0000000000..8f02fa3eaa Binary files /dev/null and b/assets/multiplatform/resources/MR/images/own_stake_light@2x.png differ diff --git a/assets/multiplatform/resources/MR/images/own_stake_light@3x.png b/assets/multiplatform/resources/MR/images/own_stake_light@3x.png new file mode 100644 index 0000000000..0a994849d6 Binary files /dev/null and b/assets/multiplatform/resources/MR/images/own_stake_light@3x.png differ