Эх сурвалжийг харах

Add a bordered panel boundary around the Post Generator content area.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 сар өмнө
parent
commit
bdf130455f

+ 19 - 0
Reddit App/Views/Components/PostGeneratorComponents.swift

@@ -2,6 +2,25 @@ import AppKit
 import SwiftUI
 import UniformTypeIdentifiers
 
+// MARK: - Page Boundary
+
+struct PostPageBoundary<Content: View>: View {
+    @ViewBuilder let content: Content
+
+    var body: some View {
+        content
+            .padding(20)
+            .background(
+                RoundedRectangle(cornerRadius: AppTheme.cornerRadius)
+                    .fill(AppTheme.panelBackground)
+            )
+            .overlay(
+                RoundedRectangle(cornerRadius: AppTheme.cornerRadius)
+                    .stroke(AppTheme.cardBorder, lineWidth: 1)
+            )
+    }
+}
+
 // MARK: - Shared Form Components
 
 struct PostFormCard<Content: View>: View {

+ 10 - 9
Reddit App/Views/PostGeneratorView.swift

@@ -11,12 +11,17 @@ struct PostGeneratorView: View {
             tabBar
 
             ScrollView {
-                switch viewModel.selectedTab {
-                case .compose:
-                    composeContent
-                case .preview:
-                    previewContent
+                PostPageBoundary {
+                    switch viewModel.selectedTab {
+                    case .compose:
+                        composeContent
+                    case .preview:
+                        previewContent
+                    }
                 }
+                .padding(.horizontal, 24)
+                .padding(.top, 8)
+                .padding(.bottom, 24)
             }
         }
         .background(AppTheme.background)
@@ -141,8 +146,6 @@ struct PostGeneratorView: View {
             configurationPanel
             editorPanel
         }
-        .padding(24)
-        .padding(.top, 8)
     }
 
     private var configurationPanel: some View {
@@ -494,8 +497,6 @@ struct PostGeneratorView: View {
 
             previewMetadata
         }
-        .padding(24)
-        .padding(.top, 8)
         .frame(maxWidth: 560)
         .frame(maxWidth: .infinity)
     }