feat: added membersLiveView for testing Primer components
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e0a15b1a57
commit
e0f8b69315
5 changed files with 76 additions and 41 deletions
39
lib/mv_web/live/members_live.ex
Normal file
39
lib/mv_web/live/members_live.ex
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue