Skip to content

Commit

Permalink
change name
Browse files Browse the repository at this point in the history
  • Loading branch information
6174 committed Mar 26, 2024
1 parent c16c1cf commit d124042
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { NodeMenuProps } from './types';
import ChangeColorMenuItem from './context-menu-item-change-color';
import ChangeInputMenuItem from './context-menu-item-change-input';
import { useAppStore } from '@comflowy/common/store';
import { BypassIcon, CollapseIcon, CopyIcon, DeleteIcon, ExpandIcon } from 'ui/icons';
import { BypassIcon, CollapseIcon, CopyIcon, DeleteIcon, DisableRunIcon, EnableRunIcon, ExpandIcon } from 'ui/icons';
import { EditImageMenuItem, needEditImage } from './context-menu-item-edit-image/context-menu-item-edit-image';
import { NodeVisibleState } from '@comflowy/common/types';

Expand Down Expand Up @@ -151,11 +151,10 @@ function NodeMenu(props: NodeMenuProps) {
}

const bypassState = node.bypass || false;
items.push({ type: "divider" });
if (bypassState) {
items.push(getMenuItem(<div className="menu-item-title"> <BypassIcon /> Bypass{"(on)"} </div>, 'MENU_ITEM_UN_BYPASS', null, null));
items.push(getMenuItem(<div className="menu-item-title"> <EnableRunIcon /> Enable Node</div>, 'MENU_ITEM_UN_BYPASS', null, null));
} else {
items.push(getMenuItem(<div className="menu-item-title"> <BypassIcon/> Bypass{"(off)"} </div>, 'MENU_ITEM_BYPASS', null, null));
items.push(getMenuItem(<div className="menu-item-title"> <DisableRunIcon /> Disable Node</div>, 'MENU_ITEM_BYPASS', null, null));
}
items.push({ type: "divider" });

Expand Down
19 changes: 18 additions & 1 deletion packages/ui/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ export {
CopyIcon
}

export function DisableRunIcon() {
return (
<svg width="18" height="18" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.8623 20.4482C20.1348 20.7207 20.5918 20.7207 20.8555 20.4482C21.1191 20.167 21.1279 19.7275 20.8555 19.4551L7.41699 6.02539C7.14453 5.75293 6.69629 5.75293 6.41504 6.02539C6.15137 6.28906 6.15137 6.75488 6.41504 7.01855L19.8623 20.4482ZM19.001 16.0449L20.8027 14.999C21.5586 14.5596 21.875 14.2168 21.875 13.6631C21.875 13.1094 21.5586 12.7754 20.8027 12.3271L10.4229 6.32422C10.0098 6.08691 9.59668 5.95508 9.20117 6.00781L13.0684 9.90137L19.4141 13.5664C19.4492 13.5928 19.4844 13.6191 19.4844 13.6631C19.4844 13.707 19.4492 13.7334 19.4141 13.7598L17.709 14.7529L19.001 16.0449ZM15.7666 17.917L14.4658 16.6162L10.0801 19.1475C10.0449 19.1738 10.0098 19.1914 9.97461 19.1914C9.93066 19.1914 9.89551 19.1475 9.89551 19.0859V12.0459L8.09375 10.2354V19.9473C8.09375 20.8262 8.60352 21.3711 9.32422 21.3711C9.69336 21.3711 10.0186 21.2393 10.4229 21.002L15.7666 17.917Z" fill="white" />
</svg>
)
}

export function EnableRunIcon() {
return (
<svg width="18" height="18" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.32422 21.3711C9.69336 21.3711 10.0186 21.2393 10.4229 21.002L20.8027 14.999C21.5586 14.5596 21.875 14.2168 21.875 13.6631C21.875 13.1094 21.5586 12.7754 20.8027 12.3271L10.4229 6.32422C10.0186 6.08691 9.69336 5.95508 9.32422 5.95508C8.60352 5.95508 8.09375 6.50879 8.09375 7.37891V19.9473C8.09375 20.8262 8.60352 21.3711 9.32422 21.3711ZM9.97461 19.1914C9.93066 19.1914 9.89551 19.1475 9.89551 19.0859V8.24023C9.89551 8.16992 9.93066 8.13477 9.97461 8.13477C10.0098 8.13477 10.0449 8.15234 10.0801 8.17871L19.4141 13.5664C19.4492 13.5928 19.4844 13.6191 19.4844 13.6631C19.4844 13.707 19.4492 13.7334 19.4141 13.7598L10.0801 19.1475C10.0449 19.1738 10.0098 19.1914 9.97461 19.1914Z" fill="white" />
</svg>
)
}


export function BypassIcon() {
return (
<svg width="22" height="22" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand All @@ -45,7 +62,7 @@ export function ExpandIcon() {

export function CollapseIcon() {
return (
<svg width="22" height="22" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="18" height="18" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.88086 12.9512H11.7588C12.7695 12.9512 13.3584 12.3623 13.3584 11.3516V6.54395C13.3584 5.99023 12.9365 5.57715 12.374 5.57715C11.8203 5.57715 11.416 5.98145 11.416 6.54395V7.16797L11.6006 9.89258L9.57031 7.75684L7.05664 5.22559C6.87207 5.03223 6.63477 4.94434 6.37109 4.94434C5.77344 4.94434 5.34277 5.34863 5.34277 5.94629C5.34277 6.21875 5.44824 6.46484 5.6416 6.64941L8.16406 9.17188L10.2998 11.2021L7.55762 11.0176H6.88086C6.31836 11.0176 5.90527 11.4131 5.90527 11.9756C5.90527 12.5381 6.31836 12.9512 6.88086 12.9512ZM15.5732 21.8457C16.127 21.8457 16.5312 21.4414 16.5312 20.8789V20.167L16.3467 17.4512L18.377 19.5869L20.9434 22.1621C21.1191 22.3555 21.3652 22.4434 21.6201 22.4434C22.2178 22.4434 22.6484 22.0391 22.6484 21.4414C22.6484 21.1689 22.543 20.9316 22.3584 20.7383L19.7832 18.1719L17.6475 16.1416L20.3896 16.3262H21.1455C21.708 16.3262 22.1211 15.9219 22.1211 15.3682C22.1211 14.7969 21.708 14.3926 21.1455 14.3926H16.1885C15.1777 14.3926 14.5889 14.9814 14.5889 15.9922V20.8789C14.5889 21.4326 15.0107 21.8457 15.5732 21.8457Z" fill="white" />
</svg>
)
Expand Down

0 comments on commit d124042

Please sign in to comment.