Skip to content

Commit

Permalink
fix: rename ellipsisActions
Browse files Browse the repository at this point in the history
  • Loading branch information
mortalYoung committed Jul 15, 2021
1 parent 7b34c8f commit 70e4fb9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/workbench/editor/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const MAX_ACTIONS_LENGTH = 6;

function splitActions(actions: IEditorActionsProps[]) {
const outerActions: IEditorActionsProps[] = [];
const ellipsisActions: IEditorActionsProps[] = [];
const innerActions: IEditorActionsProps[] = [];

actions.forEach((action) => {
if (action.place === 'outer') {
outerActions.push(action);
} else {
ellipsisActions.push(action);
innerActions.push(action);
}
});

Expand All @@ -36,15 +36,15 @@ function splitActions(actions: IEditorActionsProps[]) {
MAX_ACTIONS_LENGTH - outerActions.length
);

ellipsisActions.concat(surplusActions);
innerActions.concat(surplusActions);
}

return [outerActions, ellipsisActions];
return [outerActions, innerActions];
}

function EditorAction(props: IEditorActionProps & IEditorController) {
const { actions = [], isActiveGroup = false, onClickActions } = props;
const [outer, ellipsis] = splitActions(actions);
const [outer, inner] = splitActions(actions);

const childRef = React.useRef<DropDownRef>(null);

Expand All @@ -58,10 +58,10 @@ function EditorAction(props: IEditorActionProps & IEditorController) {
};

const overlay =
ellipsis.length > 0 ? (
inner.length > 0 ? (
<Menu
style={{ width: 200 }}
data={ellipsis}
data={inner}
onClick={handleOnMenuClick}
/>
) : (
Expand Down Expand Up @@ -95,7 +95,7 @@ function EditorAction(props: IEditorActionProps & IEditorController) {
)}
</div>
))}
{Boolean(ellipsis.length) && (
{Boolean(inner.length) && (
<DropDown
ref={childRef}
placement="bottom"
Expand Down

0 comments on commit 70e4fb9

Please sign in to comment.