Skip to content

Conversation

@devyaniChoubey
Copy link
Contributor

@RocketChat/ReactNative

Closes #1557

Peek 2020-01-14 01-36

thumbImage={isIOS && { uri: 'audio_thumb', scale: Dimensions.get('window').scale }}
/>
<Text style={[styles.duration, { color: themes[theme].auxiliaryText }]}>{this.duration}</Text>
{paused ? <Text style={[styles.duration, { color: themes[theme].auxiliaryText }]}>{this.duration}</Text> : <Text style={[styles.duration, { color: themes[theme].auxiliaryText }]}>{formatTime(currentTime)}</Text>}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole <Text style={[styles.duration, { color: themes[theme].auxiliaryText }]}>...</Text> is repeated twice.
Why not creating a new variable and use it like this?

<Text style={[styles.duration, { color: themes[theme].auxiliaryText }]}>
    {newVariable}
</Text>

@devyaniChoubey
Copy link
Contributor Author

@diegolmello sorry sir for late reply I was busy in my college exams.
I will do it

Copy link
Contributor

@sarthakpranesh sarthakpranesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All we need to do is update the get duration function. We need to deconstruct one more prop currentTime and then minus it to the duration in the return statement. That should do it. By doing so we'll be able to see how much time is left, to do the reverse only pass the currentTime.

@devyaniChoubey
Copy link
Contributor Author

@sarthakpranesh I will try to do the changes today only.Please let me do it. I was busy in my college exams.

@djorkaeffalexandre
Copy link
Contributor

Refer to #2073.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When we listen to any audio message then it will be good if the timer is displayed.

4 participants