Fix stories sending options on iPads

This commit is contained in:
Ilya Laktyushin 2023-09-19 22:04:52 +04:00
parent e7093ac39e
commit 6d03d548d7

View File

@ -987,10 +987,16 @@ final class ShareWithPeersScreenComponent: Component {
sectionHeaderView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.25) sectionHeaderView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.25)
} }
} }
let sectionXOffset: CGFloat
if case .stories = component.stateContext.subject {
sectionXOffset = 0.0
} else {
sectionXOffset = self.scrollView.frame.minX
}
if minSectionHeader == nil { if minSectionHeader == nil {
minSectionHeader = sectionHeaderView minSectionHeader = sectionHeaderView
} }
sectionHeaderTransition.setFrame(view: sectionHeaderView, frame: sectionHeaderFrame.offsetBy(dx: self.scrollView.frame.minX, dy: 0.0)) sectionHeaderTransition.setFrame(view: sectionHeaderView, frame: sectionHeaderFrame.offsetBy(dx: sectionXOffset, dy: 0.0))
} }
} }
} }
@ -1819,8 +1825,8 @@ final class ShareWithPeersScreenComponent: Component {
} }
let containerWidth: CGFloat let containerWidth: CGFloat
if case .regular = environment.metrics.widthClass { if environment.metrics.isTablet {
containerWidth = 390.0 containerWidth = 414.0
} else { } else {
containerWidth = availableSize.width containerWidth = availableSize.width
} }
@ -2308,7 +2314,11 @@ final class ShareWithPeersScreenComponent: Component {
inset += 10.0 + environment.safeInsets.bottom + 50.0 + footersTotalHeight inset += 10.0 + environment.safeInsets.bottom + 50.0 + footersTotalHeight
} else { } else {
if hasChannels { if hasChannels {
if environment.metrics.isTablet {
inset = 725.0
} else {
inset = 1000.0 inset = 1000.0
}
} else { } else {
inset = 464.0 inset = 464.0
inset += 10.0 + environment.safeInsets.bottom + 50.0 + footersTotalHeight inset += 10.0 + environment.safeInsets.bottom + 50.0 + footersTotalHeight