diff --git a/lib/bitstyles_phoenix/bitstyles.ex b/lib/bitstyles_phoenix/bitstyles.ex index bf85bfa..fe72c8d 100644 --- a/lib/bitstyles_phoenix/bitstyles.ex +++ b/lib/bitstyles_phoenix/bitstyles.ex @@ -27,7 +27,7 @@ defmodule BitstylesPhoenix.Bitstyles do # for users of older bitstyles to use the "class-name-A" classname. defp downgrade_classname(class, target_version, _current_version) - when target_version > {5, 0, 1} do + when target_version > {6, 0, 0} do IO.warn("Version #{Version.to_string(target_version)} of bitstyles is not yet supported") class end @@ -37,7 +37,7 @@ defmodule BitstylesPhoenix.Bitstyles do class end - defp downgrade_classname(class, target_version, {6, 0, 6}) do + defp downgrade_classname(class, target_version, {6, 0, 0}) do # downgrading 6.0.0 -> 5.0.1 sizes_renaming = %{ "s7" => "4xs", diff --git a/lib/bitstyles_phoenix/component/badge.ex b/lib/bitstyles_phoenix/component/badge.ex index f0e3249..2a51349 100644 --- a/lib/bitstyles_phoenix/component/badge.ex +++ b/lib/bitstyles_phoenix/component/badge.ex @@ -138,7 +138,7 @@ defmodule BitstylesPhoenix.Component.Badge do extra = assigns_to_attributes(assigns, [:class, :variant]) {variant_class, extra} = - if Bitstyles.version() >= "6.0.0" do + if Bitstyles.Version.version() >= {6, 0, 0} do theme = assigns[:variant] || "grayscale" {nil, Keyword.put_new(extra, :"data-theme", theme)} else diff --git a/lib/bitstyles_phoenix/component/flash.ex b/lib/bitstyles_phoenix/component/flash.ex index 01d0d0f..58754bd 100644 --- a/lib/bitstyles_phoenix/component/flash.ex +++ b/lib/bitstyles_phoenix/component/flash.ex @@ -181,7 +181,7 @@ defmodule BitstylesPhoenix.Component.Flash do extra = assigns_to_attributes(assigns, [:class, :content_class, :variant]) {variant_class, extra} = - if Bitstyles.version() >= "6.0.0" do + if Bitstyles.Version.version() >= {6, 0, 0} do {nil, Keyword.put_new(extra, :"data-theme", Enum.at(flash_variants, 0))} else {flash_variants |> Enum.map_join(" ", &"a-flash--#{&1}"), extra}