MyGit

fremantle-industries/navigator

Fork: 2 Star: 17 (更新于 2024-09-19 15:21:03)

license: MIT

Language: Elixir .

Global navigation between multiple Phoenix endpoints

GitHub网址

Navigator

Build Status hex.pm version

Global navigation between multiple Phoenix endpoints, tailwindcss friendly

navigation

Installation

Add the navigator package to your list of dependencies in mix.exs:

def deps do
  [
    {:navigator, "~> 0.0.8"}
  ]
end

Usage

Configure the navigation links in config/config.exs

# config/config.exs
use Mix.Config

config :navigator,
  links: %{
    storefront: [
      %{
        label: "Storefront Home",
        to: {StorefrontWeb.Router.Helpers, :home_path, [StorefrontWeb.Endpoint, :index]},
        class: "text-4xl"
      },
      %{
        label: "Orders",
        to: {StorefrontWeb.Router.Helpers, :order_path, [StorefrontWeb.Endpoint, :index]}
      },
      %{
        label: "Admin",
        to: {AdminWeb.Router.Helpers, :home_url, [AdminWeb.Endpoint, :index]}
      }
    ],
    admin: [
      %{
        label: "Admin Home",
        to: {AdminWeb.Router.Helpers, :home_path, [AdminWeb.Endpoint, :index]},
        class: "text-4xl"
      },
      %{
        label: "Order Admin",
        to: {AdminWeb.Router.Helpers, :order_path, [AdminWeb.Endpoint, :index]}
      },
    ]
  }

Render the navigation in your phoenix templates

<%= render Navigator, "horizontal.html", conn: @conn %>

Authors

License

navigator is released under the MIT license

最近版本更新:(数据更新于 2024-09-21 20:10:57)

fremantle-industries/navigator同语言 Elixir最近更新仓库

2024-09-07 03:11:29 firezone/firezone

2024-07-10 14:43:27 teslamate-org/teslamate

2024-07-07 05:20:46 elixir-lang/elixir

2024-04-11 02:26:13 zoonk/zoonk

2020-06-26 19:06:09 phoenixframework/phoenix

2020-06-04 03:23:12 phoenixframework/phoenix_live_dashboard