fix(nodeToolbarComponent): fix indentation and formatting issues in the code
feat(nodeToolbarComponent): add support for minimal mode in the toolbar feat(nodeToolbarComponent): add functionality to show/hide advanced options in the toolbar
This commit is contained in:
parent
7cead25c8b
commit
1796e349c2
1 changed files with 57 additions and 39 deletions
|
|
@ -46,7 +46,7 @@ export default function NodeToolbarComponent({
|
|||
if (countHandles > 1) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const isMinimal = canMinimize();
|
||||
const { paste } = useContext(TabsContext);
|
||||
const reactFlowInstance = useReactFlow();
|
||||
const [showModalAdvanced, setShowModalAdvanced] = useState(false);
|
||||
|
|
@ -131,6 +131,7 @@ export default function NodeToolbarComponent({
|
|||
</a>
|
||||
</ShadTooltip>
|
||||
|
||||
{isMinimal ? (
|
||||
<Select onValueChange={handleSelectChange} value={selectedValue}>
|
||||
<ShadTooltip content="More" side="top">
|
||||
<SelectTrigger>
|
||||
|
|
@ -161,7 +162,7 @@ export default function NodeToolbarComponent({
|
|||
Edit{" "}
|
||||
</div>{" "}
|
||||
</SelectItem>
|
||||
{canMinimize() && (
|
||||
{isMinimal && (
|
||||
<SelectItem value={getRandomKeyByssmm() + "show"}>
|
||||
<div className="flex">
|
||||
<IconComponent
|
||||
|
|
@ -174,6 +175,23 @@ export default function NodeToolbarComponent({
|
|||
)}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
) : (
|
||||
<ShadTooltip content="Edit" side="top">
|
||||
<div>
|
||||
<button
|
||||
onClick={() => setShowModalAdvanced(true)}
|
||||
className={classNames(
|
||||
"relative -ml-px inline-flex items-center rounded-r-md bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10" +
|
||||
(nodeLength == 0
|
||||
? " text-muted-foreground"
|
||||
: " text-foreground")
|
||||
)}
|
||||
>
|
||||
<IconComponent name="Settings2" className="h-4 w-4 " />
|
||||
</button>
|
||||
</div>
|
||||
</ShadTooltip>
|
||||
)}
|
||||
|
||||
{showModalAdvanced && (
|
||||
<EditNodeModal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue