From b1a7e13d354f75ac203a6e21f3a22536c4b4a939 Mon Sep 17 00:00:00 2001 From: Alexandre de Souza Date: Mon, 8 Aug 2022 12:03:42 -0300 Subject: [PATCH] Add Hub sidebar --- lib/livebook_web/live/sidebar_helpers.ex | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lib/livebook_web/live/sidebar_helpers.ex b/lib/livebook_web/live/sidebar_helpers.ex index a6680a9f1..c7180f979 100644 --- a/lib/livebook_web/live/sidebar_helpers.ex +++ b/lib/livebook_web/live/sidebar_helpers.ex @@ -47,6 +47,7 @@ defmodule LivebookWeb.SidebarHelpers do to={Routes.settings_path(@socket, :page)} current={@current_page} /> + <.hub_section socket={@socket} />
<%= if Livebook.Config.shutdown_enabled?() do %> @@ -101,6 +102,54 @@ defmodule LivebookWeb.SidebarHelpers do """ end + defp hub_section(assigns) do + ~H""" + <%= if Application.get_env(:livebook, :feature_flags)[:hub] do %> + + <% end %> + """ + end + + defp hub_path(socket) do + if Application.get_env(:livebook, :feature_flags)[:hub] do + apply(Routes, :hub_path, [socket, :page]) + end + end + defp sidebar_link_text_color(to, current) when to == current, do: "text-white" defp sidebar_link_text_color(_to, _current), do: "text-gray-400"