Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support phoenix_root_layout without "html" #108

Closed
wants to merge 1 commit into from

Conversation

mayel
Copy link

@mayel mayel commented Dec 17, 2023

resolves an issue with the swift rendered inside the html template

@mayel
Copy link
Author

mayel commented Dec 17, 2023

even with this fix, I need to add <csrf-token value={Phoenix.Controller.get_csrf_token()} /> to my SWIFTUI code otherwise I'm back to the connection error in #107 because it's not being included in the root layout, seems its this condition not matching in LiveViewNative.Layouts:
is_root_template? = "#{func_name}" == "root_#{platform.platform_id}"

@mayel
Copy link
Author

mayel commented Jan 20, 2024

any word on this to avoid the HTML layout being rendered when native one is expected? 🙏

@bcardarella
Copy link
Contributor

@mayel sorry I didn't respond sooner. v0.3.0 is nearing a beta release and we'll have instructions for setting up your app. This PR is resolved with this release as you can now set your own root in your Router:

plug :put_root_layout,
      html: {LvnWorkshopWeb.Layouts, :root},
      swiftui: {LvnWorkshopWeb.Layouts.SwiftUI, :root}

Thanks for the contribution, sorry it didn't make it in!

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.

None yet

2 participants