Skip to content

Commit 05359d7

Browse files
committed
chore: Updated deps
1 parent c83664a commit 05359d7

File tree

14 files changed

+121
-100
lines changed

14 files changed

+121
-100
lines changed

app/mobile/components/ItemOptions/ItemOptions.js

+41-43
Original file line numberDiff line numberDiff line change
@@ -102,49 +102,47 @@ export const ItemOptions = ({
102102
onTorrentPress(torrent, download)
103103
}, [])
104104

105-
const renderBottomSheetContent = React.useCallback(() => {
106-
return (
107-
<View>
108-
<OptionsHeader
109-
label={
110-
item.type === constants.TYPE_EPISODE
111-
? `${item.number}. ${item.title}`
112-
: item.title
113-
} />
114-
115-
<ItemTorrents
116-
item={item}
117-
variant={variant}
118-
torrents={allTorrents}
119-
onPress={handleTorrentPress} />
120-
121-
{variant === constants.TYPE_DOWNLOAD && (
122-
<>
123-
<OptionsGroup
124-
withDivider={variant === constants.TYPE_DOWNLOAD}
125-
style={styles.marginBottomOnly}>
126-
<OptionsItem
127-
disabled
128-
icon={'eye-outline'}
129-
label={
130-
item.watched.complete
131-
? i18n.t('Mark Unwatched')
132-
: i18n.t('Mark Watched')
133-
} />
134-
</OptionsGroup>
135-
136-
<OptionsGroup>
137-
<OptionsItem
138-
disabled
139-
icon={'content-copy'}
140-
label={i18n.t('Copy to phone')}
141-
labelLine2={'Item needs to be downloaded for this to become available'} />
142-
</OptionsGroup>
143-
</>
144-
)}
145-
</View>
146-
)
147-
}, [item, variant])
105+
const renderBottomSheetContent = React.useCallback(() => (
106+
<View>
107+
<OptionsHeader
108+
label={
109+
item.type === constants.TYPE_EPISODE
110+
? `${item.number}. ${item.title}`
111+
: item.title
112+
} />
113+
114+
<ItemTorrents
115+
item={item}
116+
variant={variant}
117+
torrents={allTorrents}
118+
onPress={handleTorrentPress} />
119+
120+
{variant === constants.TYPE_DOWNLOAD && (
121+
<>
122+
<OptionsGroup
123+
withDivider={variant === constants.TYPE_DOWNLOAD}
124+
style={styles.marginBottomOnly}>
125+
<OptionsItem
126+
disabled
127+
icon={'eye-outline'}
128+
label={
129+
item.watched.complete
130+
? i18n.t('Mark Unwatched')
131+
: i18n.t('Mark Watched')
132+
} />
133+
</OptionsGroup>
134+
135+
<OptionsGroup>
136+
<OptionsItem
137+
disabled
138+
icon={'content-copy'}
139+
label={i18n.t('Copy to phone')}
140+
labelLine2={'Item needs to be downloaded for this to become available'} />
141+
</OptionsGroup>
142+
</>
143+
)}
144+
</View>
145+
), [item, variant])
148146

149147
if (variant === constants.TYPE_STREAM) {
150148
return (

app/mobile/components/ItemOptions/ItemTorrents/ItemTorrents.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SearchForBetterEpisode, SearchForBetterMovie } from 'modules/GraphQL/Se
66
import dimensions from 'modules/dimensions'
77
import constants from 'modules/constants'
88
import i18n from 'modules/i18n'
9-
import useDownload from 'modules/hooks/useDownload'
9+
import usePollingForDownload from 'modules/hooks/usePollingForDownload'
1010

1111
import Divider from 'components/Divider'
1212

@@ -28,7 +28,7 @@ export const styles = StyleSheet.create({
2828
})
2929

3030
export const ItemTorrents = ({ item, torrents, variant, onPress }) => {
31-
const [download, downloadManager] = useDownload(item)
31+
const [download, downloadManager] = usePollingForDownload(item)
3232
const [searchForBetter, { loading }] = useMutation(
3333
item.type === constants.TYPE_EPISODE
3434
? SearchForBetterEpisode

app/mobile/components/OptionsItem/OptionsItemInner.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const SettingsItem = ({ label, labelLine2, subLabel, subLabelLine2, icon,
3636
duration={constants.ANIMATION_DURATIONS.enteringScreen}
3737
useNativeDriver>
3838
<ActivityIndicator
39-
size={18}
39+
size={dimensions.ICON_SIZE_SMALL}
4040
color={colors.PRIMARY_COLOR_200} />
4141
</Animatable.View>
4242
)}
@@ -49,8 +49,8 @@ export const SettingsItem = ({ label, labelLine2, subLabel, subLabelLine2, icon,
4949
useNativeDriver>
5050
<LottieView
5151
style={{
52-
width: 18,
53-
height: 18,
52+
width: dimensions.ICON_SIZE_SMALL,
53+
height: dimensions.ICON_SIZE_SMALL
5454
}}
5555
source={require('assets/lottie/cloud-download.json')}
5656
autoPlay
@@ -62,7 +62,7 @@ export const SettingsItem = ({ label, labelLine2, subLabel, subLabelLine2, icon,
6262
<Icon
6363
color={'primary'}
6464
style={styles.icon}
65-
size={18}
65+
size={dimensions.ICON_SIZE_SMALL}
6666
name={icon}
6767
emphasis={
6868
disabled

app/mobile/screens/Item/ItemGraphQL.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import torrentFragment from 'modules/GraphQL/fragments/torrentFragment'
44

55
export const MovieQuery = gql`
66
query movie($_id: String!) {
7-
item: movie(_id: $_id) {
7+
movie(_id: $_id) {
88
_id
99
title
1010
genres
@@ -48,7 +48,7 @@ export const MovieQuery = gql`
4848

4949
export const ShowQuery = gql`
5050
query show($_id: String!) {
51-
item: show(_id: $_id) {
51+
show(_id: $_id) {
5252
_id
5353
title
5454
genres

app/mobile/screens/Item/ItemScreen.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ const styles = StyleSheet.create({
5555
})
5656

5757
export const Item = ({ route: { params } }) => {
58-
const Query = params.type === 'movie'
59-
? MovieQuery
60-
: ShowQuery
61-
6258
const [executeQuery, { loading: itemLoading, data }] = useLazyQuery(
63-
Query,
59+
params.type === 'movie'
60+
? MovieQuery
61+
: ShowQuery,
6462
{
6563
variables: {
6664
_id: params._id,
@@ -79,7 +77,7 @@ export const Item = ({ route: { params } }) => {
7977
}, [])
8078

8179
const loading = itemLoading || !data
82-
const item = loading ? null : data.item
80+
const item = loading ? null : data[params.type]
8381

8482
const handleTrailer = () => {
8583
if (item && item.trailer) {
@@ -100,7 +98,6 @@ export const Item = ({ route: { params } }) => {
10098
{!loading && (
10199
<Bookmarked
102100
style={styles.icon}
103-
Query={Query}
104101
{...item}
105102
/>
106103
)}

app/modules/DownloadManager/DownloadManager.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ export class DownloadManager extends React.Component {
105105
this.handleStopPollDownload(item)
106106

107107
this.setState({
108-
downloads: downloads.filter(down => down._id !== item._id),
108+
downloads: downloads.filter((down) => down._id !== item._id),
109109
})
110110
}
111111

112112
handleGetDownload = (_id) => {
113113
const { downloads } = this.state
114114

115-
return downloads.find(down => down._id === _id)
115+
return downloads.find((down) => down._id === _id)
116116
}
117117

118118
handleGetDownloads = () => {

app/modules/GraphQL/Apollo.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import AsyncStorage from '@react-native-community/async-storage'
22
import FSStorage from 'redux-persist-fs-storage'
3-
import { ApolloClient, split, HttpLink, InMemoryCache, defaultDataIdFromObject } from '@apollo/client'
3+
import { ApolloClient, split, HttpLink, InMemoryCache } from '@apollo/client'
44
import { CachePersistor } from 'apollo-cache-persist'
55
import { WebSocketLink } from '@apollo/client/link/ws'
66
import { getMainDefinition } from '@apollo/client/utilities'
77

8-
const SCHEMA_VERSION = '9' // Must be a string.
8+
const SCHEMA_VERSION = '10' // Must be a string.
99
const SCHEMA_VERSION_KEY = 'apollo-schema-version'
1010

1111
export default async(host) => {

app/modules/GraphQL/fragments/showFragment.js

+24
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,27 @@ export const showMinimalFragment = gql`
3030
}
3131
}
3232
`
33+
34+
export const showFragment = gql`
35+
fragment show on Show {
36+
_id
37+
title
38+
genres
39+
synopsis
40+
type
41+
bookmarked
42+
trailer
43+
rating {
44+
percentage
45+
}
46+
images {
47+
backdrop {
48+
high
49+
}
50+
poster {
51+
thumb
52+
high
53+
}
54+
}
55+
}
56+
`

app/modules/GraphQL/withApollo.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import React from 'react'
22
import hoistNonReactStatics from 'hoist-non-react-statics'
33
import { useApolloClient } from '@apollo/client'
44

5-
export const withApollo = Component => hoistNonReactStatics(
5+
export const withApollo = (Component) => hoistNonReactStatics(
66
React.forwardRef((props, ref) => {
77
const client = useApolloClient()
88

99
return (
10-
<Component {...props} apollo={client} ref={ref} />
10+
<Component
11+
{...props}
12+
apollo={client}
13+
ref={ref} />
1114
)
1215
}),
1316
Component,

app/modules/dimensions.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818

1919
UNIT: useCorrect(UNIT, null, UNIT * 2),
2020

21+
ICON_SIZE_SMALL: 18,
2122
ICON_SIZE_DEFAULT: 24,
2223
ICON_SIZE_MEDIUM: 32,
2324

app/modules/hooks/useBackButton.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { useEffect } from 'react'
1+
import React from 'react'
22
import { BackHandler } from 'react-native'
33

44
export const useBackButton = (handler) => {
5-
useEffect(() => {
5+
React.useEffect(() => {
66
BackHandler.addEventListener('hardwareBackPress', handler)
77

88
return () => {

app/modules/hooks/usePollingForDownload.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22

33
import constants from 'modules/constants'
4-
import { useDownloadManager } from 'modules/DownloadManager'
4+
import useDownload from './useDownload'
55

66
/**
77
* States that are valid to pull
@@ -17,9 +17,7 @@ export const validPollStates = [
1717
* Starts polling for a certain download
1818
*/
1919
export const usePollingForDownload = (downloadToPoll) => {
20-
const downloadManager = useDownloadManager()
21-
22-
const download = downloadManager.getDownload(downloadToPoll?._id)
20+
const [download, downloadManager] = useDownload(downloadToPoll)
2321

2422
React.useEffect(() => {
2523
if (download && validPollStates.includes(download.status)) {

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test:watch": "yarn test --watch"
2727
},
2828
"dependencies": {
29-
"@apollo/client": "^3.2.5",
29+
"@apollo/client": "^3.2.7",
3030
"@react-native-community/async-storage": "1.12.1",
3131
"@react-native-community/masked-view": "^0.1.10",
3232
"@react-native-community/netinfo": "5.9.7",
@@ -44,17 +44,17 @@
4444
"react": "17.0.1",
4545
"react-native": "0.63.3",
4646
"react-native-animatable": "1.3.3",
47-
"react-native-device-info": "7.0.2",
47+
"react-native-device-info": "7.1.0",
4848
"react-native-fs": "2.16.6",
4949
"react-native-gesture-handler": "1.8.0",
5050
"react-native-google-cast": "github:pct-org/react-native-google-cast#7e409ca7c129d628d5c2902944790bc611b64aaa",
5151
"react-native-languages": "3.0.2",
5252
"react-native-linear-gradient": "2.5.6",
5353
"react-native-markdown-renderer": "^3.2.8",
5454
"react-native-orientation": "^3.1.3",
55-
"react-native-reanimated": "1.13.0",
55+
"react-native-reanimated": "1.13.2",
5656
"react-native-safe-area-context": "3.1.9",
57-
"react-native-screens": "2.14.0",
57+
"react-native-screens": "2.15.0",
5858
"react-native-splash-screen": "3.2.0",
5959
"react-native-static-server": "0.5.0",
6060
"react-native-vector-icons": "7.1.0",
@@ -83,7 +83,7 @@
8383
"enzyme-adapter-react-16": "1.15.5",
8484
"eslint": "7.13.0",
8585
"eslint-config-airbnb": "18.2.1",
86-
"eslint-config-standard": "16.0.1",
86+
"eslint-config-standard": "16.0.2",
8787
"eslint-config-standard-react": "11.0.1",
8888
"eslint-plugin-babel": "5.3.1",
8989
"eslint-plugin-import": "2.22.1",

0 commit comments

Comments
 (0)