diff --git a/lib/atomic_web/components/image_uploader.ex b/lib/atomic_web/components/image_uploader.ex index 7ff53319..1b94ac76 100644 --- a/lib/atomic_web/components/image_uploader.ex +++ b/lib/atomic_web/components/image_uploader.ex @@ -1,18 +1,16 @@ defmodule AtomicWeb.Components.ImageUploader do @moduledoc """ An image uploader component that allows you to upload an image. - The component attributes are: - @uploads - the uploads object - @target - the target to send the event to - @width - the width of the uploader area - @height - the height of the uploader area - - The component events the parent component should define are: - cancel-image - cancels the upload of an image. This event should be defined in the component that you passed in the @target attribute. """ + use AtomicWeb, :live_component + import Atomic.Uploader def render(assigns) do + max_size = Atomic.Uploader.max_size() + + assigns = Map.put(assigns, :max_size, max_size) + ~H"""
@@ -33,7 +31,7 @@ defmodule AtomicWeb.Components.ImageUploader do

or drag and drop

-

PNG, JPG, GIF up to 10MB

+

PNG, JPG, GIF up to <%= @max_size %>KB

@@ -48,9 +46,9 @@ defmodule AtomicWeb.Components.ImageUploader do
<%= if String.length(entry.client_name) < 30 do %> - <% entry.client_name %> + <%= entry.client_name %> <% else %> - <% String.slice(entry.client_name, 0..30) <> "... " %> + <%= String.slice(entry.client_name, 0..30) <> "... " %> <% end %>