Skip to content

Commit

Permalink
increase code editor size for events, schema, and variants
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Sep 13, 2023
1 parent cad9b47 commit 37679ae
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
18 changes: 10 additions & 8 deletions lib/beacon/live_admin/live/page_editor_live/event_handlers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,16 @@ defmodule Beacon.LiveAdmin.PageEditorLive.EventHandlers do
<.button type="button" phx-click="delete" class="w-1/12 uppercase">Delete</.button>
</.form>
<div class="w-full mt-10 space-y-8">
<div class="py-6 rounded-[1.25rem] bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor
path="event_handler_code"
class="h-full col-span-full lg:col-span-2"
value={@selected.code}
opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => "elixir"})}
/>
<div class="lg:h-[calc(100vh_-_144px)] mx-auto mt-10 lg:mx-0 lg:max-w-none">
<div class="h-full col-span-full lg:col-span-2">
<div class="py-6 w-full h-full rounded-[1.25rem] lg:rounded-t-[1.25rem] lg:rounded-b-none bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor
path="event_handler_code"
class="h-full col-span-full lg:col-span-2"
value={@selected.code}
opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => "elixir"})}
/>
</div>
</div>
</div>
</div>
Expand Down
10 changes: 6 additions & 4 deletions lib/beacon/live_admin/live/page_editor_live/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ defmodule Beacon.LiveAdmin.PageEditorLive.Schema do
</:actions>
</.header>
<div class="w-full mt-10 space-y-8">
<div class="py-6 rounded-[1.25rem] bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor path="raw_schema" class="h-full col-span-full lg:col-span-2" value={@raw_schema} opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => "json"})} />
<div class="lg:h-[calc(100vh_-_144px)] mx-auto mt-10 lg:mx-0 lg:max-w-none">
<div class="h-full col-span-full lg:col-span-2">
<div class="py-6 w-full h-full rounded-[1.25rem] lg:rounded-t-[1.25rem] lg:rounded-b-none bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor path="raw_schema" class="h-full col-span-full lg:col-span-2" value={@raw_schema} opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => "json"})} />
</div>
</div>
<.error :for={msg <- Enum.map(@form[:raw_schema].errors, &translate_error/1)}><%= msg %></.error>
</div>
<.error :for={msg <- Enum.map(@form[:raw_schema].errors, &translate_error/1)}><%= msg %></.error>
</div>
"""
end
Expand Down
19 changes: 11 additions & 8 deletions lib/beacon/live_admin/live/page_editor_live/variants.ex
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,17 @@ defmodule Beacon.LiveAdmin.PageEditorLive.Variants do
<.button type="button" phx-click="delete" class="w-1/12 uppercase">Delete</.button>
</.form>
<%= template_error(@form[:template]) %>
<div class="w-full mt-10 space-y-8">
<div class="py-6 rounded-[1.25rem] bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor
path="variant"
class="h-full col-span-full lg:col-span-2"
value={@selected.template}
opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => @language})}
/>
<div class="lg:h-[calc(100vh_-_144px)] mx-auto mt-10 lg:mx-0 lg:max-w-none">
<div class="h-full col-span-full lg:col-span-2">
<div class="py-6 w-full h-full rounded-[1.25rem] lg:rounded-t-[1.25rem] lg:rounded-b-none bg-[#0D1829] [&_.monaco-editor-background]:!bg-[#0D1829] [&_.margin]:!bg-[#0D1829]">
<LiveMonacoEditor.code_editor
path="variant"
class="h-full col-span-full lg:col-span-2"
value={@selected.template}
opts={Map.merge(LiveMonacoEditor.default_opts(), %{"language" => @language})}
/>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 37679ae

Please sign in to comment.