Skip to content

Commit 78a3b2c

Browse files
committed
refactor: update admin dashboard layout and enhance user navigation
- Removed the layout option from the live dashboard to streamline rendering. - Added an admin link in the core components for better navigation based on user role. - Fixed a comment in the Stripe webhook controller to properly display error descriptions.
1 parent 45ebec0 commit 78a3b2c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lib/algora_web/components/core_components.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ defmodule AlgoraWeb.CoreComponents do
236236
</div>
237237
</div>
238238
</:link>
239+
<:link :if={@current_user.is_admin} href={~p"/admin"}>
240+
<div class="flex items-center whitespace-nowrap">
241+
<div class="mr-3 flex h-8 w-8 items-center justify-center">
242+
<.icon name="tabler-adjustments-alt" class="h-5 w-5" />
243+
</div>
244+
<div class="font-semibold">Admin</div>
245+
</div>
246+
</:link>
239247
<:link href={~p"/auth/logout"}>
240248
<div class="flex items-center whitespace-nowrap">
241249
<div class="mr-3 flex h-8 w-8 items-center justify-center">

lib/algora_web/controllers/webhooks/stripe_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ defmodule AlgoraWeb.Webhooks.StripeController do
202202
%{
203203
color: 0xEF4444,
204204
title: event.type,
205-
# description: inspect(error),
205+
description: inspect(error),
206206
footer: %{
207207
text: "Stripe",
208208
icon_url: "https://github.com/stripe.png"

lib/algora_web/router.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ defmodule AlgoraWeb.Router do
3333
live_dashboard "/dashboard",
3434
metrics: AlgoraWeb.Telemetry,
3535
additional_pages: [oban: Oban.LiveDashboard],
36-
layout: {AlgoraWeb.Layouts, :user},
37-
on_mount: [{AlgoraWeb.UserAuth, :ensure_admin}, AlgoraWeb.Admin.Nav]
36+
on_mount: [{AlgoraWeb.UserAuth, :ensure_admin}]
3837
end
3938

4039
scope "/", AlgoraWeb do

0 commit comments

Comments
 (0)