From 79f72c92b32741a4df145cef16a727fccca847f3 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Tue, 15 Sep 2026 09:57:06 +0300 Subject: [PATCH] native platform prop --- app/controllers/application_controller.rb | 7 +++- app/javascript/application.js | 3 +- app/javascript/template_builder/builder.vue | 33 ++++++++----------- .../template_builder/field_context_menu.vue | 6 ++-- .../template_builder/field_settings.vue | 6 ++-- app/javascript/template_builder/fields.vue | 4 +-- .../template_builder/payment_settings.vue | 6 ++-- .../selection_context_menu.vue | 4 +-- app/views/templates/edit.html.erb | 2 +- app/views/templates_preview/show.html.erb | 2 +- 10 files changed, 36 insertions(+), 37 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3e74b38fe..6f211f994 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -20,7 +20,8 @@ class ApplicationController < ActionController::Base :true_ability, :form_link_host, :svg_icon, - :turbo_native_ios? + :turbo_native_ios?, + :turbo_native_android? impersonates :user, with: ->(uuid) { User.find_by(uuid:) } @@ -73,6 +74,10 @@ class ApplicationController < ActionController::Base request.user_agent.to_s.include?('Hotwire Native iOS') end + def turbo_native_android? + request.user_agent.to_s.include?('Hotwire Native Android') + end + def with_locale(&) return yield unless current_account diff --git a/app/javascript/application.js b/app/javascript/application.js index 95911c0e5..d93919ff0 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -233,8 +233,7 @@ safeRegisterElement('template-builder', class extends HTMLElement { currencies: (this.dataset.currencies || '').split(',').filter(Boolean), acceptFileTypes: this.dataset.acceptFileTypes, showTourStartForm: this.dataset.showTourStartForm === 'true', - nativeApp: this.dataset.nativeApp === 'true', - nativeIos: this.dataset.nativeIos === 'true' + nativePlatform: this.dataset.nativePlatform }) this.component = this.app.mount(this.appElem) diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index af3780022..00b98851b 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -78,7 +78,7 @@ v-if="$slots.buttons || withTitle" id="title_container" class="flex justify-between py-1.5 items-center pr-4 top-0 z-10 title-container" - :class="{ sticky: withStickySubmitters || isBreakpointLg, hidden: nativeApp }" + :class="{ sticky: withStickySubmitters || isBreakpointLg, hidden: !!nativePlatform }" :style="{ backgroundColor }" >
@@ -104,7 +104,7 @@ />