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

Sync prod with master #109

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions lib/vyasa_web/components/contexts/read.ex
Original file line number Diff line number Diff line change
Expand Up @@ -417,21 +417,7 @@ defmodule VyasaWeb.Context.Read do
def render(assigns) do
~H"""
<div id={@id}>
Hello world, i'm the ReadContext <br />
Session: <%= @session && @session.name %> Sangh: <%= @session && @session.sangh &&
@session.sangh.id %> <br />
<%= @user_mode.mode_context_component %>
<%= @user_mode.mode_context_component_selector %>
<.button phx-click="foo" phx-target={@myself}>
FOO
</.button>
<br />
<%= @user_mode.mode %> mode <br />
<br />
<br />
<br />
<br />
<br />
<.debug_dump session={@session} user_mode={@user_mode} />
<!-- CONTENT DISPLAY: -->
<div id="content-display" class="mx-auto max-w-2xl pb-16">
<%= if @content_action == :show_sources do %>
Expand Down Expand Up @@ -534,4 +520,25 @@ defmodule VyasaWeb.Context.Read do
defp sync_draft_reflector(%{assigns: %{session: _}} = socket) do
socket
end

def debug_dump(assigns) do
~H"""
<div
:if={Mix.env() == :dev}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if unquote(Mix.env == :dev) do # would compile to true or false
  # ...
else
  # ...
end

class="fixed top-0 left-0 m-4 p-4 bg-white border border-gray-300 rounded-lg shadow-lg max-w-md max-h-80 overflow-auto z-50"
>
<h2 class="text-lg font-bold mb-2">Developer Dump</h2>
<div class="mb-4">
<strong class="text-gray-600">Session:</strong> <%= @session && @session.name %><br />
<strong class="text-gray-600">Sangh ID:</strong> <%= @session && @session.sangh &&
@session.sangh.id %><br />
<strong class="text-gray-600">User Mode:</strong> <%= @user_mode.mode_context_component %> | <%= @user_mode.mode_context_component_selector %> | <%= @user_mode.mode %> mode
</div>
<div>
<h3 class="text-md font-bold mb-2">Parameters:</h3>
<pre class="bg-gray-100 p-2 rounded-md whitespace-pre-wrap"><%= inspect(Map.drop(assigns, [:session, :user_mode]), pretty: true) %></pre>
</div>
</div>
"""
end
end