Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/591
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanminutillo committed Dec 14, 2023
1 parent 89a633e commit 5c4b897
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 10 deletions.
24 changes: 23 additions & 1 deletion lib/components/activity/subject/subject_minimal_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,29 @@
{/if}
</div>
{#match _}
{#if @verb == "Like"}
{#if @verb == "Pin"}
<div data-role="liked_by" class="flex items-center justify-start pb-3 -ml-8">
{!-- LIKE --}
<#Icon iconify="carbon:pin-filled" class="w-5 h-5 text-info" />
<div class="flex-1 ml-3">
<div class="text-sm font-medium text-base-content/70">
<LiveRedirect
aria-label={e(@character_username, "") <> " profile"}
class="font-medium link link-hover text-base-content/70"
to={@path}
>
{#if @object_id == current_user_id(@__context__)}
{l("You")}
{#else}
{@profile_name || @character_username}
{/if}
</LiveRedirect>

{raw(@verb_display)}
</div>
</div>
</div>
{#elseif @verb == "Like"}
<div data-role="liked_by" class="flex items-center justify-start pb-3 -ml-8">
{!-- LIKE --}
<#Icon iconify="mingcute:fire-fill" class="w-5 h-5 text-yellow-500" />
Expand Down
14 changes: 7 additions & 7 deletions lib/components/feeds/feed_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{!-- context={@id} --}
<Bonfire.UI.Common.LoadMoreLive
live_handler={Bonfire.Social.Feeds}
page_info={@page_info}
page_info={@previous_page_info || @page_info}
target={@myself}
infinite_scroll={Settings.get([:ui, :infinite_scroll], :preload, @__context__)}
hide_load_more={@hide_load_more}
Expand All @@ -140,12 +140,12 @@
<div class="sr-only text-base-content">{l("Loading...")}</div>
</div>
{!-- {#case maybe_cute_gif()}
{#match url when is_binary(url)}
<div class="flex flex-row items-center justify-center my-12">
<img src={url}>
</div>
{#match _}
{/case} --}
{#match url when is_binary(url)}
<div class="flex flex-row items-center justify-center my-12">
<img src={url}>
</div>
{#match _}
{/case} --}
{#elseif !(is_list(@feed) and @feed != [])}
<div data-id="empty-feed" class="flex items-center place-content-center">
<Bonfire.UI.Common.EmptyFeed
Expand Down
23 changes: 23 additions & 0 deletions lib/live_handlers/feeds_live_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,29 @@ defmodule Bonfire.Social.Feeds.LiveHandler do
]
end

def feed_default_assigns(:bookmarks = feed_name, socket) do
# debug(feed_name)

[
feed_name: feed_name,
feed_id: feed_name,
feed_component_id: component_id(feed_name, socket.assigns),
selected_tab: :bookmarks,
hide_tabs: true,
showing_within: :feed_by_subject,
# FIXME: clean up page vs tab
page: "bookmarks",
page_title: "Bookmarks",
no_header: false,
# feed_title: l("My favourites"),
feedback_title: l("Have you not bookmarked anything yet?"),
# feed_id: feed_name,
# feedback_message: l("It seems like the paint is still fresh on this instance..."),
feed: nil,
page_info: nil
]
end

# WIP
def feed_default_assigns(:flags = feed_name, socket) do
[
Expand Down
5 changes: 3 additions & 2 deletions lib/views/_deprecated/likes/likes_live.sface
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="flex flex-col mx-auto">
{!-- <Bonfire.UI.Common.PageTitleLive page_title={@page_title} /> --}
<div class="relative flex items-center px-3 mt-6 mb-6 md:px-0">
<!-- <div class="relative flex items-center px-3 mt-6 mb-6 md:px-0">
<div class="flex items-center flex-1 gap-5 text-xl font-semibold text-base-content">
<#Icon iconify="noto:star" class="w-5 h-5" />
<span>{@page_title}</span>
</div>
{!-- <Bonfire.UI.Social.HeaderAsideNotificationsSeenLive feed_id={:notifications} /> --}
</div>
</div> -->

{!--
TODO: support LivePush:
Expand All @@ -17,6 +17,7 @@
page_title={@page_title}
feed={@feed}
page_info={@page_info}
hide_tabs
showing_within={@showing_within}
verb_default="like"
loading={@loading}
Expand Down
1 change: 1 addition & 0 deletions lib/views/bookmarks/bookmarks_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule Bonfire.UI.Social.Feeds.BookmarksLive do
socket
|> assign(
feed: feed,
page_title: "Bookmarks",
page_info: page_info,
showing_within: :bookmarks,
loading: false,
Expand Down
1 change: 1 addition & 0 deletions lib/views/bookmarks/bookmarks_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
showing_within={@showing_within}
verb_default="bookmark"
loading={@loading}
hide_tabs
/>
</div>

0 comments on commit 5c4b897

Please sign in to comment.