Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/901
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Mar 11, 2024
1 parent 76970e5 commit 5bc1694
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/components/nav/back/back_button_live.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Bonfire.UI.Common.BackButtonLive do
use Bonfire.UI.Common.Web, :stateless_component

prop showing_within, :atom, default: nil
prop close_preview, :any, default: nil
prop back, :any, default: true
end
9 changes: 5 additions & 4 deletions lib/components/nav/back/back_button_live.sface
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{!-- {#if @showing_within == :preview}
{!-- {#if @showing_within == :preview} --}
{#if @close_preview}
<button
id="close_preview"
phx-click="Bonfire.UI.Common.OpenPreviewLive:close"
:hook={"ClosePreview", from: Bonfire.UI.Common.PreviewContentLive}
label={l("Go back to the previous page")}
class="btn font-normal normal-case btn-ghost btn-sm btn-circle !inline-flex"
>
<#Icon iconfiy="ion:chevron-back" class="w-5 h-5 text-base-content/70" />
</button> --}
{#if is_binary(@back) and @back != current_url(@__context__)}
<#Icon iconify="ion:chevron-back" class="w-5 h-5 text-base-content/70" />
</button>
{#elseif is_binary(@back) and @back != current_url(@__context__)}
<LinkLive
to={@back}
label={l("Go back to the previous page")}
Expand Down
1 change: 1 addition & 0 deletions lib/components/nav/tabs/tabs_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule Bonfire.UI.Common.TabsLive do
prop selected_name, :string, default: nil
prop path_prefix, :string, default: "?tab="
prop path_suffix, :string, default: nil
prop show_back_button, :boolean, default: false

prop link_component, :atom, default: LinkPatchLive

Expand Down
4 changes: 4 additions & 0 deletions lib/components/nav/tabs/tabs_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{#elseif @type == :header_only}
<div class="flex justify-between items-center w-full px-6">
<div class="text-lg font-bold w-full flex-1">
{#if @show_back_button}
<Bonfire.UI.Common.BackButtonLive close_preview />
{/if}

{@selected_name}
</div>
<#slot />
Expand Down
1 change: 1 addition & 0 deletions lib/layout/persistent_live.sface
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
module={maybe_component(Bonfire.UI.Social.FeedLive, @__context__)}
id={:persistent_feed}
feed_name={:default}
show_back_button
tab_path_prefix="/feed/"
/>
</div>
Expand Down

0 comments on commit 5bc1694

Please sign in to comment.