Skip to content

Commit

Permalink
JitsuButton: fix link buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Dec 2, 2023
1 parent e55e31a commit 9fe6189
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion webapps/console/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ export const ButtonGroup: React.FC<ButtonGroupProps> = ({ items, dotsButtonProps
const dropdownItems: MenuProps["items"] = items
.filter(item => item.collapsed)
.map((item, i) => ({
label: item.href ? <Link href={`/${w.slug || w.id}/${item.href}`}>{item.label}</Link> : item.label,
label: item.href ? (
<Link prefetch={false} href={`/${w.slug || w.id}/${item.href}`}>
{item.label}
</Link>
) : (
item.label
),
key: i,
icon: item.icon,
disabled: item.disabled,
Expand Down
3 changes: 1 addition & 2 deletions webapps/console/components/JitsuButton/JitsuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import React from "react";
import { ButtonLabel } from "../ButtonLabel/ButtonLabel";
import { useRouter } from "next/router";
import { useWorkspace } from "../../lib/context";
import Link from "next/link";

export type JitsuButtonProps = ButtonProps & {
iconPosition?: "left" | "right";
Expand Down Expand Up @@ -47,5 +46,5 @@ export const JitsuButton: React.FC<JitsuButtonProps> = p => {
if (p.ws) {
return <WJitsuButton {...p} href={p.href} />;
}
return <Link prefetch={false} {...p} href={p.href} />;
return <HJitsuButton {...p} href={p.href} />;
};

0 comments on commit 9fe6189

Please sign in to comment.