@@ -35,7 +35,6 @@ export type AudioAttachmentProps = {
3535 * UI Component to preview the audio files
3636 */
3737export const AudioAttachment = ( props : AudioAttachmentProps ) => {
38- const [ width , setWidth ] = useState ( 0 ) ;
3938 const [ currentSpeed , setCurrentSpeed ] = useState < number > ( 1.0 ) ;
4039 const soundRef = React . useRef < SoundReturnType | null > ( null ) ;
4140 const {
@@ -228,9 +227,6 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
228227 return (
229228 < View
230229 accessibilityLabel = 'audio-attachment-preview'
231- onLayout = { ( { nativeEvent } ) => {
232- setWidth ( nativeEvent . layout . width ) ;
233- } }
234230 style = { [
235231 styles . container ,
236232 {
@@ -264,11 +260,6 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
264260 styles . filenameText ,
265261 {
266262 color : black ,
267- width :
268- 16 - // 16 = horizontal padding
269- 40 - // 40 = file icon size
270- 24 - // 24 = close icon size
271- 24 , // 24 = internal padding
272263 } ,
273264 I18nManager . isRTL ? { writingDirection : 'rtl' } : { writingDirection : 'ltr' } ,
274265 filenameText ,
@@ -316,7 +307,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
316307 onProgressDrag = { handleProgressDrag }
317308 progress = { item . progress as number }
318309 testID = 'progress-control'
319- width = { width / 2 }
310+ width = { 150 }
320311 />
321312 ) }
322313 </ View >
@@ -365,50 +356,48 @@ const styles = StyleSheet.create({
365356 fontSize : 14 ,
366357 fontWeight : 'bold' ,
367358 paddingBottom : 12 ,
368- paddingLeft : 8 ,
369359 } ,
370360 leftContainer : {
371361 justifyContent : 'space-around' ,
362+ marginHorizontal : 16 ,
363+ width : '60%' ,
372364 } ,
373365 playPauseButton : {
374366 alignItems : 'center' ,
375367 alignSelf : 'center' ,
376368 borderRadius : 50 ,
377- display : 'flex' ,
378369 elevation : 4 ,
379370 justifyContent : 'center' ,
380- paddingVertical : 2 ,
371+ padding : 2 ,
381372 shadowOffset : {
382373 height : 2 ,
383374 width : 0 ,
384375 } ,
385376 shadowOpacity : 0.23 ,
386377 shadowRadius : 2.62 ,
387- width : 36 ,
388378 } ,
389379 progressControlContainer : { } ,
390380 progressDurationText : {
391381 fontSize : 12 ,
392- paddingLeft : 10 ,
393- paddingRight : 8 ,
382+ marginRight : 4 ,
394383 } ,
395384 rightContainer : {
396- marginLeft : 10 ,
385+ marginLeft : 'auto' ,
397386 } ,
398387 speedChangeButton : {
399388 alignItems : 'center' ,
400389 alignSelf : 'center' ,
401390 borderRadius : 50 ,
402391 elevation : 4 ,
403392 justifyContent : 'center' ,
393+ paddingHorizontal : 10 ,
404394 paddingVertical : 5 ,
405395 shadowOffset : {
406396 height : 2 ,
407397 width : 0 ,
408398 } ,
409399 shadowOpacity : 0.23 ,
410400 shadowRadius : 2.62 ,
411- width : 36 ,
412401 } ,
413402 speedChangeButtonText : {
414403 fontSize : 12 ,
0 commit comments