Skip to content

Commit 435a0a1

Browse files
committed
styled ax buttons need to move other buttons
1 parent 1b2140b commit 435a0a1

File tree

2 files changed

+101
-31
lines changed

2 files changed

+101
-31
lines changed

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useDispatch, useSelector } from 'react-redux';
1515
import PerformanceVisx from './PerformanceVisx/PerformanceVisx';
1616
import WebMetricsContainer from './WebMetrics/WebMetricsContainer';
1717
import { MainState, RootState, StateRouteProps } from '../../FrontendTypes';
18-
import AxContainer from './AxMap/AxContainer';
18+
import AxContainer from './AxMap/AxContainer';
1919

2020
/*
2121
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.
@@ -128,25 +128,31 @@ const StateRoute = (props: StateRouteProps) => {
128128
element={
129129
showTree ? (
130130
<div>
131-
<input
132-
type='radio'
133-
value='enable'
134-
checked={selectedValue === 'enable'}
135-
onChange={() => {
136-
enableAxTreeButton();
137-
}}
138-
/>
139-
<label htmlFor='enable'>Enable</label>
140-
<input
141-
type='radio'
142-
value='disable'
143-
checked={selectedValue === 'disable'}
144-
onChange={() => {
145-
disableAxTree();
146-
}}
147-
/>
148-
<label htmlFor='disable'>Disable</label>
149-
{/* @ts-ignore */}
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>
150156
{showTree && (
151157
<AxContainer
152158
axSnapshots={axSnapshots}
@@ -159,25 +165,32 @@ const StateRoute = (props: StateRouteProps) => {
159165
) : (
160166
<div>
161167
{showParagraph && (
162-
<p>
163-
A Note to Developers: Reactime is using the Chrome Debugger API in order to
164-
grab the Accessibility Tree. Enabling this option will allow you to record
165-
Accessibility Tree snapshots, but will result in the Chrome browser notifying
166-
you that the Chrome Debugger has started.
167-
</p>
168+
<div className='accessibility-text'>
169+
<p>
170+
A Note to Developers: Reactime is using the Chrome Debugger API in order to
171+
grab the Accessibility Tree. Enabling this option will allow you to record
172+
Accessibility Tree snapshots, but will result in the Chrome browser
173+
notifying you that the Chrome Debugger has started.
174+
</p>
175+
</div>
168176
)}
169-
<div>
177+
<div className='accessibility-controls'>
170178
<input
171179
type='radio'
180+
id='enable'
181+
name='accessibility'
172182
value='enable'
173183
checked={selectedValue === 'enable'}
174184
onChange={() => {
175185
enableAxTreeButton();
176186
}}
177187
/>
178188
<label htmlFor='enable'>Enable</label>
189+
179190
<input
180191
type='radio'
192+
id='disable'
193+
name='accessibility'
181194
value='disable'
182195
checked={selectedValue === 'disable'}
183196
onChange={() => {

src/app/styles/components/_ax.scss

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
11
// Ax.tsx
22
#axControls {
3-
display: inline-flex;
4-
position: sticky;
5-
left: 0;
6-
}
3+
display: inline-flex;
4+
position: sticky;
5+
left: 0;
6+
}
7+
8+
/* Container for the radio controls */
9+
.accessibility-controls {
10+
display: flex;
11+
align-items: center;
12+
gap: 16px;
13+
padding: 12px 16px;
14+
}
15+
16+
/* Hide the default radio inputs */
17+
.accessibility-controls input[type='radio'] {
18+
display: none;
19+
}
20+
21+
/* Style the labels as buttons */
22+
.accessibility-controls label {
23+
display: inline-flex;
24+
align-items: center;
25+
justify-content: center;
26+
min-width: 50px;
27+
padding: 6px 12px;
28+
font-family: 'Outfit', sans-serif;
29+
font-size: 14px;
30+
font-weight: 500;
31+
color: #374151;
32+
background-color: #f3f4f6;
33+
border-radius: 6px;
34+
cursor: pointer;
35+
transition: all 200ms ease;
36+
user-select: none;
37+
}
38+
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 */
52+
.accessibility-text {
53+
padding: 12px 24px;
54+
max-width: 800px;
55+
line-height: 1.5;
56+
}
57+
58+
.accessibility-text p {
59+
margin: 0;
60+
color: #374151;
61+
font-size: 16px;
62+
font-family: 'Outfit', sans-serif;
63+
}

0 commit comments

Comments
 (0)