Skip to content

Commit 1b4709d

Browse files
committed
removed button controls from action container
1 parent d14f327 commit 1b4709d

File tree

3 files changed

+2
-37
lines changed

3 files changed

+2
-37
lines changed

src/app/FrontendTypes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,13 @@ export interface ActionProps {
223223
last: boolean;
224224
index: number;
225225
sliderIndex: number;
226-
// dispatch: (a: { type: string; payload: unknown }) => void;
227226
displayName: string;
228227
componentName: string;
229228
componentData: { actualDuration: number } | undefined;
230229
routePath: unknown;
231230
state?: Record<string, unknown>;
232231
viewIndex: number | undefined;
233232
isCurrIndex: boolean;
234-
handleOnkeyDown: (e: KeyboardEvent, i: number) => void;
235233
}
236234

237235
export interface DiffRouteProps {

src/app/components/Actions/Action.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@ import { useDispatch } from 'react-redux';
77
const Action = (props: ActionProps): JSX.Element => {
88
const dispatch = useDispatch();
99

10-
const {
11-
selected,
12-
last,
13-
index,
14-
sliderIndex,
15-
displayName,
16-
componentData,
17-
viewIndex,
18-
isCurrIndex,
19-
handleOnkeyDown,
20-
} = props;
10+
const { selected, last, index, sliderIndex, displayName, componentData, viewIndex, isCurrIndex } =
11+
props;
2112

2213
const cleanTime = (): string => {
2314
if (!componentData || !componentData.actualDuration) {
@@ -64,7 +55,6 @@ const Action = (props: ActionProps): JSX.Element => {
6455
<div className='individual-action'>
6556
<div
6657
// @ts-ignore
67-
onKeyDown={(e): void => handleOnkeyDown(e, viewIndex)}
6858
className={selected || last ? 'action-component selected' : 'action-component'}
6959
onClick={() => {
7060
dispatch(changeView(index));

src/app/containers/ActionContainer.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,6 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
7878
// the hierarchy gets set on the first click in the page
7979
if (hierarchy) displayArray(hierarchy); // when page is refreshed we may not have a hierarchy so we need to check if hierarchy was initialized. If it was initialized, invoke displayArray to display the hierarchy
8080

81-
// This function allows us to use our arrow keys to jump between snapshots. It passes an event and the index of each action-component. Using the arrow keys allows us to highligh snapshots and the enter key jumps to the selected snapshot
82-
function handleOnKeyDown(e: Partial<KeyboardEvent>, i: number): void {
83-
let currIndex = i;
84-
85-
if (e.key === 'ArrowUp') {
86-
// up arrow key pressed
87-
currIndex--;
88-
if (currIndex < 0) return;
89-
dispatch(changeView(currIndex));
90-
} else if (e.key === 'ArrowDown') {
91-
// down arrow key pressed
92-
currIndex++;
93-
if (currIndex > hierarchyArr.length - 1) return;
94-
dispatch(changeView(currIndex));
95-
} else if (e.key === 'Enter') {
96-
// enter key pressed
97-
e.stopPropagation(); // prevents further propagation of the current event in the capturing and bubbling phases
98-
e.preventDefault(); // needed or will trigger onClick right after
99-
dispatch(changeSlider(currIndex));
100-
}
101-
}
102-
10381
// Sort hierarchyArr by index property of each object. This will be useful when later when we build our components so that our components will be displayed in index/chronological order
10482
hierarchyArr.sort((a: Obj, b: Obj): number => a.index - b.index);
10583

@@ -129,7 +107,6 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
129107
selected={selected}
130108
last={last}
131109
sliderIndex={sliderIndex}
132-
handleOnkeyDown={handleOnKeyDown}
133110
viewIndex={viewIndex}
134111
isCurrIndex={isCurrIndex}
135112
routePath={snapshot.routePath}

0 commit comments

Comments
 (0)