diff options
| author | srichman333 <sarah_n_richman@brown.edu> | 2024-03-17 14:15:44 -0400 |
|---|---|---|
| committer | srichman333 <sarah_n_richman@brown.edu> | 2024-03-17 14:15:44 -0400 |
| commit | 20f4d81cb8b04cd2202d76a5fcbc185095437563 (patch) | |
| tree | 60bc3fe9545d06e04cddb155f739f5c514a4a5c3 /src/client/views/StyleProvider.tsx | |
| parent | d790a5912e0bbb431b913f54fbc2bfd11941c0c1 (diff) | |
| parent | 625c3a67fbcbfc93f1f1b35aed10b9fe7f33dfa9 (diff) | |
Merge branch 'master' into dataviz-ai-sarah
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
| -rw-r--r-- | src/client/views/StyleProvider.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx index ab811858a..1adb0d9e5 100644 --- a/src/client/views/StyleProvider.tsx +++ b/src/client/views/StyleProvider.tsx @@ -50,6 +50,11 @@ export enum StyleProp { Highlighting = 'highlighting', // border highlighting } +export enum AudioAnnoState { + stopped = 'stopped', + playing = 'playing', +} + function toggleLockedPosition(doc: Doc) { UndoManager.RunInBatch(() => Doc.toggleLockedPosition(doc), 'toggleBackground'); } @@ -330,14 +335,14 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps & ); }; const audio = () => { - const audioAnnoState = (doc: Doc) => StrCast(doc.audioAnnoState, 'stopped'); + const audioAnnoState = (doc: Doc) => StrCast(doc.audioAnnoState, AudioAnnoState.stopped); const audioAnnosCount = (doc: Doc) => StrListCast(doc[fieldKey + 'audioAnnotations']).length; if (!doc || props?.renderDepth === -1 || !audioAnnosCount(doc)) return null; - const audioIconColors: { [key: string]: string } = { recording: 'red', playing: 'green', stopped: 'blue' }; + const audioIconColors: { [key: string]: string } = { playing: 'green', stopped: 'blue' }; return ( <Tooltip title={<div>{StrListCast(doc[fieldKey + 'audioAnnotations_text']).lastElement()}</div>}> <div className="styleProvider-audio" onPointerDown={() => DocumentManager.Instance.getFirstDocumentView(doc)?.playAnnotation()}> - <FontAwesomeIcon className="documentView-audioFont" style={{ color: audioIconColors[audioAnnoState(doc)] }} icon={'file-audio'} size="sm" /> + <FontAwesomeIcon className="documentView-audioFont" style={{ color: audioIconColors[audioAnnoState(doc)] }} icon='file-audio' size="sm" /> </div> </Tooltip> ); |
