* Made method to getting singular media details; Renamed other related method * Takes a fun and flirty digression to remove abstractions around yt-dlp since I'm 100% committed to using it exclusively * Removed commented test code * Lays the groundwork for fast indexing * Added module for working with youtube RSS feed * Added methods to kick off indexing workers from RSS response * Improve short detection (#59) * Made media attribute-related yt-dlp calls return a struct * Added shorts attribute to media items * Added ability to discern a short from yt-dlp response * Updated search to use new shorts attribute * Fast index UI (#63) * Added fast_index field and adds it to source form * Added fast indexing to source changeset operations * Added fast indexing worker and updated other modules to start using it * Handled fast index worker on source update * Add support modals (#65) * Added fast indexing upgrade modal * Improved modal on smaller screens * Updated links to work again * Added donation modal * Reverted source fast index to 15 minutes * Removed unneeded HTML attributes from old alpine approach
41 lines
1,010 B
Elixir
41 lines
1,010 B
Elixir
defmodule PinchflatWeb.CustomComponents.ButtonComponents do
|
|
@moduledoc false
|
|
use Phoenix.Component
|
|
|
|
@doc """
|
|
Render a button
|
|
|
|
## Examples
|
|
|
|
<.button color="bg-primary" rounding="rounded-sm">
|
|
<span>Click me</span>
|
|
</.button>
|
|
"""
|
|
attr :color, :string, default: "bg-primary"
|
|
attr :rounding, :string, default: "rounded-sm"
|
|
attr :class, :string, default: ""
|
|
attr :type, :string, default: "submit"
|
|
attr :disabled, :boolean, default: false
|
|
attr :rest, :global
|
|
|
|
slot :inner_block, required: true
|
|
|
|
def button(assigns) do
|
|
~H"""
|
|
<button
|
|
class={[
|
|
"text-center font-medium text-white",
|
|
"#{@rounding} inline-flex items-center justify-center px-8 py-4",
|
|
"#{@color}",
|
|
"hover:bg-opacity-90 lg:px-8 xl:px-10",
|
|
"disabled:bg-opacity-50 disabled:cursor-not-allowed disabled:text-gray-2",
|
|
@class
|
|
]}
|
|
disabled={@disabled}
|
|
{@rest}
|
|
>
|
|
<%= render_slot(@inner_block) %>
|
|
</button>
|
|
"""
|
|
end
|
|
end
|