Skip to content

Commit a1b4119

Browse files
committed
removed collapse function
1 parent 1b4709d commit a1b4119

File tree

6 files changed

+38
-195
lines changed

6 files changed

+38
-195
lines changed

src/app/FrontendTypes.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ export interface BarGraphComparisonAction {
105105
}
106106

107107
export interface ActionContainerProps {
108-
actionView: boolean;
109-
setActionView: React.Dispatch<React.SetStateAction<boolean>>;
110-
toggleActionContainer: () => void;
111108
snapshots: any;
112109
currLocation: any;
113110
}

src/app/containers/ActionContainer.tsx

Lines changed: 37 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable max-len */
22
import React, { useEffect, useState, useRef } from 'react';
33
import Action from '../components/Actions/Action';
4-
import { emptySnapshots, changeView, changeSlider } from '../slices/mainSlice';
4+
import { emptySnapshots, changeSlider } from '../slices/mainSlice';
55
import { useDispatch, useSelector } from 'react-redux';
66
import RouteDescription from '../components/Actions/RouteDescription';
77
import DropDown from '../components/Actions/DropDown';
@@ -14,8 +14,6 @@ import RecordButton from '../components/Actions/RecordButton';
1414
This file renders the 'ActionContainer'. The action container is the leftmost column in the application. It includes the button that shrinks and expands the action container, a dropdown to select the active site, a clear button, the current selected Route, and a list of selectable snapshots with timestamps.
1515
*/
1616

17-
// resetSlider locates the rc-slider elements on the document and resets it's style attributes
18-
1917
function ActionContainer(props: ActionContainerProps): JSX.Element {
2018
const [dropdownSelection, setDropdownSelection] = useState('Time Jump');
2119
const actionsEndRef = useRef(null as unknown as HTMLDivElement);
@@ -24,12 +22,7 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
2422
const { currentTab, tabs, port }: MainState = useSelector((state: RootState) => state.main);
2523

2624
const { currLocation, hierarchy, sliderIndex, viewIndex }: Partial<CurrentTab> = tabs[currentTab]; // we destructure the currentTab object
27-
const {
28-
toggleActionContainer, // function that handles Time Jump Sidebar view from MainContainer
29-
actionView, // local state declared in MainContainer
30-
setActionView, // function to update actionView state declared in MainContainer,
31-
snapshots,
32-
} = props;
25+
const { snapshots } = props;
3326
const [recordingActions, setRecordingActions] = useState(true); // We create a local state 'recordingActions' and set it to true
3427
let actionsArr: JSX.Element[] = []; // we create an array 'actionsArr' that will hold elements we create later on
3528
// we create an array 'hierarchyArr' that will hold objects and numbers
@@ -143,62 +136,43 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
143136
// UNLESS actionView={true} is passed into <ActionContainer /> in the beforeEach() call in ActionContainer.test.tsx
144137
return (
145138
<div id='action-id' className='action-container'>
146-
<div className='actionToolContainer'>
147-
<div id='arrow'>
148-
<aside className='aside'>
149-
<a
150-
onClick={(e) => {
151-
e.stopPropagation;
152-
toggleActionContainer();
153-
}}
154-
className='toggle'
155-
>
156-
{' '}
157-
<i />
158-
</a>
159-
</aside>
160-
<div className='collapse'>Collapse</div>
161-
</div>
162-
</div>
163-
{actionView ? (
164-
<div className='action-button-wrapper'>
165-
<RecordButton
166-
isRecording={recordingActions}
167-
onToggle={() => {
168-
toggleRecord();
169-
setRecordingActions(!recordingActions);
139+
<div className='action-button-wrapper'>
140+
<RecordButton
141+
isRecording={recordingActions}
142+
onToggle={() => {
143+
toggleRecord();
144+
setRecordingActions(!recordingActions);
145+
}}
146+
/>
147+
<DropDown
148+
dropdownSelection={dropdownSelection}
149+
setDropdownSelection={setDropdownSelection}
150+
/>
151+
<div className='clear-button-container'>
152+
<Button
153+
className='clear-button-modern'
154+
variant='text'
155+
onClick={() => {
156+
dispatch(emptySnapshots()); // set slider back to zero, visually
157+
dispatch(changeSlider(0));
170158
}}
171-
/>
172-
<DropDown
173-
dropdownSelection={dropdownSelection}
174-
setDropdownSelection={setDropdownSelection}
175-
/>
176-
<div className='clear-button-container'>
177-
<Button
178-
className='clear-button-modern'
179-
variant='text'
180-
onClick={() => {
181-
dispatch(emptySnapshots()); // set slider back to zero, visually
182-
dispatch(changeSlider(0));
183-
}}
184-
type='button'
185-
>
186-
Clear
187-
</Button>
188-
</div>
189-
<div className='snapshots'>
190-
{dropdownSelection === 'Providers / Consumers' && (
191-
<ProvConContainer currentSnapshot={currLocation.stateSnapshot} />
192-
)}
193-
{dropdownSelection === 'Time Jump' &&
194-
Object.keys(routes).map((route, i) => (
195-
<RouteDescription key={`route${i}`} actions={routes[route]} />
196-
))}
197-
{/* Add ref for scrolling */}
198-
<div ref={actionsEndRef} />
199-
</div>
159+
type='button'
160+
>
161+
Clear
162+
</Button>
163+
</div>
164+
<div className='snapshots'>
165+
{dropdownSelection === 'Providers / Consumers' && (
166+
<ProvConContainer currentSnapshot={currLocation.stateSnapshot} />
167+
)}
168+
{dropdownSelection === 'Time Jump' &&
169+
Object.keys(routes).map((route, i) => (
170+
<RouteDescription key={`route${i}`} actions={routes[route]} />
171+
))}
172+
{/* Add ref for scrolling */}
173+
<div ref={actionsEndRef} />
200174
</div>
201-
) : null}
175+
</div>
202176
</div>
203177
);
204178
}

src/app/containers/MainContainer.tsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,6 @@ function MainContainer(): JSX.Element {
2929

3030
const { currentTab, tabs, port }: MainState = useSelector((state: RootState) => state.main);
3131

32-
const [actionView, setActionView] = useState(true); // We create a local state 'actionView' and set it to true
33-
34-
// this function handles Time Jump sidebar view
35-
const toggleActionContainer = () => {
36-
setActionView(!actionView); // sets actionView to the opposite boolean value
37-
38-
const bodyContainer = document.getElementById('bodyContainer');
39-
bodyContainer.classList.toggle('collapsed');
40-
41-
const toggleElem = document.querySelector('aside'); // aside is like an added text that appears "on the side" aside some text.
42-
toggleElem.classList.toggle('no-aside'); // toggles the addition or the removal of the 'no-aside' class
43-
44-
const collapse = document.querySelector('.collapse');
45-
collapse.classList.toggle('hidden');
46-
47-
const recordBtn = document.getElementById('recordBtn');
48-
49-
if (recordBtn.style.display === 'none') {
50-
// switches whether to display the record toggle button by changing the display property between none and flex
51-
recordBtn.style.display = 'flex';
52-
} else {
53-
recordBtn.style.display = 'none';
54-
}
55-
};
56-
5732
// Function handles when Reactime unexpectedly disconnects
5833
const handleDisconnect = (msg): void => {
5934
if (msg === 'portDisconnect') dispatch(disconnected());
@@ -69,7 +44,6 @@ function MainContainer(): JSX.Element {
6944
payload: Record<string, unknown>;
7045
sourceTab: number;
7146
}) => {
72-
// const { action, payload, sourceTab } = message;
7347
let maxTab: number;
7448

7549
if (!sourceTab && action !== 'keepAlive') {
@@ -89,7 +63,6 @@ function MainContainer(): JSX.Element {
8963
dispatch(noDev(payload));
9064
break;
9165
}
92-
// JR 12.20.23 9.53pm added a listener case for sending aReactApp to frontend
9366
case 'aReactApp': {
9467
dispatch(aReactApp(payload));
9568
break;
@@ -198,13 +171,7 @@ function MainContainer(): JSX.Element {
198171
return (
199172
<div className='main-container'>
200173
<div id='bodyContainer' className='body-container'>
201-
<ActionContainer
202-
actionView={actionView}
203-
setActionView={setActionView}
204-
toggleActionContainer={toggleActionContainer}
205-
snapshots={snapshots}
206-
currLocation={currLocation}
207-
/>
174+
<ActionContainer snapshots={snapshots} currLocation={currLocation} />
208175
{/* @ts-ignore */}
209176
{snapshots.length ? (
210177
<div className='state-container-container'>

src/app/styles/components/_buttons.scss

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -56,64 +56,6 @@
5656
}
5757

5858
/* sidebar button open and closing functionality */
59-
/* Container for arrow and collapse text */
60-
#arrow {
61-
height: 44px;
62-
display: flex;
63-
align-items: center;
64-
background-color: white;
65-
}
66-
67-
/* Base toggle styling */
68-
.toggle {
69-
height: 100%;
70-
width: 45px;
71-
display: flex;
72-
align-items: center;
73-
justify-content: center;
74-
position: relative;
75-
cursor: pointer;
76-
}
77-
78-
/* Modern chevron using border technique - default facing left */
79-
.toggle i {
80-
position: relative;
81-
width: 6px;
82-
height: 6px;
83-
border-right: 2px solid #6b7280;
84-
border-bottom: 2px solid #6b7280;
85-
transform: rotate(135deg); /* Changed to 135deg to face left by default */
86-
transition: transform 0.3s ease;
87-
display: block;
88-
}
89-
90-
/* Clean up unused pseudo-elements */
91-
.toggle i::before,
92-
.toggle i::after {
93-
display: none;
94-
}
95-
96-
/* Rotation for collapsed state - rotate to face right */
97-
.no-aside .toggle i {
98-
transform: rotate(-45deg); /* Changed to -45deg to face right when collapsed */
99-
}
100-
101-
/* Hover state matching modern UI */
102-
.toggle:hover i {
103-
border-color: #374151;
104-
}
105-
106-
/* Modern collapse text styling */
107-
.collapse {
108-
display: flex;
109-
align-items: center;
110-
color: #6b7280;
111-
font-size: 1.1rem;
112-
font-weight: 500;
113-
font-family: 'Outfit', sans-serif;
114-
transition: color 0.2s ease;
115-
}
116-
11759
.record-button-container {
11860
display: flex;
11961
align-items: center;
@@ -155,26 +97,6 @@
15597
}
15698
}
15799

158-
/* Hover state for the entire action area */
159-
#arrow:hover .collapse {
160-
color: #374151;
161-
}
162-
163-
/* Smooth transition for sidebar */
164-
aside {
165-
background-color: white;
166-
transition: width 0.3s ease;
167-
}
168-
169-
.no-aside {
170-
width: 45px;
171-
}
172-
173-
/* Hide collapse text when sidebar is collapsed */
174-
.hidden {
175-
display: none;
176-
}
177-
178100
.clear-button-modern {
179101
width: 100% !important;
180102
background-color: #f3f4f6 !important;

src/app/styles/layout/_actionContainer.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@
1515
}
1616
}
1717

18-
.collapsed .action-container {
19-
.action-button-wrapper {
20-
opacity: 0;
21-
visibility: hidden;
22-
}
23-
}
24-
25-
.actionToolContainer {
26-
display: flex;
27-
align-items: center;
28-
border-bottom: 1px solid #e5e7eb;
29-
}
30-
3118
.clear-button-container {
3219
padding: 16px;
3320
}

src/app/styles/layout/_bodyContainer.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
'actions states'
99
'bottom bottom';
1010
transition: grid-template-columns 0.3s ease;
11-
12-
&.collapsed {
13-
grid-template-columns: 45px 1fr;
14-
}
1511
}
1612

1713
.bottom-controls {

0 commit comments

Comments
 (0)