From 0c02467e26148e3095606a6e973eadf5ef9d294a Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Mon, 19 Jun 2023 22:26:41 +0200 Subject: [PATCH] chore: fix linter --- index.js | 4 +-- package-lock.json | 32 ++++++++--------- package.json | 4 +-- src/components/AlphabetScroller.tsx | 2 +- src/components/App.tsx | 4 +-- src/components/Button.tsx | 2 +- src/components/Colors.tsx | 6 ++-- src/components/DownloadIcon.tsx | 2 +- src/components/DownloadManager.ts | 4 +-- src/components/ListButton.tsx | 2 +- src/components/Progresstrack.tsx | 2 +- src/screens/Downloads/index.tsx | 20 +++++------ src/screens/Music/index.tsx | 6 ++-- .../Music/overlays/NowPlaying/index.tsx | 14 ++++---- src/screens/Music/stacks/Album.tsx | 12 +++---- src/screens/Music/stacks/Albums.tsx | 24 ++++++------- src/screens/Music/stacks/Artist.tsx | 20 +++++------ src/screens/Music/stacks/Artists.tsx | 20 +++++------ src/screens/Music/stacks/Playlist.tsx | 8 ++--- src/screens/Music/stacks/Playlists.tsx | 14 ++++---- src/screens/Music/stacks/RecentAlbums.tsx | 26 +++++++------- .../Music/stacks/components/TrackListView.tsx | 34 +++++++++---------- src/screens/Onboarding/index.tsx | 12 +++---- src/screens/Search/index.tsx | 6 ++-- .../Search/components/SelectableFilter.tsx | 6 ++-- src/screens/Search/stacks/Search/index.tsx | 26 +++++++------- src/screens/Search/types.ts | 2 +- src/screens/Settings/components/Container.tsx | 2 +- .../Settings/components/PrivacyPolicy.tsx | 4 +-- src/screens/Settings/components/Radio.tsx | 8 ++--- src/screens/Settings/components/Switch.tsx | 2 +- src/screens/Settings/index.tsx | 10 +++--- src/screens/Settings/stacks/Cache.tsx | 10 +++--- src/screens/Settings/stacks/ColorScheme.tsx | 10 +++--- src/screens/Settings/stacks/Library.tsx | 10 +++--- .../Settings/stacks/PlaybackReporting.tsx | 10 +++--- src/screens/Settings/stacks/Sentry.tsx | 12 +++---- src/screens/index.tsx | 10 +++--- src/screens/modals/ErrorReportingPopup.tsx | 2 +- .../Player/components/Casting.android.tsx | 2 +- .../modals/Player/components/Casting.ios.tsx | 8 ++--- .../Player/components/ConnectionNotice.tsx | 6 ++-- .../Player/components/MediaControls.tsx | 2 +- .../modals/Player/components/NowPlaying.tsx | 6 ++-- .../modals/Player/components/ProgressBar.tsx | 8 ++--- .../modals/Player/components/Queue.tsx | 22 ++++++------ .../modals/Player/components/StreamStatus.tsx | 8 ++--- .../components/CredentialGenerator.tsx | 2 +- .../modals/SetJellyfinServer/index.tsx | 16 ++++----- src/screens/modals/TrackPopupMenu.tsx | 18 +++++----- src/screens/types.ts | 4 +-- src/store/downloads/actions.ts | 6 ++-- src/store/downloads/selectors.ts | 2 +- src/store/music/actions.ts | 2 +- src/store/music/index.ts | 2 +- src/store/music/selectors.ts | 4 +-- src/utility/ErrorReportingAlert.ts | 6 ++-- src/utility/JellyfinApi.ts | 4 +-- src/utility/PlaybackService.ts | 2 +- src/utility/usePlayTracks.ts | 2 +- tsconfig.json | 14 +++++++- 61 files changed, 281 insertions(+), 269 deletions(-) diff --git a/index.js b/index.js index 98c5141..7325fbc 100644 --- a/index.js +++ b/index.js @@ -4,9 +4,9 @@ import TrackPlayer from 'react-native-track-player'; import App from './src/components/App'; import { name as appName } from './app.json'; import PlaybackService from './src/utility/PlaybackService'; -import { setupSentry } from 'utility/Sentry'; +import { setupSentry } from '@/utility/Sentry'; import { enableScreens } from 'react-native-screens'; -import { patchTrackPlayer } from 'utility/AddedTrackEvents'; +import { patchTrackPlayer } from '@/utility/AddedTrackEvents'; setupSentry(); enableScreens(); diff --git a/package-lock.json b/package-lock.json index 0cf4379..539f379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,10 +63,10 @@ "@sentry/cli": "^2.8.1", "@types/i18n-js": "^3.8.3", "@types/jest": "^29.2.2", + "@types/node": "^20.3.1", "@types/react-test-renderer": "^18.0.0", "@types/redux-logger": "^3.0.9", - "@types/styled-components": "^5.1.26", - "@types/styled-components-react-native": "^5.2.0", + "@types/styled-components-react-native": "^5.2.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "babel-jest": "^29.3.1", @@ -4314,9 +4314,9 @@ "integrity": "sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w==" }, "node_modules/@types/node": { - "version": "14.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz", - "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==" + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==" }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -4409,13 +4409,13 @@ } }, "node_modules/@types/styled-components-react-native": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@types/styled-components-react-native/-/styled-components-react-native-5.2.0.tgz", - "integrity": "sha512-J5w74FBkXjHO9+9gYX2CgwEWFDE1LxrBUhmkoc0y1tLZ8RoQ0AZEgljXvqY2dl5rRkTgh941VpmPKnntIyVNtg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@types/styled-components-react-native/-/styled-components-react-native-5.2.1.tgz", + "integrity": "sha512-XI/SWDSLSe7IjZXA9jS0vv4WPpV2B+nQhefUqk00usNHxhErlzPtTGdhjMZgrH0uYz5R0hLLIandhmhDTLkKBg==", "dev": true, "dependencies": { "@types/react": "*", - "@types/react-native": "*", + "@types/react-native": "^0.70", "@types/styled-components": "*" } }, @@ -19074,9 +19074,9 @@ "integrity": "sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w==" }, "@types/node": { - "version": "14.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz", - "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==" + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==" }, "@types/parse-json": { "version": "4.0.0", @@ -19169,13 +19169,13 @@ } }, "@types/styled-components-react-native": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@types/styled-components-react-native/-/styled-components-react-native-5.2.0.tgz", - "integrity": "sha512-J5w74FBkXjHO9+9gYX2CgwEWFDE1LxrBUhmkoc0y1tLZ8RoQ0AZEgljXvqY2dl5rRkTgh941VpmPKnntIyVNtg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@types/styled-components-react-native/-/styled-components-react-native-5.2.1.tgz", + "integrity": "sha512-XI/SWDSLSe7IjZXA9jS0vv4WPpV2B+nQhefUqk00usNHxhErlzPtTGdhjMZgrH0uYz5R0hLLIandhmhDTLkKBg==", "dev": true, "requires": { "@types/react": "*", - "@types/react-native": "*", + "@types/react-native": "^0.70", "@types/styled-components": "*" } }, diff --git a/package.json b/package.json index f3b35ec..9ce9b65 100644 --- a/package.json +++ b/package.json @@ -67,10 +67,10 @@ "@sentry/cli": "^2.8.1", "@types/i18n-js": "^3.8.3", "@types/jest": "^29.2.2", + "@types/node": "^20.3.1", "@types/react-test-renderer": "^18.0.0", "@types/redux-logger": "^3.0.9", - "@types/styled-components": "^5.1.26", - "@types/styled-components-react-native": "^5.2.0", + "@types/styled-components-react-native": "^5.2.1", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "babel-jest": "^29.3.1", diff --git a/src/components/AlphabetScroller.tsx b/src/components/AlphabetScroller.tsx index 7fb84ad..9ae1077 100644 --- a/src/components/AlphabetScroller.tsx +++ b/src/components/AlphabetScroller.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components/native'; -import { ALPHABET_LETTERS, THEME_COLOR } from 'CONSTANTS'; +import { ALPHABET_LETTERS, THEME_COLOR } from '@/CONSTANTS'; import { View, LayoutChangeEvent } from 'react-native'; import { PanGestureHandler, diff --git a/src/components/App.tsx b/src/components/App.tsx index 2742b01..3a1a31a 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3,7 +3,7 @@ import { Provider } from 'react-redux'; import TrackPlayer, { Capability } from 'react-native-track-player'; import { PersistGate } from 'redux-persist/integration/react'; import Routes from '../screens'; -import store, { persistedStore, useTypedSelector } from 'store'; +import store, { persistedStore, useTypedSelector } from '@/store'; import { NavigationContainer, DefaultTheme, @@ -12,7 +12,7 @@ import { import { ColorSchemeProvider, themes } from './Colors'; import DownloadManager from './DownloadManager'; import { useColorScheme } from 'react-native'; -import { ColorScheme } from 'store/settings/types'; +import { ColorScheme } from '@/store/settings/types'; const LightTheme = { ...DefaultTheme, diff --git a/src/components/Button.tsx b/src/components/Button.tsx index cebcb2d..bd7d606 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -3,7 +3,7 @@ import { SvgProps } from 'react-native-svg'; import { PressableProps, ViewProps, View, } from 'react-native'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import styled, { css } from 'styled-components/native'; import useDefaultStyles from './Colors'; diff --git a/src/components/Colors.tsx b/src/components/Colors.tsx index 837469f..16ac102 100644 --- a/src/components/Colors.tsx +++ b/src/components/Colors.tsx @@ -1,10 +1,10 @@ import { BlurView, BlurViewProps } from '@react-native-community/blur'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import React, { PropsWithChildren } from 'react'; import { useContext } from 'react'; import { ColorSchemeName, Platform, StyleSheet, View, useColorScheme } from 'react-native'; -import { useTypedSelector } from 'store'; -import { ColorScheme } from 'store/settings/types'; +import { useTypedSelector } from '@/store'; +import { ColorScheme } from '@/store/settings/types'; const majorPlatformVersion = typeof Platform.Version === 'string' ? parseInt(Platform.Version, 10) : Platform.Version; diff --git a/src/components/DownloadIcon.tsx b/src/components/DownloadIcon.tsx index 4e8722a..732e39a 100644 --- a/src/components/DownloadIcon.tsx +++ b/src/components/DownloadIcon.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useMemo, useRef } from 'react'; -import { useTypedSelector } from 'store'; +import { useTypedSelector } from '@/store'; import CloudIcon from 'assets/icons/cloud.svg'; import CloudDownArrow from 'assets/icons/cloud-down-arrow.svg'; import CloudExclamationMarkIcon from 'assets/icons/cloud-exclamation-mark.svg'; diff --git a/src/components/DownloadManager.ts b/src/components/DownloadManager.ts index ed0b09a..491938f 100644 --- a/src/components/DownloadManager.ts +++ b/src/components/DownloadManager.ts @@ -2,8 +2,8 @@ import { EntityId } from '@reduxjs/toolkit'; import { xor } from 'lodash'; import { useEffect, useRef, useState } from 'react'; import { DocumentDirectoryPath, readDir } from 'react-native-fs'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { completeDownload, downloadTrack } from 'store/downloads/actions'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { completeDownload, downloadTrack } from '@/store/downloads/actions'; /** * The maximum number of concurrent downloads we allow to take place at once. diff --git a/src/components/ListButton.tsx b/src/components/ListButton.tsx index c8c32c9..3b48685 100644 --- a/src/components/ListButton.tsx +++ b/src/components/ListButton.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useState } from 'react'; import { TouchableOpacityProps } from 'react-native'; import ChevronRight from 'assets/icons/chevron-right.svg'; import styled from 'styled-components/native'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import useDefaultStyles from './Colors'; const BUTTON_SIZE = 14; diff --git a/src/components/Progresstrack.tsx b/src/components/Progresstrack.tsx index 7ad953e..8b343e4 100644 --- a/src/components/Progresstrack.tsx +++ b/src/components/Progresstrack.tsx @@ -1,4 +1,4 @@ -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import styled from 'styled-components/native'; import Animated from 'react-native-reanimated'; diff --git a/src/screens/Downloads/index.tsx b/src/screens/Downloads/index.tsx index eb39df8..c8f42fe 100644 --- a/src/screens/Downloads/index.tsx +++ b/src/screens/Downloads/index.tsx @@ -1,22 +1,22 @@ -import useDefaultStyles from 'components/Colors'; +import useDefaultStyles from '@/components/Colors'; import React, { useCallback, useMemo } from 'react'; import { FlatListProps, View } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; -import { useAppDispatch, useTypedSelector } from 'store'; -import formatBytes from 'utility/formatBytes'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import formatBytes from '@/utility/formatBytes'; import TrashIcon from 'assets/icons/trash.svg'; import ArrowClockwise from 'assets/icons/arrow-clockwise.svg'; import { EntityId } from '@reduxjs/toolkit'; -import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions'; -import Button from 'components/Button'; +import { queueTrackForDownload, removeDownloadedTrack } from '@/store/downloads/actions'; +import Button from '@/components/Button'; import { t } from 'i18n-js'; -import DownloadIcon from 'components/DownloadIcon'; +import DownloadIcon from '@/components/DownloadIcon'; import styled from 'styled-components/native'; -import { Text } from 'components/Typography'; +import { Text } from '@/components/Typography'; import FastImage from 'react-native-fast-image'; -import { useGetImage } from 'utility/JellyfinApi'; -import { ShadowWrapper } from 'components/Shadow'; -import { SafeFlatList } from 'components/SafeNavigatorView'; +import { useGetImage } from '@/utility/JellyfinApi'; +import { ShadowWrapper } from '@/components/Shadow'; +import { SafeFlatList } from '@/components/SafeNavigatorView'; const DownloadedTrack = styled.View` flex: 1 0 auto; diff --git a/src/screens/Music/index.tsx b/src/screens/Music/index.tsx index a77acd3..8b2ed80 100644 --- a/src/screens/Music/index.tsx +++ b/src/screens/Music/index.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { StyleSheet } from 'react-native'; import { createStackNavigator } from '@react-navigation/stack'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; -import { THEME_COLOR } from 'CONSTANTS'; -import { t } from '@localisation'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; +import { THEME_COLOR } from '@/CONSTANTS'; +import { t } from '@/localisation'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; import { StackParams } from 'screens/types'; import NowPlaying from './overlays/NowPlaying'; diff --git a/src/screens/Music/overlays/NowPlaying/index.tsx b/src/screens/Music/overlays/NowPlaying/index.tsx index aba67f3..6514ca9 100644 --- a/src/screens/Music/overlays/NowPlaying/index.tsx +++ b/src/screens/Music/overlays/NowPlaying/index.tsx @@ -5,18 +5,18 @@ import styled, { css } from 'styled-components/native'; import PlayIcon from 'assets/icons/play.svg'; import PauseIcon from 'assets/icons/pause.svg'; -import useCurrentTrack from 'utility/useCurrentTrack'; +import useCurrentTrack from '@/utility/useCurrentTrack'; import TrackPlayer, { State, usePlaybackState, useProgress } from 'react-native-track-player'; import { Shadow } from 'react-native-shadow-2'; -import usePrevious from 'utility/usePrevious'; -import { Text } from 'components/Typography'; +import usePrevious from '@/utility/usePrevious'; +import { Text } from '@/components/Typography'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; import { useNavigation } from '@react-navigation/native'; -import { calculateProgressTranslation } from 'components/Progresstrack'; -import { THEME_COLOR } from 'CONSTANTS'; +import { calculateProgressTranslation } from '@/components/Progresstrack'; +import { THEME_COLOR } from '@/CONSTANTS'; import { NavigationProp } from 'screens/types'; -import { ShadowWrapper } from 'components/Shadow'; +import { ShadowWrapper } from '@/components/Shadow'; import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; const NOW_PLAYING_POPOVER_MARGIN = 6; diff --git a/src/screens/Music/stacks/Album.tsx b/src/screens/Music/stacks/Album.tsx index 3f1752c..c122b02 100644 --- a/src/screens/Music/stacks/Album.tsx +++ b/src/screens/Music/stacks/Album.tsx @@ -1,15 +1,15 @@ import React, { useCallback, useEffect } from 'react'; import { useRoute, RouteProp, useNavigation } from '@react-navigation/native'; -import { useAppDispatch, useTypedSelector } from 'store'; +import { useAppDispatch, useTypedSelector } from '@/store'; import TrackListView from './components/TrackListView'; -import { fetchAlbum, fetchTracksByAlbum } from 'store/music/actions'; +import { fetchAlbum, fetchTracksByAlbum } from '@/store/music/actions'; import { differenceInDays } from 'date-fns'; -import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS'; -import { t } from '@localisation'; +import { ALBUM_CACHE_AMOUNT_OF_DAYS } from '@/CONSTANTS'; +import { t } from '@/localisation'; import { NavigationProp, StackParams } from 'screens/types'; -import { SubHeader, Text } from 'components/Typography'; +import { SubHeader, Text } from '@/components/Typography'; import { ScrollView } from 'react-native-gesture-handler'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import styled from 'styled-components'; import { Dimensions, Pressable } from 'react-native'; import AlbumImage from './components/AlbumImage'; diff --git a/src/screens/Music/stacks/Albums.tsx b/src/screens/Music/stacks/Albums.tsx index 3be8623..d59a13e 100644 --- a/src/screens/Music/stacks/Albums.tsx +++ b/src/screens/Music/stacks/Albums.tsx @@ -1,23 +1,23 @@ import React, { useCallback, useEffect, useRef, ReactText, useMemo } from 'react'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import { SectionList, View } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { differenceInDays } from 'date-fns'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { fetchAllAlbums } from 'store/music/actions'; -import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS'; -import TouchableHandler from 'components/TouchableHandler'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { fetchAllAlbums } from '@/store/music/actions'; +import { ALBUM_CACHE_AMOUNT_OF_DAYS } from '@/CONSTANTS'; +import TouchableHandler from '@/components/TouchableHandler'; import AlbumImage, { AlbumHeight, AlbumItem } from './components/AlbumImage'; -import { selectAlbumsByAlphabet, SectionedId } from 'store/music/selectors'; -import AlphabetScroller from 'components/AlphabetScroller'; +import { selectAlbumsByAlphabet, SectionedId } from '@/store/music/selectors'; +import AlphabetScroller from '@/components/AlphabetScroller'; import { EntityId } from '@reduxjs/toolkit'; import styled from 'styled-components/native'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; -import { Album } from 'store/music/types'; -import { Text } from 'components/Typography'; -import { ShadowWrapper } from 'components/Shadow'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; +import { Album } from '@/store/music/types'; +import { Text } from '@/components/Typography'; +import { ShadowWrapper } from '@/components/Shadow'; import { NavigationProp } from 'screens/types'; -import { SafeSectionList } from 'components/SafeNavigatorView'; +import { SafeSectionList } from '@/components/SafeNavigatorView'; const HeadingHeight = 50; diff --git a/src/screens/Music/stacks/Artist.tsx b/src/screens/Music/stacks/Artist.tsx index 707be37..b6da482 100644 --- a/src/screens/Music/stacks/Artist.tsx +++ b/src/screens/Music/stacks/Artist.tsx @@ -1,21 +1,21 @@ import React, { useCallback, useEffect, ReactText } from 'react'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import { View } from 'react-native'; import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'; import { differenceInDays } from 'date-fns'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { fetchAllAlbums } from 'store/music/actions'; -import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS'; -import TouchableHandler from 'components/TouchableHandler'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { fetchAllAlbums } from '@/store/music/actions'; +import { ALBUM_CACHE_AMOUNT_OF_DAYS } from '@/CONSTANTS'; +import TouchableHandler from '@/components/TouchableHandler'; import AlbumImage, { AlbumItem } from './components/AlbumImage'; import { EntityId } from '@reduxjs/toolkit'; import styled from 'styled-components/native'; -import useDefaultStyles from 'components/Colors'; -import { Album } from 'store/music/types'; -import { Text } from 'components/Typography'; -import { ShadowWrapper } from 'components/Shadow'; +import useDefaultStyles from '@/components/Colors'; +import { Album } from '@/store/music/types'; +import { Text } from '@/components/Typography'; +import { ShadowWrapper } from '@/components/Shadow'; import { NavigationProp, StackParams } from 'screens/types'; -import { SafeFlatList } from 'components/SafeNavigatorView'; +import { SafeFlatList } from '@/components/SafeNavigatorView'; import { chunk } from 'lodash'; interface GeneratedAlbumItemProps { diff --git a/src/screens/Music/stacks/Artists.tsx b/src/screens/Music/stacks/Artists.tsx index 2a7ae89..570095d 100644 --- a/src/screens/Music/stacks/Artists.tsx +++ b/src/screens/Music/stacks/Artists.tsx @@ -1,20 +1,20 @@ import React, { useCallback, useEffect, useRef, useMemo } from 'react'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import { SectionList, View } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { differenceInDays } from 'date-fns'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { fetchAllAlbums } from 'store/music/actions'; -import { ALBUM_CACHE_AMOUNT_OF_DAYS, THEME_COLOR } from 'CONSTANTS'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { fetchAllAlbums } from '@/store/music/actions'; +import { ALBUM_CACHE_AMOUNT_OF_DAYS, THEME_COLOR } from '@/CONSTANTS'; import AlbumImage from './components/AlbumImage'; -import { SectionArtistItem, SectionedArtist, selectArtists } from 'store/music/selectors'; -import AlphabetScroller from 'components/AlphabetScroller'; +import { SectionArtistItem, SectionedArtist, selectArtists } from '@/store/music/selectors'; +import AlphabetScroller from '@/components/AlphabetScroller'; import styled from 'styled-components/native'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; -import { Text } from 'components/Typography'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; +import { Text } from '@/components/Typography'; import { NavigationProp } from 'screens/types'; -import { SafeSectionList } from 'components/SafeNavigatorView'; -import { Gap } from 'components/Utility'; +import { SafeSectionList } from '@/components/SafeNavigatorView'; +import { Gap } from '@/components/Utility'; const HeadingHeight = 50; diff --git a/src/screens/Music/stacks/Playlist.tsx b/src/screens/Music/stacks/Playlist.tsx index 2e667e9..3d51c24 100644 --- a/src/screens/Music/stacks/Playlist.tsx +++ b/src/screens/Music/stacks/Playlist.tsx @@ -1,11 +1,11 @@ import React, { useCallback, useEffect } from 'react'; import { useRoute, RouteProp } from '@react-navigation/native'; -import { useAppDispatch, useTypedSelector } from 'store'; +import { useAppDispatch, useTypedSelector } from '@/store'; import TrackListView from './components/TrackListView'; -import { fetchTracksByPlaylist } from 'store/music/actions'; +import { fetchTracksByPlaylist } from '@/store/music/actions'; import { differenceInDays } from 'date-fns'; -import { ALBUM_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS'; -import { t } from '@localisation'; +import { ALBUM_CACHE_AMOUNT_OF_DAYS } from '@/CONSTANTS'; +import { t } from '@/localisation'; import { StackParams } from 'screens/types'; type Route = RouteProp; diff --git a/src/screens/Music/stacks/Playlists.tsx b/src/screens/Music/stacks/Playlists.tsx index 3a0606b..b715d0e 100644 --- a/src/screens/Music/stacks/Playlists.tsx +++ b/src/screens/Music/stacks/Playlists.tsx @@ -1,17 +1,17 @@ import React, { useCallback, useEffect, useRef, ReactText } from 'react'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import { Text, View, FlatList, ListRenderItem, RefreshControl } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { differenceInDays } from 'date-fns'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { fetchAllPlaylists } from 'store/music/actions'; -import { PLAYLIST_CACHE_AMOUNT_OF_DAYS } from 'CONSTANTS'; -import TouchableHandler from 'components/TouchableHandler'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { fetchAllPlaylists } from '@/store/music/actions'; +import { PLAYLIST_CACHE_AMOUNT_OF_DAYS } from '@/CONSTANTS'; +import TouchableHandler from '@/components/TouchableHandler'; import AlbumImage, { AlbumItem } from './components/AlbumImage'; import { EntityId } from '@reduxjs/toolkit'; -import useDefaultStyles from 'components/Colors'; +import useDefaultStyles from '@/components/Colors'; import { NavigationProp } from 'screens/types'; -import { SafeFlatList, useNavigationOffsets } from 'components/SafeNavigatorView'; +import { SafeFlatList, useNavigationOffsets } from '@/components/SafeNavigatorView'; interface GeneratedAlbumItemProps { id: ReactText; diff --git a/src/screens/Music/stacks/RecentAlbums.tsx b/src/screens/Music/stacks/RecentAlbums.tsx index 4dfb69b..2675f58 100644 --- a/src/screens/Music/stacks/RecentAlbums.tsx +++ b/src/screens/Music/stacks/RecentAlbums.tsx @@ -1,23 +1,23 @@ import React, { useCallback, useEffect } from 'react'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import { Text, SafeAreaView, StyleSheet } from 'react-native'; import { useNavigation } from '@react-navigation/native'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { fetchRecentAlbums } from 'store/music/actions'; -import TouchableHandler from 'components/TouchableHandler'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { fetchRecentAlbums } from '@/store/music/actions'; +import TouchableHandler from '@/components/TouchableHandler'; import ListContainer from './components/ListContainer'; import AlbumImage, { AlbumItem } from './components/AlbumImage'; -import { useRecentAlbums } from 'store/music/selectors'; -import { Header } from 'components/Typography'; -import ListButton from 'components/ListButton'; -import { t } from '@localisation'; -import useDefaultStyles from 'components/Colors'; -import { Album } from 'store/music/types'; -import Divider from 'components/Divider'; +import { useRecentAlbums } from '@/store/music/selectors'; +import { Header } from '@/components/Typography'; +import ListButton from '@/components/ListButton'; +import { t } from '@/localisation'; +import useDefaultStyles from '@/components/Colors'; +import { Album } from '@/store/music/types'; +import Divider from '@/components/Divider'; import styled from 'styled-components/native'; -import { ShadowWrapper } from 'components/Shadow'; +import { ShadowWrapper } from '@/components/Shadow'; import { NavigationProp } from 'screens/types'; -import { SafeFlatList } from 'components/SafeNavigatorView'; +import { SafeFlatList } from '@/components/SafeNavigatorView'; const styles = StyleSheet.create({ columnWrapper: { diff --git a/src/screens/Music/stacks/components/TrackListView.tsx b/src/screens/Music/stacks/components/TrackListView.tsx index a5fe03a..0be6cff 100644 --- a/src/screens/Music/stacks/components/TrackListView.tsx +++ b/src/screens/Music/stacks/components/TrackListView.tsx @@ -1,32 +1,32 @@ import React, { PropsWithChildren, useCallback, useMemo } from 'react'; import { Platform, RefreshControl, StyleSheet, View } from 'react-native'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import styled, { css } from 'styled-components/native'; import { useNavigation } from '@react-navigation/native'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { THEME_COLOR } from 'CONSTANTS'; -import TouchableHandler from 'components/TouchableHandler'; -import useCurrentTrack from 'utility/useCurrentTrack'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { THEME_COLOR } from '@/CONSTANTS'; +import TouchableHandler from '@/components/TouchableHandler'; +import useCurrentTrack from '@/utility/useCurrentTrack'; import TrackPlayer from 'react-native-track-player'; import Play from 'assets/icons/play.svg'; import Shuffle from 'assets/icons/shuffle.svg'; -import useDefaultStyles from 'components/Colors'; -import usePlayTracks from 'utility/usePlayTracks'; +import useDefaultStyles from '@/components/Colors'; +import usePlayTracks from '@/utility/usePlayTracks'; import { EntityId } from '@reduxjs/toolkit'; -import { WrappableButtonRow, WrappableButton } from 'components/WrappableButtonRow'; +import { WrappableButtonRow, WrappableButton } from '@/components/WrappableButtonRow'; import { NavigationProp } from 'screens/types'; -import DownloadIcon from 'components/DownloadIcon'; +import DownloadIcon from '@/components/DownloadIcon'; import CloudDownArrow from 'assets/icons/cloud-down-arrow.svg'; import Trash from 'assets/icons/trash.svg'; -import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions'; -import { selectDownloadedTracks } from 'store/downloads/selectors'; -import { Header, SubHeader } from 'components/Typography'; -import { Text } from 'components/Typography'; +import { queueTrackForDownload, removeDownloadedTrack } from '@/store/downloads/actions'; +import { selectDownloadedTracks } from '@/store/downloads/selectors'; +import { Header, SubHeader } from '@/components/Typography'; +import { Text } from '@/components/Typography'; -import CoverImage from 'components/CoverImage'; -import ticksToDuration from 'utility/ticksToDuration'; -import { t } from '@localisation'; -import { SafeScrollView, useNavigationOffsets } from 'components/SafeNavigatorView'; +import CoverImage from '@/components/CoverImage'; +import ticksToDuration from '@/utility/ticksToDuration'; +import { t } from '@/localisation'; +import { SafeScrollView, useNavigationOffsets } from '@/components/SafeNavigatorView'; const styles = StyleSheet.create({ index: { diff --git a/src/screens/Onboarding/index.tsx b/src/screens/Onboarding/index.tsx index 8403147..b4837db 100644 --- a/src/screens/Onboarding/index.tsx +++ b/src/screens/Onboarding/index.tsx @@ -2,12 +2,12 @@ import React, { useCallback, useEffect } from 'react'; import styled from 'styled-components/native'; import { useNavigation } from '@react-navigation/native'; import { NavigationProp } from 'screens'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { setOnboardingStatus } from 'store/settings/actions'; -import { t } from '@localisation'; -import Button from 'components/Button'; -import { Header, Text as BaseText } from 'components/Typography'; -import { ShadowWrapper } from 'components/Shadow'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { setOnboardingStatus } from '@/store/settings/actions'; +import { t } from '@/localisation'; +import Button from '@/components/Button'; +import { Header, Text as BaseText } from '@/components/Typography'; +import { ShadowWrapper } from '@/components/Shadow'; const Container = styled.SafeAreaView` flex: 1; diff --git a/src/screens/Search/index.tsx b/src/screens/Search/index.tsx index c4a468f..d233dea 100644 --- a/src/screens/Search/index.tsx +++ b/src/screens/Search/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { createStackNavigator } from '@react-navigation/stack'; -import { THEME_COLOR } from 'CONSTANTS'; -import { t } from '@localisation'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; +import { THEME_COLOR } from '@/CONSTANTS'; +import { t } from '@/localisation'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; import { StackParams } from 'screens/types'; import Search from './stacks/Search'; import Album from 'screens/Music/stacks/Album'; diff --git a/src/screens/Search/stacks/Search/components/SelectableFilter.tsx b/src/screens/Search/stacks/Search/components/SelectableFilter.tsx index 3a53315..f3fd976 100644 --- a/src/screens/Search/stacks/Search/components/SelectableFilter.tsx +++ b/src/screens/Search/stacks/Search/components/SelectableFilter.tsx @@ -1,6 +1,6 @@ -import useDefaultStyles from 'components/Colors'; -import { Text } from 'components/Typography'; -import { THEME_COLOR } from 'CONSTANTS'; +import useDefaultStyles from '@/components/Colors'; +import { Text } from '@/components/Typography'; +import { THEME_COLOR } from '@/CONSTANTS'; import React from 'react'; import { SvgProps } from 'react-native-svg'; import styled, { css } from 'styled-components/native'; diff --git a/src/screens/Search/stacks/Search/index.tsx b/src/screens/Search/stacks/Search/index.tsx index 9a83ca2..a37c01f 100644 --- a/src/screens/Search/stacks/Search/index.tsx +++ b/src/screens/Search/stacks/Search/index.tsx @@ -1,27 +1,27 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; -import Input from 'components/Input'; +import Input from '@/components/Input'; import { ActivityIndicator, Animated, SafeAreaView, View } from 'react-native'; import styled from 'styled-components/native'; -import { useAppDispatch, useTypedSelector } from 'store'; +import { useAppDispatch, useTypedSelector } from '@/store'; import Fuse from 'fuse.js'; -import { Album, AlbumTrack } from 'store/music/types'; +import { Album, AlbumTrack } from '@/store/music/types'; import { FlatList } from 'react-native-gesture-handler'; -import TouchableHandler from 'components/TouchableHandler'; +import TouchableHandler from '@/components/TouchableHandler'; import { useNavigation } from '@react-navigation/native'; -import { useGetImage } from 'utility/JellyfinApi'; +import { useGetImage } from '@/utility/JellyfinApi'; import FastImage from 'react-native-fast-image'; -import { t } from '@localisation'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; -import { searchAndFetchAlbums } from 'store/music/actions'; +import { t } from '@/localisation'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; +import { searchAndFetchAlbums } from '@/store/music/actions'; import { debounce } from 'lodash'; -import { Text } from 'components/Typography'; -import DownloadIcon from 'components/DownloadIcon'; +import { Text } from '@/components/Typography'; +import DownloadIcon from '@/components/DownloadIcon'; import ChevronRight from 'assets/icons/chevron-right.svg'; import SearchIcon from 'assets/icons/magnifying-glass.svg'; -import { ShadowWrapper } from 'components/Shadow'; -import { useKeyboardHeight } from 'utility/useKeyboardHeight'; +import { ShadowWrapper } from '@/components/Shadow'; +import { useKeyboardHeight } from '@/utility/useKeyboardHeight'; import { NavigationProp } from 'screens/types'; -import { useNavigationOffsets } from 'components/SafeNavigatorView'; +import { useNavigationOffsets } from '@/components/SafeNavigatorView'; // import MicrophoneIcon from 'assets/icons/microphone.svg'; // import AlbumIcon from 'assets/icons/collection.svg'; // import TrackIcon from 'assets/icons/note.svg'; diff --git a/src/screens/Search/types.ts b/src/screens/Search/types.ts index 21595c3..78e55c0 100644 --- a/src/screens/Search/types.ts +++ b/src/screens/Search/types.ts @@ -1,5 +1,5 @@ import { StackNavigationProp } from '@react-navigation/stack'; -import { Album } from 'store/music/types'; +import { Album } from '@/store/music/types'; export type MusicStackParams = { [key: string]: Record | undefined; diff --git a/src/screens/Settings/components/Container.tsx b/src/screens/Settings/components/Container.tsx index 13c1460..89a4a2d 100644 --- a/src/screens/Settings/components/Container.tsx +++ b/src/screens/Settings/components/Container.tsx @@ -1,4 +1,4 @@ -import { SafeScrollView } from 'components/SafeNavigatorView'; +import { SafeScrollView } from '@/components/SafeNavigatorView'; import styled from 'styled-components'; const Container = styled(SafeScrollView)` diff --git a/src/screens/Settings/components/PrivacyPolicy.tsx b/src/screens/Settings/components/PrivacyPolicy.tsx index 53f2696..2493ecb 100644 --- a/src/screens/Settings/components/PrivacyPolicy.tsx +++ b/src/screens/Settings/components/PrivacyPolicy.tsx @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'styled-components/native'; -import { Paragraph } from 'components/Typography'; -import { SafeScrollView } from 'components/SafeNavigatorView'; +import { Paragraph } from '@/components/Typography'; +import { SafeScrollView } from '@/components/SafeNavigatorView'; import policy from '../../../../docs/privacy-policy.md'; const Container = styled(SafeScrollView)` diff --git a/src/screens/Settings/components/Radio.tsx b/src/screens/Settings/components/Radio.tsx index bb33364..3d628b6 100644 --- a/src/screens/Settings/components/Radio.tsx +++ b/src/screens/Settings/components/Radio.tsx @@ -1,10 +1,10 @@ import React, { useCallback } from 'react'; import styled from 'styled-components/native'; import CheckmarkIcon from 'assets/icons/checkmark.svg'; -import { Text } from 'components/Typography'; -import useDefaultStyles from 'components/Colors'; -import { THEME_COLOR } from 'CONSTANTS'; -import { Gap } from 'components/Utility'; +import { Text } from '@/components/Typography'; +import useDefaultStyles from '@/components/Colors'; +import { THEME_COLOR } from '@/CONSTANTS'; +import { Gap } from '@/components/Utility'; import { View } from 'react-native'; export const RadioList = styled.View` diff --git a/src/screens/Settings/components/Switch.tsx b/src/screens/Settings/components/Switch.tsx index a50461a..4741843 100644 --- a/src/screens/Settings/components/Switch.tsx +++ b/src/screens/Settings/components/Switch.tsx @@ -1,4 +1,4 @@ -import { Text } from 'components/Typography'; +import { Text } from '@/components/Typography'; import styled from 'styled-components/native'; export const SwitchContainer = styled.View` diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index 31e2c61..aeb2e77 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -1,11 +1,11 @@ import React, { useCallback } from 'react'; import { StyleSheet } from 'react-native'; -import { t } from '@localisation'; +import { t } from '@/localisation'; import { createStackNavigator } from '@react-navigation/stack'; import { useNavigation } from '@react-navigation/native'; -import { THEME_COLOR } from 'CONSTANTS'; -import ListButton from 'components/ListButton'; -import useDefaultStyles, { ColoredBlurView } from 'components/Colors'; +import { THEME_COLOR } from '@/CONSTANTS'; +import ListButton from '@/components/ListButton'; +import useDefaultStyles, { ColoredBlurView } from '@/components/Colors'; import { SettingsNavigationProp } from './types'; @@ -14,7 +14,7 @@ import Sentry from './stacks/Sentry'; import Library from './stacks/Library'; import ColorScheme from './stacks/ColorScheme'; import PlaybackReporting from './stacks/PlaybackReporting'; -import { SafeScrollView } from 'components/SafeNavigatorView'; +import { SafeScrollView } from '@/components/SafeNavigatorView'; import PrivacyPolicy from './components/PrivacyPolicy'; export function SettingsList() { diff --git a/src/screens/Settings/stacks/Cache.tsx b/src/screens/Settings/stacks/Cache.tsx index b5daf24..d12b2a3 100644 --- a/src/screens/Settings/stacks/Cache.tsx +++ b/src/screens/Settings/stacks/Cache.tsx @@ -1,11 +1,11 @@ import React, { useCallback } from 'react'; import TrackPlayer from 'react-native-track-player'; -import music from 'store/music'; -import { t } from '@localisation'; -import Button from 'components/Button'; +import music from '@/store/music'; +import { t } from '@/localisation'; +import Button from '@/components/Button'; import styled from 'styled-components/native'; -import { Paragraph } from 'components/Typography'; -import { useAppDispatch } from 'store'; +import { Paragraph } from '@/components/Typography'; +import { useAppDispatch } from '@/store'; import Container from '../components/Container'; const ClearCache = styled(Button)` diff --git a/src/screens/Settings/stacks/ColorScheme.tsx b/src/screens/Settings/stacks/ColorScheme.tsx index c4999d0..997ef1e 100644 --- a/src/screens/Settings/stacks/ColorScheme.tsx +++ b/src/screens/Settings/stacks/ColorScheme.tsx @@ -1,11 +1,11 @@ import React, { useCallback } from 'react'; -import { Paragraph } from 'components/Typography'; +import { Paragraph } from '@/components/Typography'; import Container from '../components/Container'; -import { t } from '@localisation'; +import { t } from '@/localisation'; import { RadioItem, RadioList } from '../components/Radio'; -import { ColorScheme } from 'store/settings/types'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { setColorScheme } from 'store/settings/actions'; +import { ColorScheme } from '@/store/settings/types'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { setColorScheme } from '@/store/settings/actions'; export default function ColorSchemeSetting() { const dispatch = useAppDispatch(); diff --git a/src/screens/Settings/stacks/Library.tsx b/src/screens/Settings/stacks/Library.tsx index a48378c..674fbf0 100644 --- a/src/screens/Settings/stacks/Library.tsx +++ b/src/screens/Settings/stacks/Library.tsx @@ -1,11 +1,11 @@ import { useNavigation } from '@react-navigation/native'; import React, { useCallback } from 'react'; -import useDefaultStyles from 'components/Colors'; +import useDefaultStyles from '@/components/Colors'; import { NavigationProp } from '../..'; -import { useTypedSelector } from 'store'; -import { t } from '@localisation'; -import Button from 'components/Button'; -import { Paragraph } from 'components/Typography'; +import { useTypedSelector } from '@/store'; +import { t } from '@/localisation'; +import Button from '@/components/Button'; +import { Paragraph } from '@/components/Typography'; import Container from '../components/Container'; import { InputContainer, Input } from '../components/Input'; diff --git a/src/screens/Settings/stacks/PlaybackReporting.tsx b/src/screens/Settings/stacks/PlaybackReporting.tsx index cdd04b7..4cbe535 100644 --- a/src/screens/Settings/stacks/PlaybackReporting.tsx +++ b/src/screens/Settings/stacks/PlaybackReporting.tsx @@ -1,10 +1,10 @@ -import { Paragraph } from 'components/Typography'; +import { Paragraph } from '@/components/Typography'; import React, { useCallback } from 'react'; import { Switch } from 'react-native-gesture-handler'; -import { t } from '@localisation'; -import { SafeScrollView } from 'components/SafeNavigatorView'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { setEnablePlaybackReporting } from 'store/settings/actions'; +import { t } from '@/localisation'; +import { SafeScrollView } from '@/components/SafeNavigatorView'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { setEnablePlaybackReporting } from '@/store/settings/actions'; import Container from '../components/Container'; import { SwitchContainer, SwitchLabel } from '../components/Switch'; diff --git a/src/screens/Settings/stacks/Sentry.tsx b/src/screens/Settings/stacks/Sentry.tsx index 5e28fc6..bc98514 100644 --- a/src/screens/Settings/stacks/Sentry.tsx +++ b/src/screens/Settings/stacks/Sentry.tsx @@ -1,15 +1,15 @@ -import { Paragraph, Text } from 'components/Typography'; +import { Paragraph, Text } from '@/components/Typography'; import React, { useEffect, useState } from 'react'; import { Switch } from 'react-native-gesture-handler'; import styled, { css } from 'styled-components/native'; -import { isSentryEnabled, setSentryStatus } from 'utility/Sentry'; +import { isSentryEnabled, setSentryStatus } from '@/utility/Sentry'; import Accordion from 'react-native-collapsible/Accordion'; import ChevronIcon from 'assets/icons/chevron-right.svg'; -import { THEME_COLOR } from 'CONSTANTS'; -import useDefaultStyles, { DefaultStylesProvider } from 'components/Colors'; -import { t } from '@localisation'; -import { SafeScrollView } from 'components/SafeNavigatorView'; +import { THEME_COLOR } from '@/CONSTANTS'; +import useDefaultStyles, { DefaultStylesProvider } from '@/components/Colors'; +import { t } from '@/localisation'; +import { SafeScrollView } from '@/components/SafeNavigatorView'; const Container = styled.View` padding: 24px; diff --git a/src/screens/index.tsx b/src/screens/index.tsx index 017c46e..28acf25 100644 --- a/src/screens/index.tsx +++ b/src/screens/index.tsx @@ -3,7 +3,7 @@ import { createBottomTabNavigator, BottomTabNavigationProp } from '@react-naviga import { StackNavigationProp } from '@react-navigation/stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { CompositeNavigationProp } from '@react-navigation/native'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import SearchStack from './Search'; import Music from './Music'; @@ -17,13 +17,13 @@ import SearchIcon from 'assets/icons/magnifying-glass.svg'; import NotesIcon from 'assets/icons/notes.svg'; import GearIcon from 'assets/icons/gear.svg'; import DownloadsIcon from 'assets/icons/arrow-down-to-line.svg'; -import { useTypedSelector } from 'store'; -import { t } from '@localisation'; -import ErrorReportingAlert from 'utility/ErrorReportingAlert'; +import { useTypedSelector } from '@/store'; +import { t } from '@/localisation'; +import ErrorReportingAlert from '@/utility/ErrorReportingAlert'; import ErrorReportingPopup from './modals/ErrorReportingPopup'; import Player from './modals/Player'; import { StyleSheet } from 'react-native'; -import { ColoredBlurView } from 'components/Colors'; +import { ColoredBlurView } from '@/components/Colors'; import { StackParams } from './types'; const Stack = createNativeStackNavigator(); diff --git a/src/screens/modals/ErrorReportingPopup.tsx b/src/screens/modals/ErrorReportingPopup.tsx index d86feb0..d12c6f8 100644 --- a/src/screens/modals/ErrorReportingPopup.tsx +++ b/src/screens/modals/ErrorReportingPopup.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Modal from 'components/Modal'; +import Modal from '@/components/Modal'; import Sentry from 'screens/Settings/stacks/Sentry'; export default function ErrorReportingPopup() { diff --git a/src/screens/modals/Player/components/Casting.android.tsx b/src/screens/modals/Player/components/Casting.android.tsx index 378d15a..a94324a 100644 --- a/src/screens/modals/Player/components/Casting.android.tsx +++ b/src/screens/modals/Player/components/Casting.android.tsx @@ -1,4 +1,4 @@ -import { t } from '@localisation'; +import { t } from '@/localisation'; import React from 'react'; import styled from 'styled-components/native'; diff --git a/src/screens/modals/Player/components/Casting.ios.tsx b/src/screens/modals/Player/components/Casting.ios.tsx index 4d12ae2..c96781b 100644 --- a/src/screens/modals/Player/components/Casting.ios.tsx +++ b/src/screens/modals/Player/components/Casting.ios.tsx @@ -1,12 +1,12 @@ -import { Text } from 'components/Typography'; -import { THEME_COLOR } from 'CONSTANTS'; +import { Text } from '@/components/Typography'; +import { THEME_COLOR } from '@/CONSTANTS'; import React, { useCallback } from 'react'; import { showRoutePicker, useAirplayRoutes } from 'react-airplay'; import { TouchableOpacity } from 'react-native'; import styled, { css } from 'styled-components/native'; import AirplayAudioIcon from 'assets/icons/airplay-audio.svg'; -import useDefaultStyles from 'components/Colors'; -import { t } from '@localisation'; +import useDefaultStyles from '@/components/Colors'; +import { t } from '@/localisation'; const Container = styled.View<{ active?: boolean }>` display: flex; diff --git a/src/screens/modals/Player/components/ConnectionNotice.tsx b/src/screens/modals/Player/components/ConnectionNotice.tsx index f2a535a..42fb21c 100644 --- a/src/screens/modals/Player/components/ConnectionNotice.tsx +++ b/src/screens/modals/Player/components/ConnectionNotice.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { useNetInfo } from '@react-native-community/netinfo'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import styled from 'styled-components/native'; import CloudSlash from 'assets/icons/cloud-slash.svg'; import { Text } from 'react-native'; -import { t } from '@localisation'; -import useDefaultStyles from 'components/Colors'; +import { t } from '@/localisation'; +import useDefaultStyles from '@/components/Colors'; const Well = styled.View` border-radius: 8px; diff --git a/src/screens/modals/Player/components/MediaControls.tsx b/src/screens/modals/Player/components/MediaControls.tsx index ef8597c..c129a66 100644 --- a/src/screens/modals/Player/components/MediaControls.tsx +++ b/src/screens/modals/Player/components/MediaControls.tsx @@ -2,7 +2,7 @@ import React from 'react'; import TrackPlayer, { State, usePlaybackState } from 'react-native-track-player'; import { TouchableOpacity, useColorScheme } from 'react-native'; import styled from 'styled-components/native'; -import { useHasNextQueue, useHasPreviousQueue } from 'utility/useQueue'; +import { useHasNextQueue, useHasPreviousQueue } from '@/utility/useQueue'; import ForwardIcon from 'assets/icons/forward-end.svg'; import BackwardIcon from 'assets/icons/backward-end.svg'; import PlayIcon from 'assets/icons/play.svg'; diff --git a/src/screens/modals/Player/components/NowPlaying.tsx b/src/screens/modals/Player/components/NowPlaying.tsx index 797f930..a6bd3ee 100644 --- a/src/screens/modals/Player/components/NowPlaying.tsx +++ b/src/screens/modals/Player/components/NowPlaying.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { View } from 'react-native'; -import useCurrentTrack from 'utility/useCurrentTrack'; +import useCurrentTrack from '@/utility/useCurrentTrack'; import styled from 'styled-components/native'; -import CoverImage from 'components/CoverImage'; -import { Header, SubHeader } from 'components/Typography'; +import CoverImage from '@/components/CoverImage'; +import { Header, SubHeader } from '@/components/Typography'; const Artwork = styled(CoverImage)` margin: 0 auto 25px auto; diff --git a/src/screens/modals/Player/components/ProgressBar.tsx b/src/screens/modals/Player/components/ProgressBar.tsx index bc06281..0480394 100644 --- a/src/screens/modals/Player/components/ProgressBar.tsx +++ b/src/screens/modals/Player/components/ProgressBar.tsx @@ -6,9 +6,9 @@ import ProgressTrack, { getMinutes, getSeconds, ProgressTrackContainer -} from 'components/Progresstrack'; +} from '@/components/Progresstrack'; import { Gesture, GestureDetector, gestureHandlerRootHOC } from 'react-native-gesture-handler'; -import { THEME_COLOR } from 'CONSTANTS'; +import { THEME_COLOR } from '@/CONSTANTS'; import Reanimated, { useSharedValue, useAnimatedStyle, @@ -17,8 +17,8 @@ import Reanimated, { useDerivedValue, runOnJS, } from 'react-native-reanimated'; -import ReText from 'components/ReText'; -import useCurrentTrack from 'utility/useCurrentTrack'; +import ReText from '@/components/ReText'; +import useCurrentTrack from '@/utility/useCurrentTrack'; const DRAG_HANDLE_SIZE = 20; const PADDING_TOP = 12; diff --git a/src/screens/modals/Player/components/Queue.tsx b/src/screens/modals/Player/components/Queue.tsx index ced7145..151bad6 100644 --- a/src/screens/modals/Player/components/Queue.tsx +++ b/src/screens/modals/Player/components/Queue.tsx @@ -1,20 +1,20 @@ import React, { useCallback, useEffect, useState } from 'react'; -import useQueue from 'utility/useQueue'; +import useQueue from '@/utility/useQueue'; import { View, StyleSheet, ListRenderItemInfo } from 'react-native'; import styled, { css } from 'styled-components/native'; -import useCurrentTrack from 'utility/useCurrentTrack'; -import TouchableHandler from 'components/TouchableHandler'; +import useCurrentTrack from '@/utility/useCurrentTrack'; +import TouchableHandler from '@/components/TouchableHandler'; import TrackPlayer, { RepeatMode, Track } from 'react-native-track-player'; -import { t } from '@localisation'; -import useDefaultStyles from 'components/Colors'; -import { Text } from 'components/Typography'; +import { t } from '@/localisation'; +import useDefaultStyles from '@/components/Colors'; +import { Text } from '@/components/Typography'; import RepeatIcon from 'assets/icons/repeat.svg'; import RepeatSingleIcon from 'assets/icons/repeat.1.svg'; -import Button from 'components/Button'; -import { THEME_COLOR } from 'CONSTANTS'; -import DownloadIcon from 'components/DownloadIcon'; -import Divider from 'components/Divider'; -import ticksToDuration from 'utility/ticksToDuration'; +import Button from '@/components/Button'; +import { THEME_COLOR } from '@/CONSTANTS'; +import DownloadIcon from '@/components/DownloadIcon'; +import Divider from '@/components/Divider'; +import ticksToDuration from '@/utility/ticksToDuration'; const ICON_SIZE = 16; diff --git a/src/screens/modals/Player/components/StreamStatus.tsx b/src/screens/modals/Player/components/StreamStatus.tsx index cfc1867..b91cfff 100644 --- a/src/screens/modals/Player/components/StreamStatus.tsx +++ b/src/screens/modals/Player/components/StreamStatus.tsx @@ -1,12 +1,12 @@ import React, { useMemo } from 'react'; -import useCurrentTrack from 'utility/useCurrentTrack'; +import useCurrentTrack from '@/utility/useCurrentTrack'; import CloudIcon from 'assets/icons/cloud.svg'; import InternalDriveIcon from 'assets/icons/internal-drive.svg'; -import useDefaultStyles from 'components/Colors'; -import { Text } from 'components/Typography'; +import useDefaultStyles from '@/components/Colors'; +import { Text } from '@/components/Typography'; import styled from 'styled-components/native'; import Casting from './Casting'; -import { t } from '@localisation'; +import { t } from '@/localisation'; const ICON_SIZE = 16; diff --git a/src/screens/modals/SetJellyfinServer/components/CredentialGenerator.tsx b/src/screens/modals/SetJellyfinServer/components/CredentialGenerator.tsx index a476b1b..cb04da5 100644 --- a/src/screens/modals/SetJellyfinServer/components/CredentialGenerator.tsx +++ b/src/screens/modals/SetJellyfinServer/components/CredentialGenerator.tsx @@ -1,7 +1,7 @@ import React, { Component, createRef } from 'react'; import { WebView, WebViewMessageEvent } from 'react-native-webview'; import { debounce } from 'lodash'; -import { AppState } from 'store'; +import { AppState } from '@/store'; interface Props { serverUrl: string; diff --git a/src/screens/modals/SetJellyfinServer/index.tsx b/src/screens/modals/SetJellyfinServer/index.tsx index 2c66c70..c419e30 100644 --- a/src/screens/modals/SetJellyfinServer/index.tsx +++ b/src/screens/modals/SetJellyfinServer/index.tsx @@ -1,15 +1,15 @@ import React, { useState, useCallback } from 'react'; import { Button, View } from 'react-native'; -import Modal from 'components/Modal'; -import Input from 'components/Input'; -import { setJellyfinCredentials } from 'store/settings/actions'; +import Modal from '@/components/Modal'; +import Input from '@/components/Input'; +import { setJellyfinCredentials } from '@/store/settings/actions'; import { useNavigation, StackActions } from '@react-navigation/native'; import CredentialGenerator from './components/CredentialGenerator'; -import { THEME_COLOR } from 'CONSTANTS'; -import { t } from '@localisation'; -import useDefaultStyles from 'components/Colors'; -import { Text } from 'components/Typography'; -import { useAppDispatch } from 'store'; +import { THEME_COLOR } from '@/CONSTANTS'; +import { t } from '@/localisation'; +import useDefaultStyles from '@/components/Colors'; +import { Text } from '@/components/Typography'; +import { useAppDispatch } from '@/store'; export default function SetJellyfinServer() { diff --git a/src/screens/modals/TrackPopupMenu.tsx b/src/screens/modals/TrackPopupMenu.tsx index 4bd8dc0..9923121 100644 --- a/src/screens/modals/TrackPopupMenu.tsx +++ b/src/screens/modals/TrackPopupMenu.tsx @@ -1,21 +1,21 @@ import React, { useCallback } from 'react'; import { useNavigation, StackActions, useRoute, RouteProp } from '@react-navigation/native'; import { StackParams } from 'screens/types'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { Header, SubHeader } from 'components/Typography'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { Header, SubHeader } from '@/components/Typography'; import styled from 'styled-components/native'; -import { t } from '@localisation'; +import { t } from '@/localisation'; import PlayIcon from 'assets/icons/play.svg'; import DownloadIcon from 'assets/icons/cloud-down-arrow.svg'; import QueueAppendIcon from 'assets/icons/queue-append.svg'; import TrashIcon from 'assets/icons/trash.svg'; -import { WrappableButton, WrappableButtonRow } from 'components/WrappableButtonRow'; -import CoverImage from 'components/CoverImage'; -import { queueTrackForDownload, removeDownloadedTrack } from 'store/downloads/actions'; -import usePlayTracks from 'utility/usePlayTracks'; -import { selectIsDownloaded } from 'store/downloads/selectors'; -import { useGetImage } from 'utility/JellyfinApi'; +import { WrappableButton, WrappableButtonRow } from '@/components/WrappableButtonRow'; +import CoverImage from '@/components/CoverImage'; +import { queueTrackForDownload, removeDownloadedTrack } from '@/store/downloads/actions'; +import usePlayTracks from '@/utility/usePlayTracks'; +import { selectIsDownloaded } from '@/store/downloads/selectors'; +import { useGetImage } from '@/utility/JellyfinApi'; type Route = RouteProp; diff --git a/src/screens/types.ts b/src/screens/types.ts index 020dfbb..4b429df 100644 --- a/src/screens/types.ts +++ b/src/screens/types.ts @@ -1,6 +1,6 @@ import { StackNavigationProp } from '@react-navigation/stack'; -import { SectionArtistItem } from 'store/music/selectors'; -import { Album } from 'store/music/types'; +import { SectionArtistItem } from '@/store/music/selectors'; +import { Album } from '@/store/music/types'; export type StackParams = { [key: string]: Record | object | undefined; diff --git a/src/store/downloads/actions.ts b/src/store/downloads/actions.ts index fffd992..6f9446c 100644 --- a/src/store/downloads/actions.ts +++ b/src/store/downloads/actions.ts @@ -1,9 +1,9 @@ import { createAction, createAsyncThunk, createEntityAdapter, EntityId } from '@reduxjs/toolkit'; -import { AppState } from 'store'; -import { generateTrackUrl } from 'utility/JellyfinApi'; +import { AppState } from '@/store'; +import { generateTrackUrl } from '@/utility/JellyfinApi'; import { downloadFile, unlink, DocumentDirectoryPath, exists } from 'react-native-fs'; import { DownloadEntity } from './types'; -import MimeTypes from 'utility/MimeTypes'; +import MimeTypes from '@/utility/MimeTypes'; export const downloadAdapter = createEntityAdapter({ selectId: (entity) => entity.id, diff --git a/src/store/downloads/selectors.ts b/src/store/downloads/selectors.ts index f2ef04e..8358ebc 100644 --- a/src/store/downloads/selectors.ts +++ b/src/store/downloads/selectors.ts @@ -1,6 +1,6 @@ import { createSelector, EntityId } from '@reduxjs/toolkit'; import { intersection } from 'lodash'; -import { AppState } from 'store'; +import { AppState } from '@/store'; export const selectAllDownloads = (state: AppState) => state.downloads; export const selectDownloadedEntities = (state: AppState) => state.downloads.entities; diff --git a/src/store/music/actions.ts b/src/store/music/actions.ts index 5fa8c26..8cb8085 100644 --- a/src/store/music/actions.ts +++ b/src/store/music/actions.ts @@ -1,7 +1,7 @@ import { createAsyncThunk, createEntityAdapter } from '@reduxjs/toolkit'; import { Album, AlbumTrack, Playlist } from './types'; import { AsyncThunkAPI } from '..'; -import { retrieveAllAlbums, retrieveAlbumTracks, retrieveRecentAlbums, searchItem, retrieveAlbum, retrieveAllPlaylists, retrievePlaylistTracks } from 'utility/JellyfinApi'; +import { retrieveAllAlbums, retrieveAlbumTracks, retrieveRecentAlbums, searchItem, retrieveAlbum, retrieveAllPlaylists, retrievePlaylistTracks } from '@/utility/JellyfinApi'; export const albumAdapter = createEntityAdapter({ selectId: album => album.Id, diff --git a/src/store/music/index.ts b/src/store/music/index.ts index 880b422..7777913 100644 --- a/src/store/music/index.ts +++ b/src/store/music/index.ts @@ -12,7 +12,7 @@ import { } from './actions'; import { createSlice, Dictionary, EntityId } from '@reduxjs/toolkit'; import { Album, AlbumTrack, Playlist } from './types'; -import { setJellyfinCredentials } from 'store/settings/actions'; +import { setJellyfinCredentials } from '@/store/settings/actions'; export interface State { albums: { diff --git a/src/store/music/selectors.ts b/src/store/music/selectors.ts index 8179a95..feee3aa 100644 --- a/src/store/music/selectors.ts +++ b/src/store/music/selectors.ts @@ -1,6 +1,6 @@ -import { useTypedSelector, AppState } from 'store'; +import { useTypedSelector, AppState } from '@/store'; import { parseISO } from 'date-fns'; -import { ALPHABET_LETTERS } from 'CONSTANTS'; +import { ALPHABET_LETTERS } from '@/CONSTANTS'; import { createSelector, EntityId } from '@reduxjs/toolkit'; import { SectionListData } from 'react-native'; import { ArtistItem } from './types'; diff --git a/src/utility/ErrorReportingAlert.ts b/src/utility/ErrorReportingAlert.ts index e38adff..34d35a0 100644 --- a/src/utility/ErrorReportingAlert.ts +++ b/src/utility/ErrorReportingAlert.ts @@ -1,8 +1,8 @@ import { useEffect } from 'react'; import { Alert } from 'react-native'; -import { useAppDispatch, useTypedSelector } from 'store'; -import { t } from '@localisation'; -import { setReceivedErrorReportingAlert } from 'store/settings/actions'; +import { useAppDispatch, useTypedSelector } from '@/store'; +import { t } from '@/localisation'; +import { setReceivedErrorReportingAlert } from '@/store/settings/actions'; import { setSentryStatus } from './Sentry'; import { useNavigation } from '@react-navigation/native'; import { NavigationProp } from 'screens/types'; diff --git a/src/utility/JellyfinApi.ts b/src/utility/JellyfinApi.ts index 4f639ce..160d24e 100644 --- a/src/utility/JellyfinApi.ts +++ b/src/utility/JellyfinApi.ts @@ -1,6 +1,6 @@ import TrackPlayer, { RepeatMode, State, Track } from 'react-native-track-player'; -import { AppState, useTypedSelector } from 'store'; -import { Album, AlbumTrack, SimilarAlbum } from 'store/music/types'; +import { AppState, useTypedSelector } from '@/store'; +import { Album, AlbumTrack, SimilarAlbum } from '@/store/music/types'; type Credentials = AppState['settings']['jellyfin']; diff --git a/src/utility/PlaybackService.ts b/src/utility/PlaybackService.ts index b0f3053..9b28c11 100644 --- a/src/utility/PlaybackService.ts +++ b/src/utility/PlaybackService.ts @@ -8,7 +8,7 @@ */ import TrackPlayer, { Event, State } from 'react-native-track-player'; -import store from 'store'; +import store from '@/store'; import { sendPlaybackEvent } from './JellyfinApi'; export default async function() { diff --git a/src/utility/usePlayTracks.ts b/src/utility/usePlayTracks.ts index 13e48a1..2b01d4b 100644 --- a/src/utility/usePlayTracks.ts +++ b/src/utility/usePlayTracks.ts @@ -1,4 +1,4 @@ -import { useTypedSelector } from 'store'; +import { useTypedSelector } from '@/store'; import { useCallback } from 'react'; import TrackPlayer, { Track } from 'react-native-track-player'; import { generateTrack } from './JellyfinApi'; diff --git a/tsconfig.json b/tsconfig.json index 45a6c70..1d6af10 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,15 @@ { - "extends": "@tsconfig/react-native/tsconfig.json" + "extends": "@tsconfig/react-native/tsconfig.json", + "compilerOptions": { + "baseUrl": "./src", + "paths": { + "@/*": [ + "*" + ], + }, + "types": [ + "@types/styled-components-react-native", + "@types/node" + ], + }, }