Skip to content

Commit 2796a8e

Browse files
committed
Address PR #1749 review B4/B5 — JS export and demo ThemePlug cleanup
- B4: export BackpexPreferences as named export in JS bundle so the custom.* recipe in the guide works when copy-pasted - B5: remove DemoWeb.ThemePlug (replaced by Backpex.InitAssigns); demo now mirrors the upgrade guide's instructions
1 parent 6ef165d commit 2796a8e

9 files changed

Lines changed: 12 additions & 25 deletions

File tree

assets/js/backpex.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import * as Hooks from './hooks'
22

33
export { Hooks }
4+
export { BackpexPreferences } from './hooks/_preferences'

assets/js/hooks/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ export { default as BackpexStickyActions } from './_sticky_actions'
66
export { default as BackpexThemeSelector } from './_theme_selector'
77
export { default as BackpexTooltip } from './_tooltip'
88
export { default as BackpexCurrencyInput } from './_currency_input'
9+
10+
export { BackpexPreferences } from './_preferences'

demo/lib/demo_web/components/layouts/root.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" class="[scrollbar-gutter:stable] h-full" data-theme={assigns[:theme] || "light"}>
2+
<html lang="en" class="[scrollbar-gutter:stable] h-full" data-theme={assigns[:current_theme] || "light"}>
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />

demo/lib/demo_web/plugs/theme_plug.ex

Lines changed: 0 additions & 19 deletions
This file was deleted.

demo/lib/demo_web/router.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ defmodule DemoWeb.Router do
1111
plug :put_root_layout, {DemoWeb.Layouts, :root}
1212
plug :protect_from_forgery
1313
plug :put_secure_browser_headers
14-
plug DemoWeb.ThemePlug
1514
end
1615

1716
scope "/", DemoWeb do

priv/static/js/backpex.cjs.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/js/backpex.cjs.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/js/backpex.esm.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/js/backpex.esm.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)