Feat: Add shortcut for share a node (ctrl shift S)
This commit is contained in:
parent
0e9910b666
commit
8dad400216
1 changed files with 21 additions and 2 deletions
|
|
@ -209,6 +209,16 @@ export default function NodeToolbarComponent({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function onKeyDown(event: KeyboardEvent) {
|
function onKeyDown(event: KeyboardEvent) {
|
||||||
|
if (
|
||||||
|
selected &&
|
||||||
|
(hasApiKey || hasStore) &&
|
||||||
|
(event.ctrlKey || event.metaKey) &&
|
||||||
|
event.shiftKey &&
|
||||||
|
event.key === "S"
|
||||||
|
) {
|
||||||
|
event.preventDefault();
|
||||||
|
setShowconfirmShare(state => !state);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
(selected && isMinimal) &&
|
(selected && isMinimal) &&
|
||||||
(event.ctrlKey || event.metaKey) &&
|
(event.ctrlKey || event.metaKey) &&
|
||||||
|
|
@ -421,7 +431,7 @@ export default function NodeToolbarComponent({
|
||||||
<SelectItem value={"override"}>
|
<SelectItem value={"override"}>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="Settings2"
|
name="SaveAll"
|
||||||
className="relative top-0.5 mr-2 h-4 w-4 "
|
className="relative top-0.5 mr-2 h-4 w-4 "
|
||||||
/>{" "}
|
/>{" "}
|
||||||
<span className="">Save</span>{" "}
|
<span className="">Save</span>{" "}
|
||||||
|
|
@ -429,7 +439,7 @@ export default function NodeToolbarComponent({
|
||||||
name="Command"
|
name="Command"
|
||||||
className="absolute right-[1.15rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
|
className="absolute right-[1.15rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
|
||||||
></IconComponent>
|
></IconComponent>
|
||||||
<span className="absolute right-2 top-[0.46em]">S</span>
|
<span className="absolute right-2 top-[0.45em]">S</span>
|
||||||
</div>
|
</div>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -475,6 +485,15 @@ export default function NodeToolbarComponent({
|
||||||
className="relative top-0.5 -m-1 mr-1 h-6 w-6"
|
className="relative top-0.5 -m-1 mr-1 h-6 w-6"
|
||||||
/>{" "}
|
/>{" "}
|
||||||
Share{" "}
|
Share{" "}
|
||||||
|
<IconComponent
|
||||||
|
name="Command"
|
||||||
|
className="absolute right-[2rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
|
||||||
|
></IconComponent>
|
||||||
|
<IconComponent
|
||||||
|
name="ArrowBigUp"
|
||||||
|
className="absolute right-[1.09rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
|
||||||
|
></IconComponent>
|
||||||
|
<span className="absolute right-2 top-[0.45em]">S</span>
|
||||||
</div>{" "}
|
</div>{" "}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue