Business intro screen

This commit is contained in:
Ilya Laktyushin 2024-02-20 14:55:40 +00:00
parent 0ba1164a0b
commit 7d1711c25e
11 changed files with 706 additions and 319 deletions

View File

@ -11341,7 +11341,6 @@ to respond to messages faster.";
"Business.Title" = "Telegram Business";
"Business.Description" = "Turn your account into a **business page** with these additional features.";
"Business.SubscribedDescription" = "You have now unlocked these additional business features.";
"Business.PlusPremiumFeatures" = "+20 MORE TELEGRAM PREMIUM FEATURES";
"Business.Location" = "Location";
"Business.OpeningHours" = "Opening Hours";
@ -11356,3 +11355,24 @@ to respond to messages faster.";
"Business.GreetingMessagesInfo" = "Create greetings that will be automatically sent to new customers.";
"Business.AwayMessagesInfo" = "Define messages that are automatically sent when you are off.";
"Business.ChatbotsInfo" = "Add any third-party chatbots that will process customer interactions.";
"Business.MoreFeaturesTitle" = "MORE BUSINESS FEATURES";
"Business.MoreFeaturesInfo" = "Check this section later for new business features.";
"Business.SetEmojiStatus" = "Set Emoji Status";
"Business.SetEmojiStatusInfo" = "Display the current status of your business next to your name.";
"Business.TagYourChats" = "Tag Your Chats";
"Business.TagYourChatsInfo" = "Add colorful labels to chats for faster access in chat list.";
"Business.AddPost" = "Add a Post";
"Business.AddPostInfo" = "Publish photos and videos of your goods or services on your page.";
"StoryList.SavedEmptyPosts.Title" = "No posts yet...";
"StoryList.SavedEmptyPosts.Text" = "Publish photos and videos to display on your profile page.";
"StoryList.SavedAddAction" = "Add a Post";
"PeerInfo.Channel.Boost" = "Boost Channel";
"ChannelBoost.Title" = "Boost Channel";
"ChannelBoost.Info" = "Subscribers of your channel can **boost** it so that it **levels up** and gets **exclusive features**.";

View File

@ -932,6 +932,7 @@ public protocol SharedAccountContext: AnyObject {
func makeHashtagSearchController(context: AccountContext, peer: EnginePeer?, query: String, all: Bool) -> ViewController
func makeMyStoriesController(context: AccountContext, isArchive: Bool) -> ViewController
func makeArchiveSettingsController(context: AccountContext) -> ViewController
func makeFilterSettingsController(context: AccountContext, modal: Bool, dismissed: (() -> Void)?) -> ViewController
func makeBusinessSetupScreen(context: AccountContext) -> ViewController
func makeChatbotSetupScreen(context: AccountContext) -> ViewController
func makeBusinessLocationSetupScreen(context: AccountContext) -> ViewController

View File

@ -5617,9 +5617,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
private func openFilterSettings() {
self.chatListDisplayNode.mainContainerNode.updateEnableAdjacentFilterLoading(false)
if let navigationController = self.context.sharedContext.mainWindow?.viewController as? NavigationController {
navigationController.pushViewController(chatListFilterPresetListController(context: self.context, mode: .modal, dismissed: { [weak self] in
let controller = self.context.sharedContext.makeFilterSettingsController(context: self.context, modal: true, dismissed: { [weak self] in
self?.chatListDisplayNode.mainContainerNode.updateEnableAdjacentFilterLoading(true)
}))
})
navigationController.pushViewController(controller)
}
}

View File

@ -616,12 +616,12 @@ private func chatListFilterPresetControllerEntries(context: AccountContext, pres
entries.append(.excludePeerInfo(presentationData.strings.ChatListFolder_ExcludeSectionInfo))
}
/*let tagColor = state.color ?? .blue
let tagColor = state.color ?? .blue
let resolvedColor = context.peerNameColors.getProfile(tagColor, dark: presentationData.theme.overallDarkAppearance, subject: .palette)
entries.append(.tagColorHeader(name: state.name, color: resolvedColor))
entries.append(.tagColor(colors: context.peerNameColors, currentColor: tagColor))
entries.append(.tagColorFooter)*/
entries.append(.tagColorFooter)
var hasLinks = false
if let inviteLinks, !inviteLinks.isEmpty {

View File

@ -274,8 +274,8 @@ private func chatListFilterPresetListControllerEntries(presentationData: Present
}
}
/*entries.append(.displayTags(displayTags))
entries.append(.displayTagsFooter)*/
entries.append(.displayTags(displayTags))
entries.append(.displayTagsFooter)
return entries
}

View File

@ -112,6 +112,10 @@ swift_library(
"//submodules/AlertUI",
"//submodules/TelegramUI/Components/Chat/MergedAvatarsNode",
"//submodules/TelegramUI/Components/LottieComponent",
"//submodules/TelegramUI/Components/ListSectionComponent",
"//submodules/TelegramUI/Components/ListActionItemComponent",
"//submodules/TelegramUI/Components/EmojiStatusSelectionComponent",
"//submodules/TelegramUI/Components/EntityKeyboard",
],
visibility = [
"//visibility:public",

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,6 @@ swift_library(
"//submodules/ShimmerEffect:ShimmerEffect",
"//submodules/ContextUI:ContextUI",
"//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode",
"//submodules/PremiumUI:PremiumUI",
],
visibility = [
"//visibility:public",

View File

@ -236,7 +236,13 @@ public final class ListActionItemComponent: Component {
environment: {},
containerSize: CGSize(width: availableSize.width, height: availableSize.height)
)
let iconFrame = CGRect(origin: CGPoint(x: availableSize.width - contentRightInset - iconSize.width, y: floor((contentHeight - iconSize.height) * 0.5)), size: iconSize)
var iconOffset: CGFloat = 0.0
if case .none = component.accessory {
iconOffset = 6.0
}
let iconFrame = CGRect(origin: CGPoint(x: availableSize.width - contentRightInset - iconSize.width + iconOffset, y: floor((contentHeight - iconSize.height) * 0.5)), size: iconSize)
if let iconView = icon.view {
if iconView.superview == nil {
self.addSubview(iconView)

View File

@ -8751,7 +8751,8 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
}
})
case .chatFolders:
push(chatListFilterPresetListController(context: self.context, mode: .default))
let controller = self.context.sharedContext.makeFilterSettingsController(context: self.context, modal: false, dismissed: nil)
push(controller)
case .notificationsAndSounds:
if let settings = self.data?.globalSettings {
push(notificationsAndSoundsController(context: self.context, exceptionsList: settings.notificationExceptions))

View File

@ -1883,6 +1883,10 @@ public final class SharedAccountContextImpl: SharedAccountContext {
return archiveSettingsController(context: context)
}
public func makeFilterSettingsController(context: AccountContext, modal: Bool, dismissed: (() -> Void)?) -> ViewController {
return chatListFilterPresetListController(context: context, mode: modal ? .modal : .default, dismissed: dismissed)
}
public func makeBusinessSetupScreen(context: AccountContext) -> ViewController {
return PremiumIntroScreen(context: context, mode: .business, source: .settings, modal: false, forceDark: false)
}