Skip to content

Conversation

mikhailChelbaev
Copy link
Collaborator

Previously, if the content's width was smaller than the modal's width, it would align to the left. With this fix, the content now uses the full available width and centers itself.

Here's a sample code to test it:

struct App: View {
  @State var isModalPresented = false
  
  var body: some View {
    SUButton(model: .init {
      $0.title = "Show Modal"
    }) {
      isModalPresented = true
    }
    .bottomModal(
      isPresented: $isModalPresented,
      model: .init(),
      header: {
        Text("Header")
      },
      body: {
        Text("Body content goes here")
      },
      footer: {
        SUButton(model: .init {
          $0.title = "Close"
        }) {
          isModalPresented = false
        }
      }
    )
  }
}

@mikhailChelbaev mikhailChelbaev self-assigned this Mar 28, 2025
@mikhailChelbaev mikhailChelbaev merged commit fa88454 into dev Mar 28, 2025
1 check passed
@mikhailChelbaev mikhailChelbaev deleted the fix-sumodal-layout branch March 28, 2025 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants