migrate view helper components into core components
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-18 00:29:51 -04:00
parent a0b93d0f46
commit 56956f37fb
5 changed files with 50 additions and 72 deletions

View File

@ -0,0 +1,7 @@
<time :if={@date} datetime={@date |> Date.to_iso8601(:extended)} x-data={~s<{
date:
Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'})
.format(new Date("#{Date.to_iso8601(@date, :extended)}"))
}>} x-text="date">
<%= @date |> Date.to_iso8601(:extended) %>
</time>

View File

@ -0,0 +1,7 @@
<time :if={@datetime} datetime={cast_datetime(@datetime)} x-data={~s/{
datetime:
Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'})
.format(new Date("#{cast_datetime(@datetime)}"))
}/} x-text="datetime">
<%= cast_datetime(@datetime) %>
</time>

View File

@ -0,0 +1,3 @@
<a href={qr_code_image(@content)} download={@filename <> ".png"}>
<img class={@image_class} alt={@filename} src={qr_code_image(@content)} />
</a>