Skip to content

Commit

Permalink
fix: Fix livebook update issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMLG-BOT committed Mar 4, 2023
1 parent 82de3d1 commit 376233f
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 50 deletions.
@@ -1,36 +1,61 @@
<main class="px-4 sm:px-6 lg:px-8">
<div class="mx-auto max-w-screen-2xl">
<.flash kind={:info} title="Success!" flash={@flash} />
<.flash kind={:error} title="Error!" flash={@flash} />
<.flash
id="disconnected"
kind={:error}
title="We can't find the internet"
close={false}
autoshow={false}
phx-disconnected={show("#disconnected")}
phx-connected={hide("#disconnected")}
>
Attempting to reconnect <.wc_bsi name="arrow-repeat" class="ml-1 w-3 h-3 inline animate-spin" />
</.flash>
<.wc_left_menu
class="w-48 h-[calc(100vh-56px)]"
active={"phx-wc-hook"}
menus={[
{"Hooks", [
{"phx-wc-hook", "PhxWCHook", "/"}
]},
{"Components",
[
{"actionbar", "Actionbar", "/storybook/components/actionbar"},
{"card", "Card", "/storybook/components/card"},
{"left_menu", "Left Menu", "/storybook/components/left_menu"},
{"markdown", "Markdown", "/storybook/components/markdown"},
{"pagination", "Pagination", "/storybook/components/pagination"},
{"table", "Table", "/storybook/components/table"}
]}
]}
/>
<%= @inner_content %>
<main class="container h-[calc(100vh-56px)] flex flex-row justify-start items-start overflow-hidden">
<.flash kind={:info} title="Success!" flash={@flash} />
<.flash kind={:error} title="Error!" flash={@flash} />
<.flash
id="disconnected"
kind={:error}
title="We can't find the internet"
close={false}
autoshow={false}
phx-disconnected={show("#disconnected")}
phx-connected={hide("#disconnected")}
>
Attempting to reconnect <.wc_bsi name="arrow-repeat" class="ml-1 w-3 h-3 inline animate-spin" />
</.flash>
<.wc_left_menu
class="w-48 h-[calc(100vh-56px)] bg-slate-100"
active={assigns[:active_menu]}
>
<:title class="text-slate-400 font-bold">
WebComponent
</:title>
<:menu>
<.wc_left_menu_group active={assigns[:active_menu]}>
<:title>Hooks</:title>
<:menu id="phx-wc-hook" to={"/"}>
<.wc_mdi name={"webhook"} class="w-4 h-4" />
PhxWCHook
</:menu>
</.wc_left_menu_group>
</:menu>
<:menu>
<.wc_left_menu_group active={assigns[:active_menu]}>
<:title>Icons</:title>
<:menu id="mdi" to={"/mdi"}>
<.wc_mdi name={"material-design"} class="w-4 h-4" />
MD Icon
</:menu>
<:menu id="bsi" to={"/bsi"}>
<.wc_bsi name={"bootstrap"} class="w-4 h-4" />
BS Icon
</:menu>
</.wc_left_menu_group>
</:menu>
<:menu>
<.wc_left_menu_group active={assigns[:active_menu]}>
<:title>Components</:title>
<:menu id="actionbar" to="/storybook/components/actionbar"><.wc_bsi name={"tools"} class="w-4 h-4" />Actionbar</:menu>
<:menu id="breadcrumb" to="/storybook/components/breadcrumb"><.wc_bsi name={"segmented-nav"} class="w-4 h-4" />Breadcrumb</:menu>
<:menu id="card" to="/storybook/components/card"><.wc_bsi name={"card-text"} class="w-4 h-4" />Card</:menu>
<:menu id="left_menu" to="/storybook/components/left_menu"><.wc_bsi name={"layout-sidebar"} class="w-4 h-4" />Left Menu</:menu>
<:menu id="markdown" to="/storybook/components/markdown"><.wc_bsi name={"markdown"} class="w-4 h-4" />Markdown</:menu>
<:menu id="modal" to="/storybook/components/modal"><.wc_bsi name={"chat-square"} class="w-4 h-4" />Modal</:menu>
<:menu id="pagination" to="/storybook/components/pagination"><.wc_mdi name={"book-open-page-variant-outline"} class="w-4 h-4" />Pagination</:menu>
<:menu id="table" to="/storybook/components/table"><.wc_mdi name={"table"} class="w-4 h-4" />Table</:menu>
</.wc_left_menu_group>
</:menu>
</.wc_left_menu>
<div class="flex flex-col flex-auto">
<%= @inner_content %>
</div>
</main>
@@ -1,32 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="csrf-token" content={get_csrf_token()} />
<.live_title suffix=" · PhxWCStorybook">
<%= assigns[:page_title] || "PhxWCStorybook" %>
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script>
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}></script>
</head>
<body class="bg-white antialiased flex flex-col items-center">
<body class="flex flex-col items-center">
<div class="rainbow"></div>
<%= if assigns[:mode] == "app" do %>
<.wc_simple_appbar
title={"Phoenix WebComponent"}
menus={[
%{ label: "Component Storybook", to: ~p"/storybook" }
]}
>
<:logo>
<logo-gsmlg-dev />
</:logo>
<:user_profile>
<.wc_link href={"https://github.com/gsmlg-dev/phoenix_webcomponent"}>
<.wc_mdi name="github" class="w-12 h-12" color="white" />
</.wc_link>
</:user_profile>
</.wc_simple_appbar>
<% else %>
<.wc_appbar
title={"Phoenix WebComponent"}
menus={[
%{ label: "Component Storybook", to: ~p"/" }
%{ label: "Component Storybook", to: ~p"/storybook" }
]}
>
<:logo>
<logo-gsmlg-dev />
</:logo>
<:user_profile>
(^_^)
<.wc_link href={"https://github.com/gsmlg-dev/phoenix_webcomponent"}>
<.wc_mdi name="github" class="w-12 h-12" color="white" />
</.wc_link>
</:user_profile>
</.wc_appbar>

<% end %>
<%= @inner_content %>
</body>
</html>
Expand Up @@ -17,12 +17,12 @@ defmodule PhxWCStorybookWeb.PageController do
Regex.match?(reg, n)
end)

render(conn, "mdi.html", mdi_icons: icons, active_menu: "mdi")
render(conn, "mdi.html", mdi_icons: icons, active_menu: "mdi", filter: filter)
end

def mdi(conn, _params) do
icons = Phoenix.WebComponent.Icons.mdi_icons()
render(conn, "mdi.html", mdi_icons: icons, active_menu: "mdi")
render(conn, "mdi.html", mdi_icons: icons, active_menu: "mdi", filter: "")
end

def bsi(conn, %{"filter" => filter}) do
Expand All @@ -33,11 +33,11 @@ defmodule PhxWCStorybookWeb.PageController do
Regex.match?(reg, n)
end)

render(conn, "bsi.html", bsi_icons: icons, active_menu: "bsi")
render(conn, "bsi.html", bsi_icons: icons, active_menu: "bsi", filter: filter)
end

def bsi(conn, _params) do
icons = Phoenix.WebComponent.Icons.bsi_icons()
render(conn, "bsi.html", bsi_icons: icons, active_menu: "bsi")
render(conn, "bsi.html", bsi_icons: icons, active_menu: "bsi", filter: "")
end
end
Expand Up @@ -17,8 +17,8 @@
```
"""}></.wc_markdown>
<div class="flex flex-row mt-4 mb-2">
<.form for={@conn} action={Routes.page_path(@conn, :bsi)} method="get" class={["flex flex-row gap-2"]}>
<.input field={:filter} label="Icon Name" />
<.form for={@conn} action={~p"/bsi"} method="get" class={["flex flex-row gap-2"]}>
<.input field={:filter} label="Icon Name" name="filter" value={@filter} />
<.button type="submit">Search</.button>
</.form>
</div>
Expand Down
Expand Up @@ -17,8 +17,8 @@
```
"""}></.wc_markdown>
<div class="flex flex-row mt-4 mb-2">
<.form for={@conn} action={Routes.page_path(@conn, :mdi)} method="get" class={["flex flex-row gap-2"]}>
<.input field={:filter} label="Icon Name" />
<.form for={@conn} action={~p"/mdi"} method="get" class={["flex flex-row gap-2"]}>
<.input field={:filter} label="Icon Name" name="filter" value={@filter} />
<.button type="submit">Search</.button>
</.form>
</div>
Expand Down

0 comments on commit 376233f

Please sign in to comment.