-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
_map.html.erb
23 lines (23 loc) · 1.5 KB
/
_map.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<% if application.location %>
<%# Only using map class here to help target accessibility tests in rspec/features/comment_to_authority_spec.rb %>
<div class="flex justify-between map">
<div class="<%= class_names("w-full", "sm:h-[528px]", "aspect-1", "h-auto", "xl:w-[528px]" => !Flipper.enabled?(:disable_streetview_in_app, current_user)) %>">
<%= render Tailwind::Map.new(lat: application.lat, lng: application.lng, address: application.address, zoom: 16) do %>
<%= google_static_map(application, size: "528x528") %>
<% end %>
</div>
<%# TODO: Don't show pano if there's no useful streetview available %>
<% unless Flipper.enabled?(:disable_streetview_in_app, current_user) %>
<div x-data class="hidden xl:block w-[528px] h-[528px]">
<%= render Tailwind::Streetview.new(lat: application.lat, lng: application.lng, address: application.address) do %>
<%# Note that the "Disable Javascript" extension for firefox and chrome has a bug in it where it doesn't show
the second noscript when js is disabled https://github.com/dpacassi/disable-javascript/issues/79#issuecomment-743995262.
However, when you turn off javascript in the browser settings it does show the contents
of the second noscript. This is very confusing and sent me down a long rabbit-hole trying to figure out what
was going on. %>
<%= google_static_streetview(application, size: "528x528") %>
<% end %>
</div>
<% end %>
</div>
<% end %>