1- import { withStyles } from " @material-ui/core/styles" ;
1+ import { withStyles } from ' @material-ui/core/styles' ;
22import {
33 Grid ,
44 Icon ,
55 IconButton ,
66 Paper ,
77 Slider ,
88 Typography ,
9- } from " @material-ui/core" ;
9+ } from ' @material-ui/core' ;
1010
11- import Forward10Icon from " @material-ui/icons/Forward10" ;
12- import Replay10Icon from " @material-ui/icons/Replay10" ;
13- import PauseRoundedIcon from " @material-ui/icons/PauseRounded" ;
14- import PlayArrowRoundedIcon from " @material-ui/icons/PlayArrowRounded" ;
11+ import Forward10Icon from ' @material-ui/icons/Forward10' ;
12+ import Replay10Icon from ' @material-ui/icons/Replay10' ;
13+ import PauseRoundedIcon from ' @material-ui/icons/PauseRounded' ;
14+ import PlayArrowRoundedIcon from ' @material-ui/icons/PlayArrowRounded' ;
1515
16- import pin from " ../../../other/pin.svg" ;
16+ import pin from ' ../../../other/pin.svg' ;
1717
1818const displayTime = ( secs ) => {
1919 let minutes = Math . floor ( secs / 60 ) ;
@@ -29,12 +29,12 @@ const getIconByPlayerStatus = (playerStatus, setPlayerStatus) => {
2929 const PlayerIconButton = withStyles ( ( theme ) => ( {
3030 root : {
3131 color : theme . palette . teal . main ,
32- padding : " 0px" ,
32+ padding : ' 0px' ,
3333 } ,
3434 label : {
35- " & .MuiSvgIcon-root" : {
36- width : " 80px" ,
37- height : " 80px" ,
35+ ' & .MuiSvgIcon-root' : {
36+ width : ' 80px' ,
37+ height : ' 80px' ,
3838 } ,
3939 } ,
4040 } ) ) ( IconButton ) ;
@@ -48,58 +48,58 @@ const getIconByPlayerStatus = (playerStatus, setPlayerStatus) => {
4848
4949const AudioSlider = withStyles ( ( theme , index ) => ( {
5050 marked : {
51- marginBottom : " 0px" ,
51+ marginBottom : ' 0px' ,
5252 } ,
5353 thumb : {
54- borderRadius : "0" ,
55- color : " black" ,
56- height : " 48px" ,
57- marginTop : " -23px" ,
58- marginLeft : " -2px" ,
59- width : " 4px" ,
60- boxShadow : " none !important" ,
61- " &::after" : {
62- top : " 0px" ,
63- left : " 0px" ,
64- right : " 0px" ,
65- bottom : " 0px" ,
54+ borderRadius : '0' ,
55+ color : ' black' ,
56+ height : ' 48px' ,
57+ marginTop : ' -23px' ,
58+ marginLeft : ' -2px' ,
59+ width : ' 4px' ,
60+ boxShadow : ' none !important' ,
61+ ' &::after' : {
62+ top : ' 0px' ,
63+ left : ' 0px' ,
64+ right : ' 0px' ,
65+ bottom : ' 0px' ,
6666 } ,
6767 } ,
6868 root : {
69- height : " 6px" ,
69+ height : ' 6px' ,
7070 } ,
7171 rail : {
72- height : " 6px" ,
72+ height : ' 6px' ,
7373 color : theme . palette . teal . light ,
74- opacity : " 100%" ,
74+ opacity : ' 100%' ,
7575 } ,
7676 track : {
77- height : " 6px" ,
77+ height : ' 6px' ,
7878 color : theme . palette . teal . main ,
79- borderRadius : " 6px" ,
79+ borderRadius : ' 6px' ,
8080 } ,
8181 mark : {
82- height : " 14px" ,
83- width : " 14px" ,
84- borderRadius : " 14px" ,
82+ height : ' 14px' ,
83+ width : ' 14px' ,
84+ borderRadius : ' 14px' ,
8585 backgroundColor : theme . palette . pink . main ,
86- marginTop : " -4px" ,
87- marginLeft : " -4px" ,
86+ marginTop : ' -4px' ,
87+ marginLeft : ' -4px' ,
8888 zIndex : 1 ,
8989 } ,
9090 markActive : {
9191 opacity : 1 ,
9292 backgroundColor : theme . palette . pink . dark ,
9393 } ,
9494 markLabel : {
95- top : " inherit" ,
96- transform : " none" ,
97- height : " 6px" ,
98- width : " 100%" ,
99- borderRadius : " 6px" ,
95+ top : ' inherit' ,
96+ transform : ' none' ,
97+ height : ' 6px' ,
98+ width : ' 100%' ,
99+ borderRadius : ' 6px' ,
100100 // left: "0 !important",
101101 opacity : 0.6 ,
102- lineHeight : " 30px" ,
102+ lineHeight : ' 30px' ,
103103 } ,
104104} ) ) ( Slider ) ;
105105
@@ -110,6 +110,7 @@ const ColorLibAudioPlayer = ({
110110 setCurrentTime,
111111 duration,
112112 marks, // List of integers, each in seconds
113+ hideAddPin = false ,
113114 addPin = null ,
114115 curPinIndex = null ,
115116} ) => {
@@ -118,36 +119,36 @@ const ColorLibAudioPlayer = ({
118119 const JumpIconButton = withStyles ( ( theme ) => ( {
119120 root : {
120121 color : theme . palette . teal . main ,
121- padding : " 10px" ,
122+ padding : ' 10px' ,
122123 } ,
123124 label : {
124- " & .MuiSvgIcon-root" : {
125- width : " 40px" ,
126- height : " 40px" ,
125+ ' & .MuiSvgIcon-root' : {
126+ width : ' 40px' ,
127+ height : ' 40px' ,
127128 } ,
128129 } ,
129130 } ) ) ( IconButton ) ;
130131
131132 const PinIconButton = withStyles ( ( theme ) => ( {
132133 root : {
133- padding : " 15px" ,
134- boxShadow : " 0px 6px 8px rgba(51, 126, 146, 0.25)" ,
135- border : " 1.5px solid" ,
134+ padding : ' 15px' ,
135+ boxShadow : ' 0px 6px 8px rgba(51, 126, 146, 0.25)' ,
136+ border : ' 1.5px solid' ,
136137 borderColor : theme . palette . teal . lighter ,
137138 } ,
138139 label : {
139- " & .MuiIcon-root" : {
140- width : " 27px" ,
141- height : " 27px" ,
140+ ' & .MuiIcon-root' : {
141+ width : ' 27px' ,
142+ height : ' 27px' ,
142143 } ,
143144 } ,
144145 } ) ) ( IconButton ) ;
145146
146147 // Before creating mark information for pins, check there are no duplicates.
147148 marks = [ ...new Set ( marks ) ] ;
148149 const pinMarks = marks . map ( ( m , index ) => {
149- const markTime = m . pinTime
150- const markCreatorMode = m . creatorMode
150+ const markTime = m . pinTime ;
151+ const markCreatorMode = m . creatorMode ;
151152 console . log ( m ) ;
152153
153154 const centerPercentage = ( markTime / duration ) * 100 ;
@@ -169,19 +170,19 @@ const ColorLibAudioPlayer = ({
169170 < >
170171 < div
171172 style = { {
172- height : " 6px" ,
173- position : " relative" ,
173+ height : ' 6px' ,
174+ position : ' relative' ,
174175 left : `calc(${ left } %)` ,
175176 width : `${ rightNewWidth } %` ,
176- borderRadius : " 6px" ,
177- backgroundColor : " #FDA2A9" ,
177+ borderRadius : ' 6px' ,
178+ backgroundColor : ' #FDA2A9' ,
178179 } }
179180 />
180181 < div
181182 style = { {
182183 marginRight : `calc(${ leftPercentage } % + 3px)` ,
183184 width : `calc(${ widthPercentage } %)` ,
184- color : markCreatorMode == " callee" ? " #FDA2A9" : " black"
185+ color : markCreatorMode == ' callee' ? ' #FDA2A9' : ' black' ,
185186 } }
186187 >
187188 { index + 1 }
@@ -193,27 +194,27 @@ const ColorLibAudioPlayer = ({
193194
194195 return (
195196 < Paper
196- variant = " outlined"
197- style = { { padding : " 10px 10px 20px 10px" , marginTop : 10 } }
197+ variant = ' outlined'
198+ style = { { padding : ' 10px 10px 20px 10px' , marginTop : 10 } }
198199 >
199200 < Grid container >
200201 < Grid
201202 item
202203 xs = { 1 }
203- style = { { alignItems : " center" , justifyContent : " center" } }
204+ style = { { alignItems : ' center' , justifyContent : ' center' } }
204205 >
205206 { getIconByPlayerStatus ( playerStatus , setPlayerStatus ) }
206207 </ Grid >
207208
208209 < Grid
209210 item
210211 xs = { 1 }
211- style = { { alignItems : " center" , justifyContent : " center" } }
212+ style = { { alignItems : ' center' , justifyContent : ' center' } }
212213 >
213- < Typography variant = " body2" > { displayTime ( currentTime ) } </ Typography >
214+ < Typography variant = ' body2' > { displayTime ( currentTime ) } </ Typography >
214215 </ Grid >
215216
216- < Grid item xs = { 9 } style = { { alignItems : " center" } } >
217+ < Grid item xs = { 9 } style = { { alignItems : ' center' } } >
217218 < AudioSlider
218219 value = { currentTime }
219220 onChange = { ( event , newValue ) => {
@@ -228,30 +229,32 @@ const ColorLibAudioPlayer = ({
228229 < Grid
229230 item
230231 xs = { 1 }
231- style = { { alignItems : " center" , justifyContent : " center" } }
232+ style = { { alignItems : ' center' , justifyContent : ' center' } }
232233 >
233- < Typography variant = " body2" > { displayTime ( duration ) } </ Typography >
234+ < Typography variant = ' body2' > { displayTime ( duration ) } </ Typography >
234235 </ Grid >
235236 </ Grid >
236237
237238 < div
238239 style = { {
239- display : " flex" ,
240- alignItems : " center" ,
241- justifyContent : " center" ,
242- marginTop : " -15px" ,
240+ display : ' flex' ,
241+ alignItems : ' center' ,
242+ justifyContent : ' center' ,
243+ marginTop : ' -15px' ,
243244 } }
244245 >
245246 < JumpIconButton
246247 onClick = { ( ) => setCurrentTime ( Math . max ( 0 , currentTime - 10 ) ) }
247248 >
248249 < Replay10Icon />
249250 </ JumpIconButton >
250- < PinIconButton onClick = { ( ) => addPin ( currentTime ) } >
251- < Icon >
252- < img src = { pin } alt = "pin" style = { { height : "100%" } } />
253- </ Icon >
254- </ PinIconButton >
251+ { hideAddPin !== true && (
252+ < PinIconButton onClick = { ( ) => addPin ( currentTime ) } >
253+ < Icon >
254+ < img src = { pin } alt = 'pin' style = { { height : '100%' } } />
255+ </ Icon >
256+ </ PinIconButton >
257+ ) }
255258 < JumpIconButton
256259 onClick = { ( ) => setCurrentTime ( Math . min ( duration , currentTime + 10 ) ) }
257260 >
0 commit comments