|
|
@@ -5,7 +5,6 @@ import UniformTypeIdentifiers
|
|
|
struct PostGeneratorView: View {
|
|
|
@Environment(\.requirePremiumAccess) private var requirePremiumAccess
|
|
|
@Bindable var viewModel: PostGeneratorViewModel
|
|
|
- var onPostToReddit: (URL) -> Void = { _ in }
|
|
|
|
|
|
private enum Layout {
|
|
|
static let horizontalPadding: CGFloat = 24
|
|
|
@@ -143,15 +142,6 @@ struct PostGeneratorView: View {
|
|
|
.buttonStyle(AppSecondaryButtonStyle())
|
|
|
.disabled(!viewModel.canExport)
|
|
|
|
|
|
- Button {
|
|
|
- viewModel.postToReddit(openURL: onPostToReddit)
|
|
|
- } label: {
|
|
|
- Label("Post to Reddit", systemImage: "arrow.up.right.square")
|
|
|
- .font(.system(size: 11, weight: .medium))
|
|
|
- }
|
|
|
- .buttonStyle(AppSecondaryButtonStyle())
|
|
|
- .disabled(!viewModel.canExport)
|
|
|
-
|
|
|
Button {
|
|
|
guard requirePremiumAccess() else { return }
|
|
|
Task { await viewModel.generatePost() }
|
|
|
@@ -665,20 +655,6 @@ struct PostGeneratorView: View {
|
|
|
)
|
|
|
|
|
|
previewMetadata
|
|
|
-
|
|
|
- Button {
|
|
|
- viewModel.postToReddit(openURL: onPostToReddit)
|
|
|
- } label: {
|
|
|
- Label("Post to Reddit", systemImage: "arrow.up.right.square")
|
|
|
- .font(.system(size: 12, weight: .semibold))
|
|
|
- .foregroundStyle(.white)
|
|
|
- .frame(maxWidth: .infinity)
|
|
|
- .padding(.vertical, 10)
|
|
|
- .background(viewModel.canExport ? AppTheme.accentPurple : AppTheme.accentPurple.opacity(0.4))
|
|
|
- .clipShape(RoundedRectangle(cornerRadius: 8))
|
|
|
- }
|
|
|
- .buttonStyle(AppPrimaryButtonStyle())
|
|
|
- .disabled(!viewModel.canExport)
|
|
|
}
|
|
|
.frame(maxWidth: 560)
|
|
|
|