Skip to content

Commit 8dc582a

Browse files
committed
Merge commit '183bc34f79dd0a782f5807fd8f0b6f70b870ed9f' into beta
2 parents d6cb84e + 183bc34 commit 8dc582a

File tree

3 files changed

+61
-66
lines changed

3 files changed

+61
-66
lines changed

submodules/PremiumUI/Sources/PremiumIntroScreen.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,7 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
20472047
subtitle = environment.strings.Premium_PricePerYear(subtitle).string
20482048
accessibilitySubtitle = environment.strings.Premium_PricePerYear(accessibilitySubtitle).string
20492049
}
2050+
subtitle = "\(environment.strings.Gift_Options_Premium_Months(product.months))\(product.price)"
20502051
} else {
20512052
subtitle = product.price
20522053
}

submodules/TelegramUI/Components/MediaEditorScreen/Sources/CreateLinkScreen.swift

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import ListSectionComponent
2121
import TelegramStringFormatting
2222
import MediaEditor
2323
import UrlEscaping
24+
import GlassBarButtonComponent
2425

2526
private let linkTag = GenericComponentViewTag()
2627
private let nameTag = GenericComponentViewTag()
@@ -69,8 +70,8 @@ private final class SheetContent: CombinedComponent {
6970

7071
static var body: Body {
7172
let background = Child(RoundedRectangle.self)
72-
let cancelButton = Child(Button.self)
73-
let doneButton = Child(Button.self)
73+
let cancelButton = Child(GlassBarButtonComponent.self)
74+
let doneButton = Child(GlassBarButtonComponent.self)
7475
let title = Child(Text.self)
7576
let urlSection = Child(ListSectionComponent.self)
7677
let nameSection = Child(ListSectionComponent.self)
@@ -85,7 +86,7 @@ private final class SheetContent: CombinedComponent {
8586
let presentationData = component.context.sharedContext.currentPresentationData.with { $0 }
8687

8788
let sideInset: CGFloat = 16.0
88-
var contentSize = CGSize(width: context.availableSize.width, height: 18.0)
89+
var contentSize = CGSize(width: context.availableSize.width, height: 36.0)
8990

9091
let background = background.update(
9192
component: RoundedRectangle(color: theme.list.blocksBackgroundColor, cornerRadius: 8.0),
@@ -98,24 +99,28 @@ private final class SheetContent: CombinedComponent {
9899

99100
let constrainedTitleWidth = context.availableSize.width - 16.0 * 2.0
100101

102+
let barButtonSize = CGSize(width: 40.0, height: 40.0)
101103
let cancelButton = cancelButton.update(
102-
component: Button(
103-
content: AnyComponent(
104-
Text(
105-
text: strings.Common_Cancel,
106-
font: Font.regular(17.0),
107-
color: theme.actionSheet.controlAccentColor
104+
component: GlassBarButtonComponent(
105+
size: barButtonSize,
106+
backgroundColor: theme.rootController.navigationBar.glassBarButtonBackgroundColor,
107+
isDark: theme.overallDarkAppearance,
108+
state: .generic,
109+
component: AnyComponentWithIdentity(id: "close", component: AnyComponent(
110+
BundleIconComponent(
111+
name: "Navigation/Close",
112+
tintColor: theme.rootController.navigationBar.glassBarButtonForegroundColor
108113
)
109-
),
110-
action: {
114+
)),
115+
action: { _ in
111116
component.dismiss()
112117
}
113118
),
114119
availableSize: context.availableSize,
115120
transition: .immediate
116121
)
117122
context.add(cancelButton
118-
.position(CGPoint(x: sideInset + cancelButton.size.width / 2.0, y: contentSize.height + cancelButton.size.height / 2.0))
123+
.position(CGPoint(x: sideInset + cancelButton.size.width / 2.0, y: 16.0 + cancelButton.size.height / 2.0))
119124
)
120125

121126
let explicitLink = explicitUrl(context.component.link)
@@ -126,16 +131,19 @@ private final class SheetContent: CombinedComponent {
126131

127132
let controller = environment.controller
128133
let doneButton = doneButton.update(
129-
component: Button(
130-
content: AnyComponent(
131-
Text(
132-
text: strings.Common_Done,
133-
font: Font.bold(17.0),
134-
color: isValidLink ? theme.actionSheet.controlAccentColor : theme.actionSheet.secondaryTextColor
135-
)
136-
),
134+
component: GlassBarButtonComponent(
135+
size: barButtonSize,
136+
backgroundColor: isValidLink ? environment.theme.list.itemCheckColors.fillColor : environment.theme.list.itemCheckColors.fillColor.desaturated().withMultipliedAlpha(0.5),
137+
isDark: environment.theme.overallDarkAppearance,
138+
state: .tintedGlass,
137139
isEnabled: isValidLink,
138-
action: { [weak state] in
140+
component: AnyComponentWithIdentity(id: "done", component: AnyComponent(
141+
BundleIconComponent(
142+
name: "Navigation/Done",
143+
tintColor: environment.theme.list.itemCheckColors.foregroundColor
144+
)
145+
)),
146+
action: { [weak state] _ in
139147
if let controller = controller() as? CreateLinkScreen, let state {
140148
if state.complete(controller: controller) {
141149
component.dismiss()
@@ -147,17 +155,16 @@ private final class SheetContent: CombinedComponent {
147155
transition: .immediate
148156
)
149157
context.add(doneButton
150-
.position(CGPoint(x: context.availableSize.width - sideInset - doneButton.size.width / 2.0, y: contentSize.height + doneButton.size.height / 2.0))
158+
.position(CGPoint(x: context.availableSize.width - sideInset - doneButton.size.width / 2.0, y: 16.0 + doneButton.size.height / 2.0))
151159
)
152160

153-
154161
let title = title.update(
155162
component: Text(text: component.isEdit ? strings.MediaEditor_Link_EditTitle : strings.MediaEditor_Link_CreateTitle, font: Font.bold(17.0), color: theme.list.itemPrimaryTextColor),
156163
availableSize: CGSize(width: constrainedTitleWidth, height: context.availableSize.height),
157164
transition: .immediate
158165
)
159166
context.add(title
160-
.position(CGPoint(x: context.availableSize.width / 2.0, y: contentSize.height + title.size.height / 2.0))
167+
.position(CGPoint(x: context.availableSize.width / 2.0, y: contentSize.height))
161168
)
162169
contentSize.height += title.size.height
163170
contentSize.height += 40.0
@@ -222,6 +229,7 @@ private final class SheetContent: CombinedComponent {
222229
let urlSection = urlSection.update(
223230
component: ListSectionComponent(
224231
theme: theme,
232+
style: .glass,
225233
header: AnyComponent(MultilineTextComponent(
226234
text: .plain(NSAttributedString(
227235
string: strings.MediaEditor_Link_LinkTo_Title.uppercased(),
@@ -249,6 +257,7 @@ private final class SheetContent: CombinedComponent {
249257
let nameSection = nameSection.update(
250258
component: ListSectionComponent(
251259
theme: theme,
260+
style: .glass,
252261
header: AnyComponent(MultilineTextComponent(
253262
text: .plain(NSAttributedString(
254263
string: strings.MediaEditor_Link_LinkName_Title.uppercased(),
@@ -542,6 +551,7 @@ private final class CreateLinkSheetComponent: CombinedComponent {
542551
})
543552
}
544553
)),
554+
style: .glass,
545555
backgroundColor: .blur(.dark),
546556
followContentSizeChanges: true,
547557
clipsContent: true,
@@ -816,7 +826,7 @@ private final class LinkFieldComponent: Component {
816826
containerSize: availableSize
817827
)
818828

819-
let size = CGSize(width: availableSize.width, height: 44.0)
829+
let size = CGSize(width: availableSize.width, height: 52.0)
820830
if let placeholderComponentView = self.placeholderView.view {
821831
if placeholderComponentView.superview == nil {
822832
self.insertSubview(placeholderComponentView, at: 0)
@@ -827,7 +837,7 @@ private final class LinkFieldComponent: Component {
827837
placeholderComponentView.isHidden = !component.text.isEmpty
828838
}
829839

830-
self.textField.frame = CGRect(x: 15.0, y: 0.0, width: size.width - 30.0, height: 44.0)
840+
self.textField.frame = CGRect(x: 15.0, y: 4.0, width: size.width - 30.0, height: 44.0)
831841

832842
return size
833843
}

submodules/TelegramUI/Components/Stars/StarsWithdrawalScreen/Sources/StarsWithdrawalScreen.swift

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ private final class SheetContent: CombinedComponent {
5656

5757
static var body: (CombinedComponentContext<SheetContent>) -> CGSize {
5858
let closeButton = Child(GlassBarButtonComponent.self)
59-
let cancelButton = Child(Button.self)
6059
let balance = Child(BalanceComponent.self)
6160
let title = Child(Text.self)
6261
let currencyToggle = Child(TabSelectorComponent.self)
@@ -115,46 +114,31 @@ private final class SheetContent: CombinedComponent {
115114
.position(CGPoint(x: balanceFrame.maxX, y: balanceFrame.minY))
116115
)
117116
}
118-
119-
let cancelButton = cancelButton.update(
120-
component: Button(
121-
content: AnyComponent(Text(text: environment.strings.Common_Cancel, font: Font.regular(17.0), color: environment.theme.list.itemAccentColor)),
122-
action: {
123-
component.dismiss()
124-
}
125-
).minSize(CGSize(width: 8.0, height: 44.0)),
126-
availableSize: CGSize(width: 200.0, height: 100.0),
127-
transition: .immediate
128-
)
129-
let closeFrame = CGRect(origin: CGPoint(x: 16.0, y: floor((56.0 - cancelButton.size.height) * 0.5)), size: cancelButton.size)
130-
context.add(cancelButton
131-
.position(closeFrame.center)
132-
)
133-
} else {
134-
let closeButton = closeButton.update(
135-
component: GlassBarButtonComponent(
136-
size: CGSize(width: 40.0, height: 40.0),
137-
backgroundColor: theme.rootController.navigationBar.glassBarButtonBackgroundColor,
138-
isDark: theme.overallDarkAppearance,
139-
state: .generic,
140-
component: AnyComponentWithIdentity(id: "close", component: AnyComponent(
141-
BundleIconComponent(
142-
name: "Navigation/Close",
143-
tintColor: theme.rootController.navigationBar.glassBarButtonForegroundColor
144-
)
145-
)),
146-
action: { _ in
147-
component.dismiss()
148-
}
149-
),
150-
availableSize: CGSize(width: 40.0, height: 40.0),
151-
transition: .immediate
152-
)
153-
context.add(closeButton
154-
.position(CGPoint(x: 16.0 + closeButton.size.width / 2.0, y: 16.0 + closeButton.size.height / 2.0))
155-
)
156117
}
157118

119+
let closeButton = closeButton.update(
120+
component: GlassBarButtonComponent(
121+
size: CGSize(width: 40.0, height: 40.0),
122+
backgroundColor: theme.rootController.navigationBar.glassBarButtonBackgroundColor,
123+
isDark: theme.overallDarkAppearance,
124+
state: .generic,
125+
component: AnyComponentWithIdentity(id: "close", component: AnyComponent(
126+
BundleIconComponent(
127+
name: "Navigation/Close",
128+
tintColor: theme.rootController.navigationBar.glassBarButtonForegroundColor
129+
)
130+
)),
131+
action: { _ in
132+
component.dismiss()
133+
}
134+
),
135+
availableSize: CGSize(width: 40.0, height: 40.0),
136+
transition: .immediate
137+
)
138+
context.add(closeButton
139+
.position(CGPoint(x: 16.0 + closeButton.size.width / 2.0, y: 16.0 + closeButton.size.height / 2.0))
140+
)
141+
158142
let titleString: String
159143
let amountTitle: String
160144
let amountPlaceholder: String
@@ -264,7 +248,7 @@ private final class SheetContent: CombinedComponent {
264248
.position(CGPoint(x: context.availableSize.width / 2.0, y: 36.0))
265249
)
266250
contentSize.height += title.size.height
267-
contentSize.height += 40.0
251+
contentSize.height += 56.0
268252

269253
let balance: StarsAmount?
270254
if case .accountWithdraw = component.mode {

0 commit comments

Comments
 (0)