Skip to content

Commit ead649d

Browse files
committed
Move info section
1 parent c855e06 commit ead649d

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ private struct PostSettingsView: View {
5151
var body: some View {
5252
Form {
5353
PostSettingsFormContentView(viewModel: viewModel)
54+
infoSection
5455
}
5556
.accessibilityIdentifier("post_settings_form")
5657
.disabled(viewModel.isSaving)
@@ -120,6 +121,22 @@ private struct PostSettingsView: View {
120121
.tint(AppColor.tint)
121122
}
122123
}
124+
125+
@ViewBuilder
126+
private var infoSection: some View {
127+
if viewModel.lastEditedText != nil || viewModel.postID != nil {
128+
Section {
129+
if let postID = viewModel.postID {
130+
SettingsRow(Strings.postIDLabel, value: String(postID))
131+
}
132+
if let lastEditedText = viewModel.lastEditedText {
133+
SettingsRow(Strings.lastEditedLabel, value: lastEditedText)
134+
}
135+
} header: {
136+
SectionHeader(Strings.infoLabel)
137+
}
138+
}
139+
}
123140
}
124141

125142
struct PostSettingsFormContentView: View {
@@ -134,9 +151,6 @@ struct PostSettingsFormContentView: View {
134151
generalSection
135152
socialSharingSection
136153
moreOptionsSection
137-
if viewModel.context != .publishing {
138-
infoSection
139-
}
140154
}
141155

142156
// MARK: - "Publishing Options" Section
@@ -360,24 +374,6 @@ struct PostSettingsFormContentView: View {
360374
Text(Strings.stickyPostLabel)
361375
}
362376
}
363-
364-
// MARK: - "Info" Section
365-
366-
@ViewBuilder
367-
private var infoSection: some View {
368-
if viewModel.lastEditedText != nil || viewModel.postID != nil {
369-
Section {
370-
if let postID = viewModel.postID {
371-
SettingsRow(Strings.postIDLabel, value: String(postID))
372-
}
373-
if let lastEditedText = viewModel.lastEditedText {
374-
SettingsRow(Strings.lastEditedLabel, value: lastEditedText)
375-
}
376-
} header: {
377-
SectionHeader(Strings.infoLabel)
378-
}
379-
}
380-
}
381377
}
382378

383379
@MainActor

WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension PrepublishingViewController {
1717
// - warning: Has to be UIKit because some of the `PostSettingsView` rows rely on it.
1818
let navigationVC = UINavigationController(rootViewController: publishVC)
1919
navigationVC.sheetPresentationController?.detents = [
20-
.custom(identifier: .medium, resolver: { context in 456 }),
20+
.custom(identifier: .medium, resolver: { context in 460 }),
2121
.large()
2222
]
2323
presentingViewController.present(navigationVC, animated: true)

0 commit comments

Comments
 (0)