Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewind feature #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Rewind feature #1

wants to merge 4 commits into from

Conversation

Gnarll
Copy link
Contributor

@Gnarll Gnarll commented Jul 21, 2022

No description provided.

const rewindOnDoubleTap = (e: TapGestureHandlerStateChangeEvent) => {
playerRef.current?.context
if (
e.nativeEvent.state === State.ACTIVE &&

Choose a reason for hiding this comment

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

Please, move this logic to variable

e.nativeEvent.y < rewindingViewHeight + rewindingViewHeightMargin &&
e.nativeEvent.y > rewindingViewHeightMargin
) {
if (e.nativeEvent.x < rewindingViewWidth) rewindLeft()

Choose a reason for hiding this comment

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

please, use next styling

if () {}

onHandlerStateChange={rewindOnDoubleTap}
numberOfTaps={2}
>
<View>

Choose a reason for hiding this comment

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

View - is necessary?

},
]

export const HomeScreen = ({ navigation }: HomeScreenProps) => {
return (
<SafeAreaView style={styles.container}>
<SafeAreaView style={{ flex: 1 }}>

Choose a reason for hiding this comment

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

Please, not use inline styles

<FlatList
contentContainerStyle={styles.container}
data={VIDEOS}
keyExtractor={(video) => video.id}
renderItem={({ item }) => {

Choose a reason for hiding this comment

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

please, use useCallback

<FlatList
contentContainerStyle={styles.container}
data={VIDEOS}
keyExtractor={(video) => video.id}

Choose a reason for hiding this comment

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

useCallback

data={VIDEOS}
keyExtractor={(video) => video.id}
renderItem={({ item }) => {
return (
<TouchableOpacity
style={styles.listItem}
onPress={() => {
navigation.navigate(SCREEN_NAMES.Video, { uri: item.uri })
navigation.navigate(SCREEN_NAMES.Video, { uri: item.videoUri })

Choose a reason for hiding this comment

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

useCallback

}}
>
<Text style={{ fontSize: 30 }}>{item.title}</Text>
<Image
source={{

Choose a reason for hiding this comment

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

useMemo

source={{
uri: item.imageUrl,
}}
style={{ width: '100%', height: '100%' }}

Choose a reason for hiding this comment

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

please, don't use inline styles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants