feat(nodeToolbarComponent): add "Save" option to the select dropdown in the node toolbar component to allow saving changes made to the node

fix(styleUtils): import the "SaveAll" icon from lucide-react to be used in the nodeIconsLucide object
This commit is contained in:
anovazzi1 2023-09-22 14:32:43 -03:00
commit 742ebae878
2 changed files with 49 additions and 56 deletions

View file

@ -131,7 +131,6 @@ export default function NodeToolbarComponent({
</a> </a>
</ShadTooltip> </ShadTooltip>
{isMinimal ? (
<Select onValueChange={handleSelectChange} value={selectedValue}> <Select onValueChange={handleSelectChange} value={selectedValue}>
<ShadTooltip content="More" side="top"> <ShadTooltip content="More" side="top">
<SelectTrigger> <SelectTrigger>
@ -162,6 +161,15 @@ export default function NodeToolbarComponent({
Edit{" "} Edit{" "}
</div>{" "} </div>{" "}
</SelectItem> </SelectItem>
<SelectItem value={getRandomKeyByssmm() + "advanced"}>
<div className="flex">
<IconComponent
name="SaveAll"
className="relative top-0.5 mr-2 h-4 w-4"
/>{" "}
Save{" "}
</div>{" "}
</SelectItem>
{isMinimal && ( {isMinimal && (
<SelectItem value={getRandomKeyByssmm() + "show"}> <SelectItem value={getRandomKeyByssmm() + "show"}>
<div className="flex"> <div className="flex">
@ -175,23 +183,6 @@ export default function NodeToolbarComponent({
)} )}
</SelectContent> </SelectContent>
</Select> </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 && ( {showModalAdvanced && (
<EditNodeModal <EditNodeModal

View file

@ -60,6 +60,7 @@ import {
Redo, Redo,
Rocket, Rocket,
Save, Save,
SaveAll,
Scissors, Scissors,
Search, Search,
Settings2, Settings2,
@ -318,4 +319,5 @@ export const nodeIconsLucide: iconsType = {
Square, Square,
Minimize2, Minimize2,
Maximize2, Maximize2,
SaveAll,
}; };