Fix layout

This commit is contained in:
Ali 2023-07-10 14:44:36 +04:00
parent 6502dbcff9
commit 855dc9c9c0
2 changed files with 12 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import ComponentFlow
import AccountContext import AccountContext
import TelegramCore import TelegramCore
import TelegramStringFormatting import TelegramStringFormatting
import MultilineTextComponent
final class StoryAuthorInfoComponent: Component { final class StoryAuthorInfoComponent: Component {
let context: AccountContext let context: AccountContext
@ -79,13 +80,21 @@ final class StoryAuthorInfoComponent: Component {
let titleSize = self.title.update( let titleSize = self.title.update(
transition: .immediate, transition: .immediate,
component: AnyComponent(Text(text: title, font: Font.medium(14.0), color: .white)), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: title, font: Font.medium(14.0), textColor: .white)),
truncationType: .end,
maximumNumberOfLines: 1
)),
environment: {}, environment: {},
containerSize: availableSize containerSize: availableSize
) )
let subtitleSize = self.subtitle.update( let subtitleSize = self.subtitle.update(
transition: .immediate, transition: .immediate,
component: AnyComponent(Text(text: subtitle, font: Font.regular(11.0), color: UIColor(white: 1.0, alpha: 0.8))), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: subtitle, font: Font.regular(11.0), textColor: UIColor(white: 1.0, alpha: 0.8))),
truncationType: .end,
maximumNumberOfLines: 1
)),
environment: {}, environment: {},
containerSize: availableSize containerSize: availableSize
) )

View File

@ -2470,7 +2470,7 @@ public final class StoryItemSetContainerComponent: Component {
} }
})), })),
environment: {}, environment: {},
containerSize: CGSize(width: max(10.0, contentFrame.width - headerRightOffset), height: 44.0) containerSize: CGSize(width: max(10.0, headerRightOffset), height: 44.0)
) )
if let view = currentCenterInfoItem.view.view { if let view = currentCenterInfoItem.view.view {
var animateIn = false var animateIn = false