From 5c079032d1f34ab988f134e7151a31b34b99c72c Mon Sep 17 00:00:00 2001 From: Mathias Polligkeit Date: Sat, 16 Dec 2023 13:45:04 +0900 Subject: [PATCH] add svgs to stories --- .../storybook/components/action_bar.story.exs | 76 +++++++++++++++++-- priv/storybook/components/app_bar.story.exs | 71 ++++++++++++++++- 2 files changed, 137 insertions(+), 10 deletions(-) diff --git a/priv/storybook/components/action_bar.story.exs b/priv/storybook/components/action_bar.story.exs index 0a6c1e15..cde5c894 100644 --- a/priv/storybook/components/action_bar.story.exs +++ b/priv/storybook/components/action_bar.story.exs @@ -3,28 +3,90 @@ defmodule Storybook.Components.ActionBar do def function, do: &Doggo.action_bar/1 + def edit_svg do + """ + + """ + end + + def move_svg do + """ + + """ + end + + def archive_svg do + """ + + """ + end + def variations do [ %Variation{ id: :default, - description: """ - Note that the actual icons have been omitted from this example, - since Doggo does not ship with a default icon library. - """, slots: [ """ <:item label="Edit" on_click={JS.push("edit")}> - Edit + + #{edit_svg()} + """, """ <:item label="Move" on_click={JS.push("move")}> - Move + + #{move_svg()} + """, """ <:item label="Archive" on_click={JS.push("archive")}> - Archive + + #{archive_svg()} + """ ] diff --git a/priv/storybook/components/app_bar.story.exs b/priv/storybook/components/app_bar.story.exs index 9b5f0ac9..4525755b 100644 --- a/priv/storybook/components/app_bar.story.exs +++ b/priv/storybook/components/app_bar.story.exs @@ -3,6 +3,71 @@ defmodule Storybook.Components.AppBar do def function, do: &Doggo.app_bar/1 + def menu_svg do + """ + + """ + end + + def search_svg do + """ + + """ + end + + def like_svg do + """ + + """ + end + def variations do [ %Variation{ @@ -17,17 +82,17 @@ defmodule Storybook.Components.AppBar do slots: [ """ <:navigation label="Open menu" on_click={JS.push("toggle-menu")}> - Menu + #{menu_svg()} """, """ <:action label="Search" on_click={JS.push("search")}> - Search + #{search_svg()} """, """ <:action label="Like" on_click={JS.push("like")}> - Like + #{like_svg()} """ ]