Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/[filename]/ServerCategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import RuleListWrapper from "@/components/rule-list/rule-list-wrapper";
import MarkdownComponentMapping from "@/components/tina-markdown/markdown-component-mapping";
import { IconLink } from "@/components/ui";
import { ICON_SIZE } from "@/constants";
import { getSanitizedBasePath } from "@/lib/withBasePath";

interface ServerCategoryPageProps {
category: any;
Expand All @@ -33,7 +32,7 @@ export default function ServerCategoryPage({ category, path, includeArchived, vi
<div className="flex">
<div className="w-full lg:w-2/3 bg-white pt-4 p-6 border border-[#CCC] rounded shadow-lg">
<div className="flex justify-between">
<h1 className="m-0 text-ssw-red font-bold">{includeArchived ? `Archived Rules - ${title}` : title}</h1>
<h1 className="m-0 mb-4 text-ssw-red font-bold">{includeArchived ? `Archived Rules - ${title}` : title}</h1>

<div className="flex gap-2 justify-center items-start sm:items-center">
<IconLink href={`admin/index.html#/collections/edit/category/${path?.slice(0, -4)}`} title="Edit category" tooltipOpaque={true}>
Expand Down
11 changes: 9 additions & 2 deletions components/Bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function Bookmark({ ruleGuid, isBookmarked, defaultIsBookmarked =
const [initialLoading, setInitialLoading] = useState<boolean>(!controlled);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [showLoginModal, setShowLoginModal] = useState<boolean>(false);
const [isRedirecting, setIsRedirecting] = useState<boolean>(false);

useEffect(() => {
if (controlled) setBookmarked(isBookmarked as boolean);
Expand Down Expand Up @@ -110,6 +111,7 @@ export default function Bookmark({ ruleGuid, isBookmarked, defaultIsBookmarked =

const handleLoginRedirect = () => {
const current = query ? `${pathname}?${query}` : pathname;
setIsRedirecting(true);
router.push(`/auth/login?returnTo=${encodeURIComponent(current)}`);
};

Expand Down Expand Up @@ -144,8 +146,13 @@ export default function Bookmark({ ruleGuid, isBookmarked, defaultIsBookmarked =
<button onClick={() => setShowLoginModal(false)} className="px-4 py-2 rounded border border-gray-300 cursor-pointer hover:bg-gray-50">
Cancel
</button>
<button onClick={handleLoginRedirect} className="px-4 py-2 rounded bg-ssw-red text-white cursor-pointer hover:bg-ssw-red/90">
Sign in
<button
onClick={handleLoginRedirect}
disabled={isRedirecting}
aria-busy={isRedirecting}
className="px-4 py-2 rounded bg-ssw-red text-white cursor-pointer hover:bg-ssw-red/90"
>
{isRedirecting ? <Spinner size="sm" inline /> : "Sign in"}
</button>
</div>
</div>
Expand Down
Loading