Skip to content

Commit a1a08bb

Browse files
committed
styled record text and added red circle
1 parent 145eb4e commit a1a08bb

File tree

4 files changed

+79
-11
lines changed

4 files changed

+79
-11
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"jest-environment-jsdom": "^29.7.0",
189189
"jsondiffpatch": "^0.5.0",
190190
"lodash": "^4.17.21",
191+
"lucide-react": "^0.468.0",
191192
"node": "^18.12.1",
192193
"prettier": "^3.1.1",
193194
"rc-slider": "^10.5.0",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { Switch } from '@mui/material';
3+
4+
const RecordButton = ({ isRecording, onToggle }) => {
5+
return (
6+
<div className='record-button-container'>
7+
<div className='record-label'>
8+
<div className={`record-icon ${isRecording ? 'recording' : ''}`} />
9+
<span>Record</span>
10+
</div>
11+
<Switch
12+
checked={isRecording}
13+
onChange={onToggle}
14+
sx={{
15+
'& .MuiSwitch-switchBase.Mui-checked': {
16+
color: '#38bdf8',
17+
},
18+
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
19+
backgroundColor: '#0284c7',
20+
},
21+
}}
22+
/>
23+
</div>
24+
);
25+
};
26+
27+
export default RecordButton;

src/app/containers/ActionContainer.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import DropDown from '../components/Actions/DropDown';
88
import ProvConContainer from './ProvConContainer';
99
import { ActionContainerProps, CurrentTab, MainState, Obj, RootState } from '../FrontendTypes';
1010
import { Button, Switch } from '@mui/material';
11+
import RecordButton from '../components/Actions/RecordButton';
1112

1213
/*
1314
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.
@@ -191,16 +192,13 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
191192
</div>
192193
{actionView ? (
193194
<div className='action-button-wrapper'>
194-
<a type='button' id='recordBtn' onClick={toggleRecord}>
195-
<i />
196-
<div
197-
className='toggle-record'
198-
style={{ display: 'flex', alignItems: 'center', textAlign: 'right' }}
199-
>
200-
Record
201-
</div>
202-
{recordingActions ? <Switch defaultChecked /> : <Switch />}
203-
</a>
195+
<RecordButton
196+
isRecording={recordingActions}
197+
onToggle={() => {
198+
toggleRecord();
199+
setRecordingActions(!recordingActions);
200+
}}
201+
/>
204202
<DropDown
205203
dropdownSelection={dropdownSelection}
206204
setDropdownSelection={setDropdownSelection}

src/app/styles/components/_buttons.scss

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,55 @@
364364
display: flex;
365365
align-items: center;
366366
color: #6b7280;
367-
font-size: 1rem;
367+
font-size: 1.1rem;
368368
font-weight: 500;
369369
padding-left: 0.5rem;
370370
font-family: 'Outfit', sans-serif;
371371
transition: color 0.2s ease;
372372
}
373373

374+
.record-button-container {
375+
display: flex;
376+
align-items: center;
377+
padding: 4px 16px;
378+
width: 100%;
379+
background: transparent;
380+
gap: 8px;
381+
}
382+
383+
.record-label {
384+
display: flex;
385+
align-items: center;
386+
gap: 8px;
387+
color: #374151;
388+
font-size: 14px;
389+
font-weight: 500;
390+
}
391+
392+
.record-icon {
393+
width: 10px;
394+
height: 10px;
395+
background-color: #ef4444;
396+
border-radius: 50%;
397+
transition: opacity 0.3s ease;
398+
}
399+
400+
.record-icon.recording {
401+
animation: pulse 2s infinite;
402+
}
403+
404+
@keyframes pulse {
405+
0% {
406+
opacity: 1;
407+
}
408+
50% {
409+
opacity: 0.5;
410+
}
411+
100% {
412+
opacity: 1;
413+
}
414+
}
415+
374416
/* Hover state for the entire action area */
375417
#arrow:hover .collapse {
376418
color: #374151;

0 commit comments

Comments
 (0)