setShowPluginSelector(false)}
+ onSelection={(s) => {
+ console.log("go to page: ", s);
+ }}
+ />
+ )}
);
}
diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss
index 83c02f92a..ee17746f4 100644
--- a/app/components/ui-lib.module.scss
+++ b/app/components/ui-lib.module.scss
@@ -291,6 +291,10 @@
justify-content: center;
z-index: 999;
+ .selector-item-disabled{
+ opacity: 0.6;
+ }
+
&-content {
.list {
max-height: 90vh;
diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx
index da700c0fb..26e0f4af1 100644
--- a/app/components/ui-lib.tsx
+++ b/app/components/ui-lib.tsx
@@ -13,7 +13,7 @@ import MinIcon from "../icons/min.svg";
import Locale from "../locales";
import { createRoot } from "react-dom/client";
-import React, { HTMLProps, useEffect, useState } from "react";
+import React, { HTMLProps, MouseEvent, useEffect, useState } from "react";
import { IconButton } from "./button";
export function Popover(props: {
@@ -47,7 +47,7 @@ export function ListItem(props: {
children?: JSX.Element | JSX.Element[];
icon?: JSX.Element;
className?: string;
- onClick?: () => void;
+ onClick?: (event: MouseEvent) => void;
}) {
return (
(props: {
title: string;
subTitle?: string;
value: T;
+ disable?: boolean;
}>;
defaultSelectedValue?: T;
onSelection?: (selection: T[]) => void;
@@ -456,13 +457,18 @@ export function Selector(props: {
const selected = props.defaultSelectedValue === item.value;
return (
{
- props.onSelection?.([item.value]);
- props.onClose?.();
+ onClick={(event) => {
+ event.stopPropagation();
+ if (!item.disable) {
+ props.onSelection?.([item.value]);
+ props.onClose?.();
+ }
}}
>
{selected ? (