Skip to content

Commit

Permalink
add story for fallback component
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie committed Dec 13, 2023
1 parent b934485 commit fea6356
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions priv/storybook/components/fallback.story.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
defmodule Storybook.Components.Fallback do
use PhoenixStorybook.Story, :component

def function, do: &Doggo.fallback/1

def variations do
[
%VariationGroup{
id: :default,
variations: [
%Variation{
id: :with_value,
attributes: %{value: "George"}
},
%Variation{
id: :with_nil,
attributes: %{value: nil}
}
]
},
%VariationGroup{
id: :with_formatter,
variations: [
%Variation{
id: :with_value,
attributes: %{
value: ~U[2032-06-02 08:20:04Z],
formatter: &DateTime.to_unix/1
}
},
%Variation{
id: :with_nil,
attributes: %{
value: nil,
formatter: &DateTime.to_unix/1}
}
]
},
%VariationGroup{
id: :with_custom_texts,
variations: [
%Variation{
id: :with_value,
attributes: %{
value: "Mary",
placeholder: "n/a",
accessibility_text: "not available"
}
},
%Variation{
id: :with_nil,
attributes: %{
value: "",
placeholder: "n/a",
accessibility_text: "not available"
}
}
]
}
]
end
end

0 comments on commit fea6356

Please sign in to comment.