Skip to content

Commit

Permalink
use kino live view
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Nov 13, 2024
1 parent d288e70 commit 9f0057d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
4 changes: 2 additions & 2 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if ("outerHTML" in SVGElement.prototype) {
// breakpoints defined in assets/css/_variables.scss
const breakpoints = { xs: 0, sm: 544, md: 800, lg: 1088, xxl: 1344 };

submitOnEvents(["blur", "change"]);
/* submitOnEvents(["blur", "change"]);
googleAnalytics();
setupGlobalNavigation();
collapse();
Expand Down Expand Up @@ -159,4 +159,4 @@ previousEventsButton();
pslPageSetup();
accordionInit();
mobileAppBanner();
mobileAppBanner(); */
5 changes: 5 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ import Config

config :dotcom, :cache, Dotcom.Cache.Multilevel
config :dotcom, :trip_plan_feedback_cache, Dotcom.Cache.TripPlanFeedback.Cache

config :kino_live_component,
css_path: "http://localhost:8090/app.css",
endpoint: "http://localhost:4001/kino-live-component",
js_path: "http://localhost:8090/app.js"
10 changes: 10 additions & 0 deletions lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ defmodule DotcomWeb.Router do
end
end

import KinoLiveComponent.Plug, only: [allow_insecure_connection: 2]

if Mix.env() == :dev do
scope "/kino-live-component", KinoLiveComponent do
pipe_through([:allow_insecure_connection])

live("/", Live.Index)
end
end

scope "/preview", DotcomWeb do
import Phoenix.LiveView.Router
pipe_through([:browser, :browser_live, :basic_auth])
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ defmodule DotCom.Mixfile do
{:httpoison, "2.2.1"},
{:inflex, "2.1.0"},
{:jason, "1.4.4", override: true},
{:kino_live_component, "0.0.3"},
{:logster, "1.1.1"},
{:mail, "0.4.1"},
{:mbta_metro, "0.0.54"},
Expand Down
Loading

0 comments on commit 9f0057d

Please sign in to comment.