diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt index 31edeec55a..667f0c110f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt @@ -178,6 +178,7 @@ class AppPreferences { val showHiddenProfilesNotice = mkBoolPreference(SHARED_PREFS_SHOW_HIDDEN_PROFILES_NOTICE, true) val oneHandUICardShown = mkBoolPreference(SHARED_PREFS_ONE_HAND_UI_CARD_SHOWN, false) val addressCreationCardShown = mkBoolPreference(SHARED_PREFS_ADDRESS_CREATION_CARD_SHOWN, false) + val connectBannerCardShown = mkBoolPreference(SHARED_PREFS_CONNECT_BANNER_CARD_SHOWN, false) val showMuteProfileAlert = mkBoolPreference(SHARED_PREFS_SHOW_MUTE_PROFILE_ALERT, true) val showReportsInSupportChatAlert = mkBoolPreference(SHARED_PREFS_SHOW_REPORTS_IN_SUPPORT_CHAT_ALERT, true) val appLanguage = mkStrPreference(SHARED_PREFS_APP_LANGUAGE, null) @@ -259,6 +260,7 @@ class AppPreferences { laNoticeShown to false, oneHandUICardShown to false, addressCreationCardShown to false, + connectBannerCardShown to false, liveMessageAlertShown to false, showHiddenProfilesNotice to true, showMuteProfileAlert to true, @@ -438,6 +440,7 @@ class AppPreferences { private const val SHARED_PREFS_SHOW_HIDDEN_PROFILES_NOTICE = "ShowHiddenProfilesNotice" private const val SHARED_PREFS_ONE_HAND_UI_CARD_SHOWN = "OneHandUICardShown" private const val SHARED_PREFS_ADDRESS_CREATION_CARD_SHOWN = "AddressCreationCardShown" + private const val SHARED_PREFS_CONNECT_BANNER_CARD_SHOWN = "ConnectBannerCardShown" private const val SHARED_PREFS_SHOW_MUTE_PROFILE_ALERT = "ShowMuteProfileAlert" private const val SHARED_PREFS_SHOW_REPORTS_IN_SUPPORT_CHAT_ALERT = "ShowReportsInSupportChatAlert" private const val SHARED_PREFS_STORE_DB_PASSPHRASE = "StoreDBPassphrase" 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 2109e21bfe..dcb947e882 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 @@ -34,6 +34,7 @@ import chat.simplex.common.platform.* import chat.simplex.common.views.call.Call import chat.simplex.common.views.chat.item.* import chat.simplex.common.views.chat.topPaddingToContent +import chat.simplex.common.views.invitation_redesign.* import chat.simplex.common.views.newchat.* import chat.simplex.common.views.onboarding.* import chat.simplex.common.views.usersettings.* @@ -291,12 +292,18 @@ private fun BoxScope.ChatListWithLoadingScreen(searchText: MutableState, listStat val oneHandUI = remember { appPrefs.oneHandUI.state } val oneHandUICardShown = remember { appPrefs.oneHandUICardShown.state } val addressCreationCardShown = remember { appPrefs.addressCreationCardShown.state } + val connectBannerCardShown = remember { appPrefs.connectBannerCardShown.state } val activeFilter = remember { chatModel.activeChatTagFilter } LaunchedEffect(listState.firstVisibleItemIndex, listState.firstVisibleItemScrollOffset) { @@ -832,7 +840,7 @@ private fun BoxScope.ChatList(searchText: MutableState, listStat } } ChatListNavLinkView(chat, nextChatSelected) } - if (!oneHandUICardShown.value || !addressCreationCardShown.value) { + if (!oneHandUICardShown.value || !addressCreationCardShown.value || !connectBannerCardShown.value) { item { ChatListFeatureCards() } @@ -908,8 +916,12 @@ private fun ChatListFeatureCards() { val oneHandUI = remember { appPrefs.oneHandUI.state } val oneHandUICardShown = remember { appPrefs.oneHandUICardShown.state } val addressCreationCardShown = remember { appPrefs.addressCreationCardShown.state } + val connectBannerCardShown = remember { appPrefs.connectBannerCardShown.state } Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) { + if (!connectBannerCardShown.value) { + ConnectBannerCard() + } if (!oneHandUICardShown.value && !oneHandUI.value) { ToggleChatListCard() } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectBannerCard.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectBannerCard.kt new file mode 100644 index 0000000000..3bef4e034d --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectBannerCard.kt @@ -0,0 +1,136 @@ +package chat.simplex.common.views.invitation_redesign + +import androidx.compose.desktop.ui.tooling.preview.Preview +import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import dev.icerock.moko.resources.compose.painterResource +import dev.icerock.moko.resources.compose.stringResource +import chat.simplex.common.model.ChatController.appPrefs +import chat.simplex.common.platform.* +import chat.simplex.common.ui.theme.* +import chat.simplex.common.views.helpers.* +import chat.simplex.common.views.newchat.* +import chat.simplex.res.MR + +@Composable +fun ConnectBannerCard() { + val closeAll = { ModalManager.start.closeModals() } + Surface( + shape = RoundedCornerShape(18.dp), + color = MaterialTheme.appColors.sentMessage, + modifier = Modifier.fillMaxWidth() + ) { + Box { + Column { + Row( + Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceEvenly + ) { + Image( + painterResource(MR.images.ic_invitation_card_invite_someone), + contentDescription = stringResource(MR.strings.create_link_or_qr), + modifier = Modifier + .weight(1f) + .clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.INVITE, close = closeAll) + } + }, + contentScale = ContentScale.FillWidth + ) + Image( + painterResource(MR.images.ic_invitation_card_one_time_link), + contentDescription = stringResource(MR.strings.paste_link_scan), + modifier = Modifier + .weight(1f) + .clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.CONNECT, showQRCodeScanner = appPlatform.isAndroid, close = closeAll) + } + }, + contentScale = ContentScale.FillWidth + ) + } + Divider(color = MaterialTheme.colors.onSurface.copy(alpha = 0.06f)) + Row( + Modifier.fillMaxWidth().padding(vertical = DEFAULT_PADDING_HALF), + horizontalArrangement = Arrangement.SpaceEvenly + ) { + Row( + Modifier + .weight(1f) + .clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.INVITE, close = closeAll) + } + }, + horizontalArrangement = Arrangement.Center, + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(MR.images.ic_repeat_one), + contentDescription = null, + modifier = Modifier.size(18.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Text( + stringResource(MR.strings.create_link_or_qr), + style = MaterialTheme.typography.body2.copy(fontWeight = FontWeight.Medium), + ) + } + Row( + Modifier + .weight(1f) + .clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.CONNECT, showQRCodeScanner = appPlatform.isAndroid, close = closeAll) + } + }, + horizontalArrangement = Arrangement.Center, + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(MR.images.ic_qr_code), + contentDescription = null, + modifier = Modifier.size(18.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Text( + stringResource(MR.strings.paste_link_scan), + style = MaterialTheme.typography.body2.copy(fontWeight = FontWeight.Medium), + ) + } + } + } + IconButton( + onClick = { appPrefs.connectBannerCardShown.set(true) }, + modifier = Modifier.align(Alignment.TopEnd).padding(4.dp) + ) { + Icon( + painterResource(MR.images.ic_close), + stringResource(MR.strings.back), + tint = MaterialTheme.colors.secondary + ) + } + } + } +} + +@Preview +@Composable +fun PreviewConnectBannerCard() { + SimpleXTheme { + ConnectBannerCard() + } +} diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectViewLinkOrQrModal.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectViewLinkOrQrModal.kt new file mode 100644 index 0000000000..d8999ec924 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/ConnectViewLinkOrQrModal.kt @@ -0,0 +1,147 @@ +package chat.simplex.common.views.invitation_redesign + +import SectionBottomSpacer +import SectionItemView +import SectionView +import androidx.compose.desktop.ui.tooling.preview.Preview +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.* +import androidx.compose.runtime.* +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.platform.LocalClipboardManager +import androidx.compose.ui.unit.dp +import dev.icerock.moko.resources.compose.painterResource +import dev.icerock.moko.resources.compose.stringResource +import chat.simplex.common.model.* +import chat.simplex.common.platform.* +import chat.simplex.common.ui.theme.* +import chat.simplex.common.views.chat.item.CIFileViewScope +import chat.simplex.common.views.helpers.* +import chat.simplex.common.views.newchat.* +import chat.simplex.res.MR + +@Composable +fun ModalData.ConnectViewLinkOrQrModal(rhId: Long?, close: () -> Unit) { + val showQRCodeScanner = remember { stateGetOrPut("showQRCodeScanner") { true } } + val pastedLink = rememberSaveable { mutableStateOf("") } + + DisposableEffect(Unit) { + onDispose { + connectProgressManager.cancelConnectProgress() + } + } + + ModalView(close) { + ColumnWithScrollBar( + Modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + AppBarTitle(stringResource(MR.strings.connect_via_link), withPadding = false) + + Spacer(Modifier.height(DEFAULT_PADDING)) + + Icon( + painterResource(MR.images.ic_add_link), + contentDescription = null, + modifier = Modifier.size(80.dp), + tint = MaterialTheme.colors.primary + ) + + Spacer(Modifier.height(DEFAULT_PADDING * 1.5f)) + + SectionView(stringResource(MR.strings.paste_the_link_you_received).uppercase(), headerBottomPadding = 5.dp) { + ConnectPasteLinkView(rhId, pastedLink, showQRCodeScanner, close) + } + + if (appPlatform.isAndroid) { + Spacer(Modifier.height(10.dp)) + + SectionView(stringResource(MR.strings.or_scan_qr_code).uppercase(), headerBottomPadding = 5.dp) { + Box(Modifier.clip(RoundedCornerShape(DEFAULT_PADDING))) { + QRCodeScanner(showQRCodeScanner) { text -> + val linkVerified = strIsSimplexLink(text) + if (!linkVerified) { + AlertManager.shared.showAlertMsg( + title = generalGetString(MR.strings.invalid_qr_code), + text = generalGetString(MR.strings.code_you_scanned_is_not_simplex_link_qr_code) + ) + } + connectFromScanner(rhId, text, close) + } + } + } + } + + SectionBottomSpacer() + } + } +} + +@Composable +private fun ConnectPasteLinkView(rhId: Long?, pastedLink: MutableState, showQRCodeScanner: MutableState, close: () -> Unit) { + if (pastedLink.value.isEmpty()) { + val clipboard = LocalClipboardManager.current + SectionItemView({ + val str = clipboard.getText()?.text ?: return@SectionItemView + val link = strHasSingleSimplexLink(str.trim()) + if (link != null) { + pastedLink.value = link.text + showQRCodeScanner.value = false + withBGApi { + connectFromPaste(rhId, link.text, close) { pastedLink.value = "" } + } + } else { + AlertManager.shared.showAlertMsg( + title = generalGetString(MR.strings.invalid_contact_link), + text = generalGetString(MR.strings.the_text_you_pasted_is_not_a_link) + ) + } + }) { + Box(Modifier.weight(1f)) { + Text(stringResource(MR.strings.tap_to_paste_link)) + } + if (connectProgressManager.showConnectProgress != null) { + CIFileViewScope.progressIndicator(sizeMultiplier = 0.6f) + } + } + } else { + Row( + Modifier.padding(end = DEFAULT_PADDING), + verticalAlignment = Alignment.CenterVertically + ) { + Box(Modifier.weight(1f)) { + LinkTextView(pastedLink.value, false) + } + if (connectProgressManager.showConnectProgress != null) { + CIFileViewScope.progressIndicator(sizeMultiplier = 0.6f) + } + } + } +} + +private suspend fun connectFromScanner(rhId: Long?, text: String?, close: () -> Unit): Boolean { + if (text != null && strIsSimplexLink(text)) { + return connectFromPaste(rhId, text, close) + } + return false +} + +private suspend fun connectFromPaste(rhId: Long?, link: String, close: () -> Unit, cleanup: (() -> Unit)? = null): Boolean = + planAndConnect( + rhId, + link, + close = close, + cleanup = cleanup + ).await() + +@Preview +@Composable +fun PreviewConnectViewLinkOrQrModal() { + SimpleXTheme { + ModalData().ConnectViewLinkOrQrModal(rhId = null, close = {}) + } +} diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/EmptyChatListView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/EmptyChatListView.kt new file mode 100644 index 0000000000..b39d3b1b89 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/EmptyChatListView.kt @@ -0,0 +1,117 @@ +package chat.simplex.common.views.invitation_redesign + +import androidx.compose.desktop.ui.tooling.preview.Preview +import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.* +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import dev.icerock.moko.resources.compose.painterResource +import dev.icerock.moko.resources.compose.stringResource +import chat.simplex.common.platform.* +import chat.simplex.common.ui.theme.* +import chat.simplex.common.views.helpers.* +import chat.simplex.common.views.newchat.* +import chat.simplex.res.MR + +@Composable +fun BoxScope.EmptyChatListView() { + val closeAll = { ModalManager.start.closeModals() } + Column( + Modifier + .align(Alignment.Center) + .fillMaxWidth() + .padding(horizontal = DEFAULT_PADDING), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + stringResource(MR.strings.now_you_can), + style = MaterialTheme.typography.h1.copy(fontWeight = FontWeight.Bold), + ) + Spacer(Modifier.height(DEFAULT_PADDING)) + Surface( + shape = RoundedCornerShape(18.dp), + color = MaterialTheme.appColors.sentMessage, + modifier = Modifier.fillMaxWidth().clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.INVITE, close = closeAll) + } + } + ) { + Column( + Modifier.fillMaxWidth().padding(DEFAULT_PADDING), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + painterResource(MR.images.ic_invitation_card_invite_someone), + contentDescription = null, + modifier = Modifier.fillMaxWidth() + ) + Spacer(Modifier.height(DEFAULT_PADDING_HALF)) + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + painterResource(MR.images.ic_repeat_one), + contentDescription = null, + modifier = Modifier.size(18.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Text( + stringResource(MR.strings.invite_someone_to_chat), + style = MaterialTheme.typography.body1.copy(fontWeight = FontWeight.Medium), + ) + } + } + } + Spacer(Modifier.height(DEFAULT_PADDING)) + Surface( + shape = RoundedCornerShape(18.dp), + color = MaterialTheme.appColors.sentMessage, + modifier = Modifier.fillMaxWidth().clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.CONNECT, showQRCodeScanner = appPlatform.isAndroid, close = closeAll) + } + } + ) { + Column( + Modifier.fillMaxWidth().padding(DEFAULT_PADDING), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + painterResource(MR.images.ic_invitation_card_one_time_link), + contentDescription = null, + modifier = Modifier.fillMaxWidth() + ) + Spacer(Modifier.height(DEFAULT_PADDING_HALF)) + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + painterResource(MR.images.ic_qr_code), + contentDescription = null, + modifier = Modifier.size(18.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Text( + stringResource(MR.strings.connect_via_link_or_qr), + style = MaterialTheme.typography.body1.copy(fontWeight = FontWeight.Medium), + ) + } + } + } + } +} + +@Preview +@Composable +fun PreviewEmptyChatListView() { + SimpleXTheme { + Box(Modifier.fillMaxSize()) { + EmptyChatListView() + } + } +} diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/InviteSomeoneView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/InviteSomeoneView.kt new file mode 100644 index 0000000000..cf0ce8df94 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/invitation_redesign/InviteSomeoneView.kt @@ -0,0 +1,151 @@ +package chat.simplex.common.views.invitation_redesign + +import SectionBottomSpacer +import androidx.compose.desktop.ui.tooling.preview.Preview +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import dev.icerock.moko.resources.compose.painterResource +import dev.icerock.moko.resources.compose.stringResource +import chat.simplex.common.platform.* +import chat.simplex.common.ui.theme.* +import chat.simplex.common.views.helpers.* +import chat.simplex.common.views.newchat.* +import chat.simplex.common.views.usersettings.UserAddressView +import chat.simplex.res.MR + +@Composable +fun ModalData.InviteSomeoneView(close: () -> Unit) { + val closeAll = { ModalManager.start.closeModals() } + + ModalView(close) { + ColumnWithScrollBar( + Modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + AppBarTitle(stringResource(MR.strings.invite_someone), withPadding = false) + + Spacer(Modifier.height(DEFAULT_PADDING)) + + Surface( + shape = RoundedCornerShape(18.dp), + color = MaterialTheme.appColors.sentMessage, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = DEFAULT_PADDING) + .clickable { + ModalManager.start.showModalCloseable(endButtons = { AddContactLearnMoreButton() }) { _ -> + NewChatView(chatModel.currentRemoteHost.value, NewChatOption.INVITE, close = closeAll) + } + } + ) { + Column( + Modifier.fillMaxWidth().padding(DEFAULT_PADDING), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Icon( + painterResource(MR.images.ic_add_link), + contentDescription = null, + modifier = Modifier.size(80.dp), + tint = MaterialTheme.colors.primary + ) + } + } + + Spacer(Modifier.height(DEFAULT_PADDING_HALF)) + + Row( + Modifier.fillMaxWidth().padding(horizontal = DEFAULT_PADDING), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(MR.images.ic_repeat_one), + contentDescription = null, + modifier = Modifier.size(20.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Column { + Text( + stringResource(MR.strings.create_private_1_time_link), + style = MaterialTheme.typography.h3.copy(fontWeight = FontWeight.Bold), + ) + Text( + stringResource(MR.strings.contact_can_use_link_or_scan_qr), + style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.secondary + ) + } + } + + Spacer(Modifier.height(DEFAULT_PADDING * 1.5f)) + + Surface( + shape = RoundedCornerShape(18.dp), + color = MaterialTheme.appColors.sentMessage, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = DEFAULT_PADDING) + .clickable { + ModalManager.start.showModalCloseable { closeAddress -> + UserAddressView(chatModel = chatModel, shareViaProfile = false, autoCreateAddress = true, close = closeAddress) + } + } + ) { + Column( + Modifier.fillMaxWidth().padding(DEFAULT_PADDING), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Icon( + painterResource(MR.images.ic_qr_code), + contentDescription = null, + modifier = Modifier.size(80.dp), + tint = MaterialTheme.colors.primary + ) + } + } + + Spacer(Modifier.height(DEFAULT_PADDING_HALF)) + + Row( + Modifier.fillMaxWidth().padding(horizontal = DEFAULT_PADDING), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(MR.images.ic_qr_code), + contentDescription = null, + modifier = Modifier.size(20.dp), + tint = MaterialTheme.colors.secondary + ) + Spacer(Modifier.width(DEFAULT_PADDING_HALF)) + Column { + Text( + stringResource(MR.strings.create_public_simplex_address), + style = MaterialTheme.typography.h3.copy(fontWeight = FontWeight.Bold), + ) + Text( + stringResource(MR.strings.public_link_for_social_media_email_or_website), + style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.secondary + ) + } + } + + SectionBottomSpacer() + } + } +} + +@Preview +@Composable +fun PreviewInviteSomeoneView() { + SimpleXTheme { + ModalData().InviteSomeoneView(close = {}) + } +} 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 4d71073dac..49b388adf1 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -460,6 +460,15 @@ Tap to start a new chat Chat with the developers You have no chats + Now you can + Invite someone to chat + Create link or QR + Paste link / Scan + Invite someone + Create private 1-time link + Your contact can use link or scan QR code + Create public SimpleX address + Public link for social media, email or website Loading chats… No filtered chats No chats in list %s. diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_invite_someone@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_invite_someone@4x.png new file mode 100644 index 0000000000..41d12415ef Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_invite_someone@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_one_time_link@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_one_time_link@4x.png new file mode 100644 index 0000000000..a4a5741760 Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_one_time_link@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_public_address@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_public_address@4x.png new file mode 100644 index 0000000000..6d6c9bfdfa Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_card_public_address@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connect_link@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connect_link@4x.png new file mode 100644 index 0000000000..eb35856ccb Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connect_link@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connected_link_qr@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connected_link_qr@4x.png new file mode 100644 index 0000000000..81a2fe935d Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_connected_link_qr@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_create_group@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_create_group@4x.png new file mode 100644 index 0000000000..36d0aafc62 Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_create_group@4x.png differ diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_one_time_link@4x.png b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_one_time_link@4x.png new file mode 100644 index 0000000000..f9d7bf8b0a Binary files /dev/null and b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_invitation_one_time_link@4x.png differ