Skip to content

Commit

Permalink
fix: Fix import.
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMLG-BOT committed Apr 15, 2022
1 parent 727b0e5 commit 4277eaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 0 additions & 12 deletions lib/phoenix_webcomponent/form.ex
Expand Up @@ -257,18 +257,6 @@ defmodule Phoenix.WebComponent.Form do

@type field :: atom | String.t()

defimpl Phoenix.WebComponent.Safe do
def to_iodata(%{action: action, options: options}) do
IO.warn(
"form_for/3 without an anonymous function is deprecated. " <>
"If you are using Phoenix.LiveView, use the new Phoenix.LiveView.Helpers.form/1 component"
)

{:safe, contents} = form_tag(action, options)
contents
end
end

## Form helpers

@doc """
Expand Down
6 changes: 3 additions & 3 deletions lib/phoenix_webcomponent/link.ex
Expand Up @@ -78,14 +78,14 @@ defmodule Phoenix.WebComponent.Link do

if method == :get do
# Call link attributes to validate `to`
[data: data] = Phoenix.WebComponent.link_attributes(to, [])
[data: data] = Phoenix.HTML.link_attributes(to, [])
content_tag(:a, text, [href: data[:to]] ++ Keyword.delete(opts, :csrf_token))
else
{csrf_token, opts} = Keyword.pop(opts, :csrf_token, true)
opts = Keyword.put_new(opts, :rel, "nofollow")

[data: data] =
Phoenix.WebComponent.link_attributes(to, method: method, csrf_token: csrf_token)
Phoenix.HTML.link_attributes(to, method: method, csrf_token: csrf_token)

content_tag(:a, text, [data: data, href: data[:to]] ++ opts)
end
Expand Down Expand Up @@ -139,7 +139,7 @@ defmodule Phoenix.WebComponent.Link do
|> Keyword.put_new(:method, :post)
|> Keyword.split([:method, :csrf_token])

link_attributes = Phoenix.WebComponent.link_attributes(to, link_opts)
link_attributes = Phoenix.HTML.link_attributes(to, link_opts)
content_tag(:"mwc-button", text, link_attributes ++ opts)
end

Expand Down

0 comments on commit 4277eaf

Please sign in to comment.