From 1f438d0fe55fa8ab91c069578318150dbe7a49a6 Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 16 Nov 2022 21:11:02 -0500 Subject: [PATCH] update liveview --- lib/memex_web.ex | 4 +- lib/memex_web/components/topbar.ex | 98 ++++++++++------- .../live/context_live/form_component.ex | 4 +- .../context_live/form_component.html.heex | 2 +- .../live/context_live/index.html.heex | 28 +++-- .../live/context_live/show.html.heex | 11 +- lib/memex_web/live/home_live.html.heex | 60 +++++----- lib/memex_web/live/init_assigns.ex | 2 +- .../live/invite_live/form_component.ex | 4 +- .../live/invite_live/form_component.html.heex | 2 +- lib/memex_web/live/invite_live/index.ex | 2 +- .../live/invite_live/index.html.heex | 103 +++++++++--------- lib/memex_web/live/live_helpers.ex | 35 +++--- .../live/note_live/form_component.ex | 4 +- .../live/note_live/form_component.html.heex | 2 +- lib/memex_web/live/note_live/index.html.heex | 30 +++-- lib/memex_web/live/note_live/show.html.heex | 11 +- .../live/pipeline_live/form_component.ex | 4 +- .../pipeline_live/form_component.html.heex | 2 +- .../live/pipeline_live/index.html.heex | 28 +++-- .../live/pipeline_live/show.html.heex | 11 +- lib/memex_web/templates/layout/root.html.heex | 5 +- .../templates/user_confirmation/new.html.heex | 16 ++- .../templates/user_registration/new.html.heex | 16 ++- .../user_reset_password/edit.html.heex | 16 ++- .../user_reset_password/new.html.heex | 16 ++- .../templates/user_session/new.html.heex | 16 ++- .../templates/user_settings/edit.html.heex | 20 ++-- lib/memex_web/views/error_helpers.ex | 2 +- lib/memex_web/views/view_helpers.ex | 18 ++- mix.exs | 14 +-- mix.lock | 49 +++++---- 32 files changed, 362 insertions(+), 273 deletions(-) diff --git a/lib/memex_web.ex b/lib/memex_web.ex index 1eacaf4..bb8ed1d 100644 --- a/lib/memex_web.ex +++ b/lib/memex_web.ex @@ -45,7 +45,7 @@ defmodule MemexWeb do def live_view do quote do use Phoenix.LiveView, - layout: {MemexWeb.LayoutView, "live.html"} + layout: {MemexWeb.LayoutView, :live} on_mount MemexWeb.InitAssigns unquote(view_helpers()) @@ -91,7 +91,7 @@ defmodule MemexWeb do use Phoenix.HTML # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc) - import Phoenix.LiveView.Helpers + import Phoenix.Component import MemexWeb.LiveHelpers # Import basic rendering functionality (render, render_layout, etc) diff --git a/lib/memex_web/components/topbar.ex b/lib/memex_web/components/topbar.ex index 0e2253a..bc4d57f 100644 --- a/lib/memex_web/components/topbar.ex +++ b/lib/memex_web/components/topbar.ex @@ -16,10 +16,12 @@ defmodule MemexWeb.Components.Topbar do