Skip to content

Commit

Permalink
share WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Jun 25, 2023
1 parent a7d21f4 commit f2b4924
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/frameworks/pixel/components/search_bar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ defmodule Frameworks.Pixel.SearchBar do
def render(assigns) do
~H"""
<div>
<.form id={"#{@id}_form"} for={%{}} phx-submit="submit" phx-change="change">
<.form id={"#{@id}_form"} for={%{}} phx-submit="submit" phx-change="change" phx-target={@parent}>
<div class="flex flex-row">
<input
class="text-grey1 text-bodymedium font-body pl-3 pr-3 w-full border-2 border-solid border-grey3 focus:outline-none focus:border-primary rounded h-48px"
Expand Down
23 changes: 13 additions & 10 deletions core/frameworks/pixel/components/share_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Frameworks.Pixel.ShareView do
use CoreWeb, :live_component

alias CoreWeb.UI.UserListItem
alias Frameworks.Pixel.SearchBar

@impl true
def update(
Expand Down Expand Up @@ -32,7 +33,8 @@ defmodule Frameworks.Pixel.ShareView do
filtered_users: users,
shared_users: shared_users,
users: users,
close_button: close_button
close_button: close_button,
query_string: ""
)
|> filter_users()
}
Expand Down Expand Up @@ -91,15 +93,6 @@ defmodule Frameworks.Pixel.ShareView do
socket
end

# data(filtered_users, :list)
# data(close_button, :map)

attr(:content_id, :integer, required: true)
attr(:content_name, :string, required: true)
attr(:group_name, :string, required: true)
attr(:users, :list, required: true)
attr(:shared_users, :list)

@impl true
def render(assigns) do
~H"""
Expand All @@ -112,6 +105,16 @@ defmodule Frameworks.Pixel.ShareView do
</div>
<Button.dynamic {@close_button} />
</div>
<.live_component
module={SearchBar}
id={:share_search_bar}
query_string={@query_string}
placeholder={dgettext("eyra-ui", "share.search.placeholder")}
debounce="200"
parent={%{type: __MODULE__, id: @id}}
/>
<.spacing value="S" />
<div class="rounded border-2 border-grey3 h-40 overflow-scroll">
<div class="p-4 flex flex-col gap-3">
Expand Down
4 changes: 2 additions & 2 deletions core/priv/gettext/en/LC_MESSAGES/eyra-project.po
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ msgstr "Projects"

#, elixir-autogen, elixir-format
msgid "share.dialog.content"
msgstr ""
msgstr "project"

#, elixir-autogen, elixir-format
msgid "share.dialog.group"
msgstr ""
msgstr "researchers"

#, elixir-autogen, elixir-format
msgid "config.title"
Expand Down
4 changes: 4 additions & 0 deletions core/priv/gettext/en/LC_MESSAGES/eyra-ui.po
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,7 @@ msgstr "Privacy"
#, elixir-autogen, elixir-format
msgid "terms.link"
msgstr "Terms"

#, elixir-autogen, elixir-format
msgid "share.search.placeholder"
msgstr "Name or email address"
4 changes: 4 additions & 0 deletions core/priv/gettext/eyra-ui.pot
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,7 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "terms.link"
msgstr ""

#, elixir-autogen, elixir-format
msgid "share.search.placeholder"
msgstr ""
4 changes: 2 additions & 2 deletions core/priv/gettext/nl/LC_MESSAGES/eyra-project.po
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ msgstr "Projecten"

#, elixir-autogen, elixir-format
msgid "share.dialog.content"
msgstr ""
msgstr "project"

#, elixir-autogen, elixir-format
msgid "share.dialog.group"
msgstr ""
msgstr "onderzoekers"

#, elixir-autogen, elixir-format
msgid "config.title"
Expand Down
4 changes: 4 additions & 0 deletions core/priv/gettext/nl/LC_MESSAGES/eyra-ui.po
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,7 @@ msgstr "Privacy"
#, elixir-autogen, elixir-format
msgid "terms.link"
msgstr "Voorwaarden"

#, elixir-autogen, elixir-format
msgid "share.search.placeholder"
msgstr "Naam of e-mailadres"

0 comments on commit f2b4924

Please sign in to comment.