Skip to content

Commit

Permalink
add story for navbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie committed Dec 16, 2023
1 parent 5c07903 commit 74002cc
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/doggo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ defmodule Doggo do
</Doggo.navbar_items>
<Doggo.navbar_items class="navbar-user-menu">
<:item>
<.link navigate={~p"/login"} class="button">Log in</.link>
<.button_link navigate={~p"/login"}>Log in</button_link>
</:item>
</Doggo.navbar_items>
</Doggo.navbar>
Expand Down
72 changes: 72 additions & 0 deletions priv/storybook/components/navbar.story.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
defmodule Storybook.Components.Navbar do
use PhoenixStorybook.Story, :component

def function, do: &Doggo.navbar/1

def variations do
[
%Variation{
id: :default,
slots: [
"""
<:brand>
<Phoenix.Component.link navigate="/">
Pet Clinic
</Phoenix.Component.link>
</:brand>
""",
"""
<Doggo.navbar_items>
<:item>
<Phoenix.Component.link navigate="/about">
About
</Phoenix.Component.link>
</:item>
<:item>
<Phoenix.Component.link navigate="/services">
services
</Phoenix.Component.link>
</:item>
<:item>
<Phoenix.Component.link navigate="/login">
Log in
</Phoenix.Component.link>
</:item>
</Doggo.navbar_items>
"""
]
},
%Variation{
id: :multiple_navigation_sections,
slots: [
"""
<:brand>
<Phoenix.Component.link navigate="/">
Pet Clinic
</Phoenix.Component.link>
</:brand>
""",
"""
<Doggo.navbar_items>
<:item>
<Phoenix.Component.link navigate="/about">
About
</Phoenix.Component.link>
</:item>
<:item>
<Phoenix.Component.link navigate="/services">
services
</Phoenix.Component.link>
</:item>
</Doggo.navbar_items>
<Doggo.navbar_items>
<:item>
<Doggo.button_link navigate="/login">Log in</Doggo.button_link>
</:item>
</Doggo.navbar_items>
"""
]
}
]
end
end

0 comments on commit 74002cc

Please sign in to comment.