feat: added membersLiveView for testing Primer components
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
carla 2025-05-08 14:24:18 +02:00
parent e0a15b1a57
commit e0f8b69315
5 changed files with 76 additions and 41 deletions

View file

@ -0,0 +1,39 @@
defmodule MvWeb.MembersLive do
use MvWeb, :live_view
alias PrimerLive.Component, as: Primer
def mount(_params, _session, socket) do
# Initialize any state you need here
{:ok,
assign(
socket,
:title,
"Willkommen zur test Live View für PrimerLive bis hier members gezeigt werden..."
)}
end
def render(assigns) do
~H"""
<div>
<h1 class="h1"><%= @title %></h1>
<Primer.state_label is_draft>Entwurf</Primer.state_label>
<Primer.subhead>
<span class="h2">Heading</span>
<:actions>
<Primer.button is_primary>Action</Primer.button>
</:actions>
<:description>
Description
</:description>
</Primer.subhead>
<Primer.button is_danger phx-click="click_me">Click Me!</Primer.button>
</div>
"""
end
def handle_event("click_me", _value, socket) do
# Handle the button click event
new_title = "You clicked the button!"
{:noreply, assign(socket, :title, new_title)}
end
end