diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 458fbaf998..ce553d6150 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -11336,12 +11336,10 @@ Sorry for the inconvenience."; "Premium.Business.Location.Text" = "Display the location of your business on your account."; "Premium.Business.Hours.Title" = "Opening Hours"; -"Premium.Business.Hours.Text" = "Show to your customers when you are -open for business."; +"Premium.Business.Hours.Text" = "Show to your customers when you are open for business."; "Premium.Business.Replies.Title" = "Quick Replies"; -"Premium.Business.Replies.Text" = "Set up shortcuts with rich text and media -to respond to messages faster."; +"Premium.Business.Replies.Text" = "Set up shortcuts with rich text and media to respond to messages faster."; "Premium.Business.Greetings.Title" = "Greeting Messages"; "Premium.Business.Greetings.Text" = "Create greetings that will be automatically sent to new customers."; diff --git a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift index 7af14917a3..c8437c597a 100644 --- a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift @@ -3141,10 +3141,14 @@ private final class PremiumIntroScreenComponent: CombinedComponent { let secondaryTitleText: String var isAnonymous = false if var otherPeerName = state.otherPeerName { - if case let .emojiStatus(_, _, file, maybeEmojiPack) = context.component.source, let emojiPack = maybeEmojiPack, case let .result(info, _, _) = emojiPack { + if case let .emojiStatus(peerId, _, file, maybeEmojiPack) = context.component.source, let emojiPack = maybeEmojiPack, case let .result(info, _, _) = emojiPack { loadedEmojiPack = maybeEmojiPack highlightableLinks = true + if peerId.isGroupOrChannel, otherPeerName.count > 20 { + otherPeerName = otherPeerName.prefix(20).trimmingCharacters(in: .whitespacesAndNewlines) + "\u{2026}" + } + var packReference: StickerPackReference? if let file = file { for attribute in file.attributes { diff --git a/submodules/TelegramUI/Components/AudioTranscriptionButtonComponent/Sources/AudioTranscriptionButtonComponent.swift b/submodules/TelegramUI/Components/AudioTranscriptionButtonComponent/Sources/AudioTranscriptionButtonComponent.swift index b614222d27..3696b9ffea 100644 --- a/submodules/TelegramUI/Components/AudioTranscriptionButtonComponent/Sources/AudioTranscriptionButtonComponent.swift +++ b/submodules/TelegramUI/Components/AudioTranscriptionButtonComponent/Sources/AudioTranscriptionButtonComponent.swift @@ -17,6 +17,12 @@ public final class AudioTranscriptionButtonComponent: Component { } else { return false } + case let .custom(lhsBackgroundColor, lhsForegroundColor): + if case let .custom(rhsBackgroundColor, rhsForegroundColor) = rhs { + return lhsBackgroundColor == rhsBackgroundColor && lhsForegroundColor == rhsForegroundColor + } else { + return false + } case let .freeform(lhsFreeform, lhsForeground): if case let .freeform(rhsFreeform, rhsForeground) = rhs, lhsFreeform == rhsFreeform, lhsForeground == rhsForeground { return true @@ -27,6 +33,7 @@ public final class AudioTranscriptionButtonComponent: Component { } case bubble(PresentationThemePartedColors) + case custom(UIColor, UIColor) case freeform((UIColor, Bool), UIColor) } @@ -101,6 +108,9 @@ public final class AudioTranscriptionButtonComponent: Component { case let .bubble(theme): foregroundColor = theme.bubble.withWallpaper.reactionActiveBackground backgroundColor = theme.bubble.withWallpaper.reactionInactiveBackground + case let .custom(backgroundColorValue, foregroundColorValue): + foregroundColor = foregroundColorValue + backgroundColor = backgroundColorValue case let .freeform(colorAndBlur, color): foregroundColor = color backgroundColor = .clear diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift index 818da1db8b..a6c634bea4 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift @@ -728,7 +728,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode { let contentFileSizeAndApply: (CGSize, ChatMessageInteractiveFileNode.Apply)? if let contentFileFinalizeLayout { - let (size, apply) = contentFileFinalizeLayout(resultingWidth - insets.left - insets.right) + let (size, apply) = contentFileFinalizeLayout(resultingWidth - insets.left - insets.right - 6.0) contentFileSizeAndApply = (size, apply) } else { contentFileSizeAndApply = nil @@ -846,7 +846,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode { offsetY: actualSize.height )) - actualSize.height += contentFileSize.height + actualSize.height += contentFileSize.height + 9.0 } case .actionButton: if let (actionButtonSize, _) = actionButtonSizeAndApply { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageInteractiveFileNode/Sources/ChatMessageInteractiveFileNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageInteractiveFileNode/Sources/ChatMessageInteractiveFileNode.swift index 3d6e0eb6b1..f10ee1d73b 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageInteractiveFileNode/Sources/ChatMessageInteractiveFileNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageInteractiveFileNode/Sources/ChatMessageInteractiveFileNode.swift @@ -1329,10 +1329,16 @@ public final class ChatMessageInteractiveFileNode: ASDisplayNode { strongSelf.view.addSubview(audioTranscriptionButton) added = true } + let buttonTheme: AudioTranscriptionButtonComponent.Theme + if let customTintColor = arguments.customTintColor { + buttonTheme = .custom(customTintColor.withMultipliedAlpha(0.1), customTintColor) + } else { + buttonTheme = .bubble(arguments.incoming ? arguments.presentationData.theme.theme.chat.message.incoming : arguments.presentationData.theme.theme.chat.message.outgoing) + } let audioTranscriptionButtonSize = audioTranscriptionButton.update( transition: animation.isAnimated ? .easeInOut(duration: 0.3) : .immediate, component: AnyComponent(AudioTranscriptionButtonComponent( - theme: .bubble(arguments.incoming ? arguments.presentationData.theme.theme.chat.message.incoming : arguments.presentationData.theme.theme.chat.message.outgoing), + theme: buttonTheme, transcriptionState: effectiveAudioTranscriptionState, pressed: { guard let strongSelf = self else { diff --git a/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreen.swift b/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreen.swift index 8f3b9051d0..37f1d5c338 100644 --- a/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreen.swift +++ b/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreen.swift @@ -427,6 +427,10 @@ final class ShareWithPeersScreenComponent: Component { } } + func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + self.endEditing(true) + } + func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { guard let itemLayout = self.itemLayout, let topOffsetDistance = self.topOffsetDistance else { return @@ -801,7 +805,7 @@ final class ShareWithPeersScreenComponent: Component { } private func updateModalOverlayTransition(transition: Transition) { - guard let component = self.component, let environment = self.environment, let itemLayout = self.itemLayout else { + guard let component = self.component, let environment = self.environment, let itemLayout = self.itemLayout, !self.isDismissed else { return } @@ -2071,6 +2075,14 @@ final class ShareWithPeersScreenComponent: Component { self.selectedCategories.insert(.everyone) } self.state?.updated(transition: Transition(animation: .curve(duration: 0.35, curve: .spring))) + }, + isFocusedUpdated: { [weak self] isFocused in + guard let self else { + return + } + if isFocused { + self.scrollView.setContentOffset(CGPoint(x: 0.0, y: -self.scrollView.contentInset.top), animated: true) + } } )), environment: {}, @@ -2122,11 +2134,11 @@ final class ShareWithPeersScreenComponent: Component { transition.setFrame(view: self.dimView, frame: CGRect(origin: CGPoint(), size: availableSize)) if case .members = component.stateContext.subject { - self.dimView .isHidden = true + self.dimView.isHidden = true } else if case .channels = component.stateContext.subject { - self.dimView .isHidden = true + self.dimView.isHidden = true } else { - self.dimView .isHidden = false + self.dimView.isHidden = false } let categoryItemSize = self.categoryTemplateItem.update( diff --git a/submodules/TelegramUI/Components/TokenListTextField/Sources/TokenListTextField.swift b/submodules/TelegramUI/Components/TokenListTextField/Sources/TokenListTextField.swift index a5c3358430..d46862dac9 100644 --- a/submodules/TelegramUI/Components/TokenListTextField/Sources/TokenListTextField.swift +++ b/submodules/TelegramUI/Components/TokenListTextField/Sources/TokenListTextField.swift @@ -88,6 +88,7 @@ public final class TokenListTextField: Component { public let tokens: [Token] public let sideInset: CGFloat public let deleteToken: (AnyHashable) -> Void + public let isFocusedUpdated: (Bool) -> Void public init( externalState: ExternalState, @@ -96,7 +97,8 @@ public final class TokenListTextField: Component { placeholder: String, tokens: [Token], sideInset: CGFloat, - deleteToken: @escaping (AnyHashable) -> Void + deleteToken: @escaping (AnyHashable) -> Void, + isFocusedUpdated: @escaping (Bool) -> Void = { _ in } ) { self.externalState = externalState self.context = context @@ -105,6 +107,7 @@ public final class TokenListTextField: Component { self.tokens = tokens self.sideInset = sideInset self.deleteToken = deleteToken + self.isFocusedUpdated = isFocusedUpdated } public static func ==(lhs: TokenListTextField, rhs: TokenListTextField) -> Bool { @@ -191,6 +194,7 @@ public final class TokenListTextField: Component { guard let self else { return } + self.component?.isFocusedUpdated(self.tokenListNode?.isFocused ?? false) self.componentState?.updated(transition: Transition(animation: .curve(duration: 0.35, curve: .spring))) }