Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix: hide breadcrumb where not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron committed Jul 4, 2024
1 parent 1d46d8d commit c4420e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ type Props = {
title: string | ReactElement;
description: string | ReactElement;
contentRight?: React.ReactNode;
breadcrumb?: boolean;
};

function AppHeader({ title, description, contentRight }: Props) {
function AppHeader({
title,
description,
contentRight,
breadcrumb = true,
}: Props) {
return (
<>
<Breadcrumbs />
{breadcrumb && <Breadcrumbs />}
<div className="flex justify-between border-b border-border pb-3 lg:pb-6">
<div className="flex-1">
<h1 className="text-xl lg:text-3xl font-semibold">{title}</h1>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Breadcrumbs() {
const filteredCrumbs = isIndexRoute ? crumbs.slice(0, -1) : crumbs;

// Don't render anything if there is only one item
if (filteredCrumbs.length < 2) {
if (filteredCrumbs.length < 3) {
return null;
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/layouts/SettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function SettingsLayout() {
<AppHeader
title="Settings"
description="Manage your Alby Hub settings."
breadcrumb={false}
contentRight={
<AlertDialog>
<AlertDialogTrigger asChild>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/screens/appstore/AppStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function AppStore() {
return (
<>
<AppHeader
title="Apps"
title="App Store"
description="Apps that you can connect your wallet to"
contentRight={
<>
Expand Down

0 comments on commit c4420e6

Please sign in to comment.