Skip to content

Commit

Permalink
Fix null editor and active group link
Browse files Browse the repository at this point in the history
  • Loading branch information
pogseal committed Aug 28, 2024
1 parent 9aa85fd commit 623ad48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions app/routes/_editor+/blocks+/group/group-view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";

import { Link } from "@remix-run/react";
import { Link, NavLink } from "@remix-run/react";
import clsx from "clsx";
import { Node } from "slate";
import { ReactEditor, useSlateStatic } from "slate-react";
Expand Down Expand Up @@ -137,15 +137,20 @@ export function BlockGroupItemView({ element }: { element: GroupItemElement }) {
/>
</button>
)}
<Link
<NavLink
reloadDocument={element?.isCustomSite ?? false}
key={element?.id}
to={element?.path ?? ""}
prefetch="intent"
className={clsx(
element.groupContent ? "" : "w-full",
"flex items-center justify-center flex-col p-3 bg-2-sub rounded-lg border border-color-sub shadow-sm shadow-1",
)}
className={({ isActive, isPending }) =>
clsx(
isActive
? "bg-zinc-100 border-zinc-400/50 dark:bg-dark450 dark:border-zinc-500/50"
: "bg-2-sub hover:border-zinc-300 dark:hover:border-zinc-600",
element.groupContent ? "" : "w-full",
"flex items-center justify-center flex-col p-3 rounded-lg border border-color-sub shadow-sm shadow-1",
)
}
>
{element.label && (
<div className="flex items-center justify-center mb-2">
Expand All @@ -171,7 +176,7 @@ export function BlockGroupItemView({ element }: { element: GroupItemElement }) {
<div className="text-center pt-2 text-xs font-bold">
{element?.name}
</div>
</Link>
</NavLink>
</>
)}
{element.groupContent && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function SubSectionTabs({
//@ts-ignore
getContent?.content[0]?.children[0]?.text == "";

if (isEmpty && !hasAccess) {
if ((isEmpty && !hasAccess) || (!getContent && !hasAccess)) {
return false;
}
}
Expand Down

0 comments on commit 623ad48

Please sign in to comment.