Skip to content

Commit

Permalink
fix: Small fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Oct 23, 2020
1 parent d4b9298 commit d2a3c81
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const OptionsItemTorrent = ({
}

return `${torrent.provider} - ${torrent.sizeString}`
}, [download, isItemDisabled])
}, [download, isItemDisabled, torrent])

const subLabel = React.useMemo(() => {
if (!isItemDisabled && download?.status === constants.STATUS_DOWNLOADING) {
Expand Down
3 changes: 2 additions & 1 deletion app/mobile/screens/Mode/ModeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export const Mode = ({ mode, navigation }) => {
)

useBackButton(() => {
if ((query?.trim()?.length > 0 || filter) && navigation.isFocused()) {
if ((query?.trim()?.length > 0 || filter || sort) && navigation.isFocused()) {
setQuery(null)
setFilter(undefined)
setSorting(undefined)

return true
}
Expand Down
22 changes: 11 additions & 11 deletions app/mobile/screens/Mode/SearchBar/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ export const SearchBar = ({ searchedQuery, search, flatListRef, mode, setSorting
const bottomSheetOptions = React.useMemo(() => {
if (mode === constants.MODE_BOOKMARKS) {
return [
{ label: i18n.t('None'), value: undefined },
{ label: i18n.t('Movies'), value: 'movies' },
{ label: i18n.t('Shows'), value: 'shows' },
{ icon: 'all-inclusive', label: i18n.t('All'), value: undefined },
{ icon: 'movie', label: i18n.t('Movies'), value: 'movies' },
{ icon: 'filmstrip-box-multiple', label: i18n.t('Shows'), value: 'shows' },
]
}

return [
{ label: i18n.t('Default'), value: 'trending' },
{ label: i18n.t('Popularity'), value: 'popularity' },
{ label: i18n.t('Name'), value: 'name' },
{ label: i18n.t('Rating'), value: 'rating' },
{ label: i18n.t('Released'), value: 'released' },
{ label: i18n.t('Year'), value: 'year' },
{ label: i18n.t('Added'), value: 'added' },
{ icon: 'trending-up', label: i18n.t('Trending'), value: 'trending' },
{ icon: 'cards-heart', label: i18n.t('Popularity'), value: 'popularity' },
{ icon: 'alphabetical', label: i18n.t('Name'), value: 'name' },
{ icon: 'star', label: i18n.t('Rating'), value: 'rating' },
{ icon: 'calendar', label: i18n.t('Released'), value: 'released' },
{ icon: 'calendar-range', label: i18n.t('Year'), value: 'year' },
{ icon: 'calendar-plus', label: i18n.t('Added'), value: 'added' },
]
}, [mode])

Expand Down Expand Up @@ -147,7 +147,7 @@ export const SearchBar = ({ searchedQuery, search, flatListRef, mode, setSorting
{bottomSheetOptions.map((option) => (
<OptionsItem
key={option.label}
icon={'eye-outline'}
icon={option.icon}
label={option.label}
onPress={handleFilterOrSortPress(option)} />
))}
Expand Down
4 changes: 3 additions & 1 deletion app/modules/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@
"Rating": "Rating",
"Released": "Released",
"Year": "Year",
"Added": "Added"
"Added": "Added",
"All": "All",
"Trending": "Trending"
}
4 changes: 3 additions & 1 deletion app/modules/i18n/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,7 @@
"Rating": "Beoordeling",
"Released": "Uitgebracht",
"Year": "Jaar",
"Added": "Toegevoegd"
"Added": "Toegevoegd",
"All": "Alles",
"Trending": "Trending"
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:watch": "yarn test --watch"
},
"dependencies": {
"@apollo/client": "^3.2.3",
"@apollo/client": "^3.2.4",
"@react-native-community/async-storage": "1.12.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "5.9.7",
Expand All @@ -37,14 +37,14 @@
"graphql": "15.3.0",
"graphql-tag": "2.11.0",
"hoist-non-react-statics": "3.3.2",
"i18n-js": "3.7.1",
"i18n-js": "3.8.0",
"jsc-android": "241213.1.0",
"lottie-react-native": "3.5.0",
"prop-types": "^15.7.2",
"react": "16.13.1",
"react": "16.14.0",
"react-native": "0.63.3",
"react-native-animatable": "1.3.3",
"react-native-device-info": "6.2.0",
"react-native-device-info": "6.2.1",
"react-native-fs": "2.16.6",
"react-native-gesture-handler": "1.8.0",
"react-native-google-cast": "github:pct-org/react-native-google-cast#7e409ca7c129d628d5c2902944790bc611b64aaa",
Expand Down
42 changes: 21 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@apollo/client@^3.2.3":
version "3.2.3"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.2.3.tgz#d13e4efa501a1fadefa3cd93e2de99cba2b53999"
integrity sha512-AraRQRG4HinqcsuDtRzuavMuSxkK46TO4zh4zfLLCazMYSYP1xY9E5cQEeUHZ993HQMs4A7tyATPaEMfn8UZfA==
"@apollo/client@^3.2.4":
version "3.2.4"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.2.4.tgz#d9a308a900bd9e7053348367f66f3962804ed385"
integrity sha512-lfsxKINoc11+g4NQFyKFuxszc/GlecHrxkJYvx/oWkdpscSU5bm/c+BwI/yvk1/E3yfbR7Afi9XIYrt212xrtA==
dependencies:
"@graphql-typed-document-node/core" "^3.0.0"
"@types/zen-observable" "^0.8.0"
Expand All @@ -14,7 +14,7 @@
fast-json-stable-stringify "^2.0.0"
graphql-tag "^2.11.0"
hoist-non-react-statics "^3.3.2"
optimism "^0.12.1"
optimism "^0.13.0"
prop-types "^15.7.2"
symbol-observable "^2.0.0"
terser "^5.2.0"
Expand Down Expand Up @@ -4626,10 +4626,10 @@ husky@4.3.0:
slash "^3.0.0"
which-pm-runs "^1.0.0"

i18n-js@3.7.1:
version "3.7.1"
resolved "https://registry.yarnpkg.com/i18n-js/-/i18n-js-3.7.1.tgz#c70de6a64dc0ad5d2b6273eecfac636e5ed0421a"
integrity sha512-xrRzCeda5ZC0u0yRN+dMdidtda0N+f7t7Pek0ajWb+iyKqSGdrMmuBtbNpWJWY5N4Th0cxbp/BR57zSPdrM3Rw==
i18n-js@3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/i18n-js/-/i18n-js-3.8.0.tgz#b8fd6b12e1d88cb71f9806c29bca7c31c012e504"
integrity sha512-hDsGgPuvw/2P+lXSbOafAwspK8Ste8YrwuuUg17W3wEcO1JkQxBlPgsN1t2+852nTnz4YSYTjZc/1nAA2PC/nw==

iconv-lite@0.4.24, iconv-lite@^0.4.17:
version "0.4.24"
Expand Down Expand Up @@ -7016,10 +7016,10 @@ opencollective-postinstall@^2.0.2:
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==

optimism@^0.12.1:
version "0.12.1"
resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.12.1.tgz#933f9467b9aef0e601655adb9638f893e486ad02"
integrity sha512-t8I7HM1dw0SECitBYAqFOVHoBAHEQBTeKjIL9y9ImHzAVkdyPK4ifTgM4VJRDtTUY4r/u5Eqxs4XcGPHaoPkeQ==
optimism@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.13.0.tgz#c08904e1439a0eb9e7f86183dafa06cc715ff351"
integrity sha512-6JAh3dH+YUE4QUdsgUw8nUQyrNeBKfAEKOHMlLkQ168KhIYFIxzPsHakWrRXDnTO+x61RJrS3/2uEt6W0xlocA==
dependencies:
"@wry/context" "^0.5.2"

Expand Down Expand Up @@ -7545,10 +7545,10 @@ react-native-animatable@1.3.3:
dependencies:
prop-types "^15.7.2"

react-native-device-info@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-6.2.0.tgz#6eda29dee048b73b29b57b7ec0c21545bd89dada"
integrity sha512-UtAk/ZAdCVCepEmRNM/3Kx7dWbLwmEPh527HTjoQUQy1utpoXm3y4sYtCrP2tjczSIyeMs5nLP4Wf3c8bc0fwQ==
react-native-device-info@6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-6.2.1.tgz#6b63faeef833d8959d636c0413ccd5066eada2bf"
integrity sha512-+9Li07jD+7IiSIn9VVmb1YWYfJtgERVMsgO/hG+aUzsFD6uFklpM2TOEBlfKPWP/8J6s8MZgpGfA/Dl1WZrn2g==

react-native-fit-image@^1.5.2:
version "1.5.5"
Expand Down Expand Up @@ -7715,10 +7715,10 @@ react-test-renderer@16.13.1, react-test-renderer@^16.0.0-0:
react-is "^16.8.6"
scheduler "^0.19.1"

react@16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
react@16.14.0:
version "16.14.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d"
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
Expand Down

0 comments on commit d2a3c81

Please sign in to comment.