Skip to content

Commit b632e23

Browse files
committed
finished style ax tab
1 parent 2117bcd commit b632e23

File tree

4 files changed

+24
-94
lines changed

4 files changed

+24
-94
lines changed

src/app/components/StateRoute/AxMap/Ax.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default function AxTree(props) {
149149

150150
return totalWidth < 10 ? null : (
151151
<div>
152-
<div id='axControls'>
152+
<div className='axControls'>
153153
<LinkControls
154154
orientation={orientation}
155155
linkType={linkType}

src/app/components/StateRoute/AxMap/axLinkControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const AxLinkControls = ({
4040

4141
{linkType === 'step' && (
4242
<div className='control-group'>
43-
<label className='control-label'>step:</label>
43+
<label className='control-label'>Step:</label>
4444
<input
4545
onClick={(e) => e.stopPropagation()}
4646
type='range'

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 15 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,36 @@ import WebMetricsContainer from './WebMetrics/WebMetricsContainer';
1717
import { MainState, RootState, StateRouteProps } from '../../FrontendTypes';
1818
import AxContainer from './AxMap/AxContainer';
1919

20-
/*
21-
Loads the appropriate StateRoute view and renders the Map, Performance, History, Webmetrics, and Tree navbar buttons after clicking on the 'State' button located near the top rightmost corner.
22-
*/
23-
2420
const History = require('./History').default;
25-
const NO_STATE_MSG = 'No state change detected. Trigger an event to change state'; // message to be returned if there has been no state change detected in our hooked/target app
21+
const NO_STATE_MSG = 'No state change detected. Trigger an event to change state';
2622

2723
const StateRoute = (props: StateRouteProps) => {
2824
const {
29-
axSnapshots, // from 'tabs[currentTab]' object in 'MainContainer'
30-
snapshot, // from 'tabs[currentTab]' object in 'MainContainer'
31-
hierarchy: propsHierarchy, // from 'tabs[currentTab]' object in 'MainContainer'
32-
snapshots, // from 'tabs[currentTab].snapshotDisplay' object in 'MainContainer'
33-
viewIndex: propsViewIndex, // from 'tabs[currentTab]' object in 'MainContainer'
34-
webMetrics, // from 'tabs[currentTab]' object in 'MainContainer'
35-
currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
25+
axSnapshots,
26+
snapshot,
27+
hierarchy: propsHierarchy,
28+
snapshots,
29+
viewIndex: propsViewIndex,
30+
webMetrics,
31+
currLocation,
3632
} = props;
3733

3834
const { tabs, currentTab }: MainState = useSelector((state: RootState) => state.main);
3935
const { hierarchy: tabsHierarchy, sliderIndex, viewIndex: tabsViewIndex } = tabs[currentTab];
4036
const hierarchy = propsHierarchy || tabsHierarchy;
4137
const viewIndex = propsViewIndex || tabsViewIndex;
4238

43-
// lines 45 - 63 contains functionality to disable the accessibility features in Reactime.
4439
const dispatch = useDispatch();
4540
const [showTree, setShowTree] = useState(false);
46-
const [selectedValue, setSelectedValue] = useState('disable');
4741
const [showParagraph, setShowParagraph] = useState(true);
4842

4943
const enableAxTreeButton = () => {
5044
dispatch(toggleAxTree('toggleAxRecord'));
5145
dispatch(setCurrentTabInApp('AxTree'));
52-
setSelectedValue('enable');
5346
setShowParagraph(false);
5447
setShowTree(true);
5548
};
5649

57-
const disableAxTree = () => {
58-
dispatch(toggleAxTree('toggleAxRecord'));
59-
setSelectedValue('disable');
60-
setShowParagraph(true);
61-
setShowTree(false);
62-
};
63-
6450
return (
6551
<div className='app-body'>
6652
<div className='main-navbar-container'>
@@ -128,39 +114,12 @@ const StateRoute = (props: StateRouteProps) => {
128114
element={
129115
showTree ? (
130116
<div>
131-
<div className='accessibility-controls'>
132-
<input
133-
type='radio'
134-
id='enable'
135-
name='accessibility'
136-
value='enable'
137-
checked={selectedValue === 'enable'}
138-
onChange={() => {
139-
enableAxTreeButton();
140-
}}
141-
/>
142-
<label htmlFor='enable'>Enable</label>
143-
144-
<input
145-
type='radio'
146-
id='disable'
147-
name='accessibility'
148-
value='disable'
149-
checked={selectedValue === 'disable'}
150-
onChange={() => {
151-
disableAxTree();
152-
}}
153-
/>
154-
<label htmlFor='disable'>Disable</label>
155-
</div>
156-
{showTree && (
157-
<AxContainer
158-
axSnapshots={axSnapshots}
159-
snapshot={snapshot}
160-
snapshots={snapshots}
161-
currLocation={currLocation}
162-
/>
163-
)}
117+
<AxContainer
118+
axSnapshots={axSnapshots}
119+
snapshot={snapshot}
120+
snapshots={snapshots}
121+
currLocation={currLocation}
122+
/>
164123
</div>
165124
) : (
166125
<div>
@@ -180,24 +139,9 @@ const StateRoute = (props: StateRouteProps) => {
180139
id='enable'
181140
name='accessibility'
182141
value='enable'
183-
checked={selectedValue === 'enable'}
184-
onChange={() => {
185-
enableAxTreeButton();
186-
}}
142+
onChange={enableAxTreeButton}
187143
/>
188144
<label htmlFor='enable'>Enable</label>
189-
190-
<input
191-
type='radio'
192-
id='disable'
193-
name='accessibility'
194-
value='disable'
195-
checked={selectedValue === 'disable'}
196-
onChange={() => {
197-
disableAxTree();
198-
}}
199-
/>
200-
<label htmlFor='disable'>Disable</label>
201145
</div>
202146
</div>
203147
)

src/app/styles/components/_ax.scss

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Ax.tsx
2-
#axControls {
3-
display: inline-flex;
4-
position: sticky;
5-
left: 0;
2+
.axControls {
3+
display: flex;
4+
justify-content: space-evenly;
65
}
76

87
/* Container for the radio controls */
98
.accessibility-controls {
109
display: flex;
1110
align-items: center;
1211
gap: 16px;
13-
padding: 12px 16px;
12+
padding: 12px 24px;
1413
}
1514

1615
/* Hide the default radio inputs */
@@ -23,32 +22,19 @@
2322
display: inline-flex;
2423
align-items: center;
2524
justify-content: center;
26-
min-width: 50px;
25+
min-width: 60px;
2726
padding: 6px 12px;
2827
font-family: 'Outfit', sans-serif;
2928
font-size: 14px;
3029
font-weight: 500;
31-
color: #374151;
32-
background-color: #f3f4f6;
30+
color: white;
31+
background-color: #14b8a6;
3332
border-radius: 6px;
3433
cursor: pointer;
3534
transition: all 200ms ease;
3635
user-select: none;
3736
}
3837

39-
/* Hover state */
40-
.accessibility-controls label:hover {
41-
background-color: #e5e7eb;
42-
}
43-
44-
/* Active/selected state */
45-
.accessibility-controls input[type='radio']:checked + label {
46-
background-color: #14b8a6;
47-
color: white;
48-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
49-
}
50-
51-
/* Add consistent spacing around the warning text */
5238
.accessibility-text {
5339
padding: 12px 24px;
5440
max-width: 800px;

0 commit comments

Comments
 (0)