From 6a87a35bda83187d846e2b4e7e5f574a4e56c957 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Thu, 9 Jan 2025 06:50:54 -0600 Subject: [PATCH] clean up global component folder player styling changes --- components/Album/component.tsx | 6 +++--- components/Artist/component.tsx | 6 ++---- components/Global/{ => components}/track.tsx | 6 +++--- components/Global/{ => helpers}/avatar.tsx | 0 components/Global/{ => helpers}/blurhash-loading.tsx | 0 components/Global/{ => helpers}/button.tsx | 0 components/Global/{ => helpers}/card.tsx | 4 ++-- .../Global/{ => helpers}/checkbox-with-label.tsx | 0 components/Global/{ => helpers}/icon.tsx | 2 +- components/Global/{ => helpers}/input.tsx | 0 .../{ => helpers}/radio-group-item-with-label.tsx | 0 components/Global/{ => helpers}/runtimeticks.tsx | 0 components/Global/{ => helpers}/slider.tsx | 0 components/Global/{ => helpers}/switch-with-label.tsx | 0 components/Global/{ => helpers}/text.tsx | 0 components/Global/{ => helpers}/toggle-group.tsx | 0 components/Home/component.tsx | 2 +- components/Home/helpers/playlists.tsx | 4 ++-- components/Home/helpers/recent-artists.tsx | 4 ++-- components/Home/helpers/recently-played.tsx | 4 ++-- components/Login/helpers/server-address.tsx | 8 ++++---- components/Login/helpers/server-authentication.tsx | 6 +++--- components/Login/helpers/server-library.tsx | 4 ++-- components/Player/component.tsx | 11 ++++++----- components/Player/helpers/buttons.tsx | 2 +- components/Player/mini-player.tsx | 4 ++-- components/Settings/helpers/library-details.tsx | 2 +- components/Settings/helpers/server-details.tsx | 2 +- components/Settings/helpers/sign-out.tsx | 2 +- 29 files changed, 39 insertions(+), 40 deletions(-) rename components/Global/{ => components}/track.tsx (92%) rename components/Global/{ => helpers}/avatar.tsx (100%) rename components/Global/{ => helpers}/blurhash-loading.tsx (100%) rename components/Global/{ => helpers}/button.tsx (100%) rename components/Global/{ => helpers}/card.tsx (97%) rename components/Global/{ => helpers}/checkbox-with-label.tsx (100%) rename components/Global/{ => helpers}/icon.tsx (92%) rename components/Global/{ => helpers}/input.tsx (100%) rename components/Global/{ => helpers}/radio-group-item-with-label.tsx (100%) rename components/Global/{ => helpers}/runtimeticks.tsx (100%) rename components/Global/{ => helpers}/slider.tsx (100%) rename components/Global/{ => helpers}/switch-with-label.tsx (100%) rename components/Global/{ => helpers}/text.tsx (100%) rename components/Global/{ => helpers}/toggle-group.tsx (100%) diff --git a/components/Album/component.tsx b/components/Album/component.tsx index ebb61065..32565494 100644 --- a/components/Album/component.tsx +++ b/components/Album/component.tsx @@ -7,13 +7,13 @@ import { getImageApi } from "@jellyfin/sdk/lib/utils/api"; import { useApiClientContext } from "../jellyfin-api-provider"; import { BaseItemDto, ImageType } from "@jellyfin/sdk/lib/generated-client/models"; import { queryConfig } from "../../api/queries/query.config"; -import { H4, H5, Text } from "../Global/text"; +import { H4, H5, Text } from "../Global/helpers/text"; import { FlatList } from "react-native"; import { useAlbumTracks } from "../../api/queries/album"; import { usePlayerContext } from "../../player/provider"; import { mapDtoToTrack } from "../../helpers/mappings"; -import RunTimeTicks from "../Global/runtimeticks"; -import Track from "../Global/track"; +import RunTimeTicks from "../Global/helpers/runtimeticks"; +import Track from "../Global/components/track"; interface AlbumProps { album: BaseItemDto, diff --git a/components/Artist/component.tsx b/components/Artist/component.tsx index e6470a6f..fb0f25ac 100644 --- a/components/Artist/component.tsx +++ b/components/Artist/component.tsx @@ -1,13 +1,11 @@ import { ScrollView } from "tamagui"; -import Avatar from "../Global/avatar"; -import { SafeAreaView } from "react-native-safe-area-context"; import { useArtistAlbums } from "../../api/queries/artist"; import { useApiClientContext } from "../jellyfin-api-provider"; import { FlatList } from "react-native"; -import { Card } from "../Global/card"; +import { Card } from "../Global/helpers/card"; import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import { StackParamList } from "../types"; -import { H4, H5 } from "../Global/text"; +import { H4 } from "../Global/helpers/text"; import { useState } from "react"; import { CachedImage } from "@georstat/react-native-image-cache"; import { ImageType } from "@jellyfin/sdk/lib/generated-client/models"; diff --git a/components/Global/track.tsx b/components/Global/components/track.tsx similarity index 92% rename from components/Global/track.tsx rename to components/Global/components/track.tsx index b3e590d4..c59b3510 100644 --- a/components/Global/track.tsx +++ b/components/Global/components/track.tsx @@ -1,9 +1,9 @@ import { usePlayerContext } from "@/player/provider"; import React from "react"; import { Separator, useTheme, View, XStack } from "tamagui"; -import { Text } from "./text"; -import RunTimeTicks from "./runtimeticks"; -import { useApiClientContext } from "../jellyfin-api-provider"; +import { Text } from "../helpers/text"; +import RunTimeTicks from "../helpers/runtimeticks"; +import { useApiClientContext } from "../../jellyfin-api-provider"; import { mapDtoToTrack } from "@/helpers/mappings"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { Colors } from "@/enums/colors"; diff --git a/components/Global/avatar.tsx b/components/Global/helpers/avatar.tsx similarity index 100% rename from components/Global/avatar.tsx rename to components/Global/helpers/avatar.tsx diff --git a/components/Global/blurhash-loading.tsx b/components/Global/helpers/blurhash-loading.tsx similarity index 100% rename from components/Global/blurhash-loading.tsx rename to components/Global/helpers/blurhash-loading.tsx diff --git a/components/Global/button.tsx b/components/Global/helpers/button.tsx similarity index 100% rename from components/Global/button.tsx rename to components/Global/helpers/button.tsx diff --git a/components/Global/card.tsx b/components/Global/helpers/card.tsx similarity index 97% rename from components/Global/card.tsx rename to components/Global/helpers/card.tsx index 4f301747..a0531e17 100644 --- a/components/Global/card.tsx +++ b/components/Global/helpers/card.tsx @@ -1,13 +1,13 @@ import React, { } from "react"; import type { CardProps as TamaguiCardProps } from "tamagui" import { H5, Card as TamaguiCard, View } from "tamagui"; -import { useApiClientContext } from "../jellyfin-api-provider"; +import { useApiClientContext } from "../../jellyfin-api-provider"; import { getImageApi } from "@jellyfin/sdk/lib/utils/api"; import { ImageType } from "@jellyfin/sdk/lib/generated-client/models"; import { CachedImage } from "@georstat/react-native-image-cache"; import invert from "invert-color" import { Blurhash } from "react-native-blurhash" -import { queryConfig } from "../../api/queries/query.config"; +import { queryConfig } from "../../../api/queries/query.config"; import { Text } from "./text"; interface CardProps extends TamaguiCardProps { diff --git a/components/Global/checkbox-with-label.tsx b/components/Global/helpers/checkbox-with-label.tsx similarity index 100% rename from components/Global/checkbox-with-label.tsx rename to components/Global/helpers/checkbox-with-label.tsx diff --git a/components/Global/icon.tsx b/components/Global/helpers/icon.tsx similarity index 92% rename from components/Global/icon.tsx rename to components/Global/helpers/icon.tsx index 578a254b..62d3f0ad 100644 --- a/components/Global/icon.tsx +++ b/components/Global/helpers/icon.tsx @@ -1,6 +1,6 @@ import React from "react" import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons" -import { Colors } from "../../enums/colors" +import { Colors } from "../../../enums/colors" const regularSize = 12; diff --git a/components/Global/input.tsx b/components/Global/helpers/input.tsx similarity index 100% rename from components/Global/input.tsx rename to components/Global/helpers/input.tsx diff --git a/components/Global/radio-group-item-with-label.tsx b/components/Global/helpers/radio-group-item-with-label.tsx similarity index 100% rename from components/Global/radio-group-item-with-label.tsx rename to components/Global/helpers/radio-group-item-with-label.tsx diff --git a/components/Global/runtimeticks.tsx b/components/Global/helpers/runtimeticks.tsx similarity index 100% rename from components/Global/runtimeticks.tsx rename to components/Global/helpers/runtimeticks.tsx diff --git a/components/Global/slider.tsx b/components/Global/helpers/slider.tsx similarity index 100% rename from components/Global/slider.tsx rename to components/Global/helpers/slider.tsx diff --git a/components/Global/switch-with-label.tsx b/components/Global/helpers/switch-with-label.tsx similarity index 100% rename from components/Global/switch-with-label.tsx rename to components/Global/helpers/switch-with-label.tsx diff --git a/components/Global/text.tsx b/components/Global/helpers/text.tsx similarity index 100% rename from components/Global/text.tsx rename to components/Global/helpers/text.tsx diff --git a/components/Global/toggle-group.tsx b/components/Global/helpers/toggle-group.tsx similarity index 100% rename from components/Global/toggle-group.tsx rename to components/Global/helpers/toggle-group.tsx diff --git a/components/Home/component.tsx b/components/Home/component.tsx index 12086a4c..95be7ad8 100644 --- a/components/Home/component.tsx +++ b/components/Home/component.tsx @@ -8,7 +8,7 @@ import { HomeProvider, useHomeContext } from "./provider"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { StackParamList, ProvidedHomeProps } from "../types"; import { HomeArtistScreen } from "./screens/artist"; -import Avatar from "../Global/avatar"; +import Avatar from "../Global/helpers/avatar"; import { HomeAlbumScreen } from "./screens/album"; import Playlists from "./helpers/playlists"; import { SafeAreaView } from "react-native-safe-area-context"; diff --git a/components/Home/helpers/playlists.tsx b/components/Home/helpers/playlists.tsx index 7e7b6498..9e50ea02 100644 --- a/components/Home/helpers/playlists.tsx +++ b/components/Home/helpers/playlists.tsx @@ -1,6 +1,6 @@ import { useUserPlaylists } from "@/api/queries/playlist"; -import { Card } from "@/components/Global/card"; -import { H2 } from "@/components/Global/text"; +import { Card } from "@/components/Global/helpers/card"; +import { H2 } from "@/components/Global/helpers/text"; import { useApiClientContext } from "@/components/jellyfin-api-provider"; import React from "react"; import { FlatList } from "react-native"; diff --git a/components/Home/helpers/recent-artists.tsx b/components/Home/helpers/recent-artists.tsx index 1e7b46ed..394d6969 100644 --- a/components/Home/helpers/recent-artists.tsx +++ b/components/Home/helpers/recent-artists.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from "react"; import { View } from "tamagui"; import { useHomeContext } from "../provider"; -import { H2 } from "../../Global/text"; +import { H2 } from "../../Global/helpers/text"; import { ProvidedHomeProps } from "../../types"; import { FlatList } from "react-native"; -import { Card } from "../../Global/card"; +import { Card } from "../../Global/helpers/card"; import { getPrimaryBlurhashFromDto } from "../../../helpers/blurhash"; export default function RecentArtists({ navigation }: ProvidedHomeProps): React.JSX.Element { diff --git a/components/Home/helpers/recently-played.tsx b/components/Home/helpers/recently-played.tsx index 65f2880b..cc08858b 100644 --- a/components/Home/helpers/recently-played.tsx +++ b/components/Home/helpers/recently-played.tsx @@ -1,8 +1,8 @@ import React, { useEffect } from "react"; import { ScrollView, View } from "tamagui"; import { useHomeContext } from "../provider"; -import { H2 } from "../../Global/text"; -import { Card } from "../../Global/card"; +import { H2 } from "../../Global/helpers/text"; +import { Card } from "../../Global/helpers/card"; import { mapDtoToTrack } from "../../../helpers/mappings"; import { useApiClientContext } from "../../jellyfin-api-provider"; import { usePlayerContext } from "../../../player/provider"; diff --git a/components/Login/helpers/server-address.tsx b/components/Login/helpers/server-address.tsx index 76b6f952..3cce6b7b 100644 --- a/components/Login/helpers/server-address.tsx +++ b/components/Login/helpers/server-address.tsx @@ -5,10 +5,10 @@ import { MMKVStorageKeys } from "../../../enums/mmkv-storage-keys"; import { JellifyServer } from "../../../types/JellifyServer"; import { useApiClientContext } from "../../jellyfin-api-provider"; import { Spacer, Spinner, View, XStack, ZStack } from "tamagui"; -import { SwitchWithLabel } from "../../Global/switch-with-label"; -import { H1 } from "../../Global/text"; -import Input from "../../Global/input"; -import Button from "../../Global/button"; +import { SwitchWithLabel } from "../../Global/helpers/switch-with-label"; +import { H1 } from "../../Global/helpers/text"; +import Input from "../../Global/helpers/input"; +import Button from "../../Global/helpers/button"; import { http, https } from "../utils/constants"; import { storage } from "../../../constants/storage"; import { client } from "../../../api/client"; diff --git a/components/Login/helpers/server-authentication.tsx b/components/Login/helpers/server-authentication.tsx index e34b65c8..8b267f86 100644 --- a/components/Login/helpers/server-authentication.tsx +++ b/components/Login/helpers/server-authentication.tsx @@ -5,9 +5,9 @@ import _ from "lodash"; import { JellyfinCredentials } from "../../../api/types/jellyfin-credentials"; import { Spinner, View, YStack, ZStack } from "tamagui"; import { useAuthenticationContext } from "../provider"; -import { H1 } from "../../Global/text"; -import Button from "../../Global/button"; -import Input from "../../Global/input"; +import { H1 } from "../../Global/helpers/text"; +import Button from "../../Global/helpers/button"; +import Input from "../../Global/helpers/input"; export default function ServerAuthentication(): React.JSX.Element { const { username, setUsername } = useAuthenticationContext(); diff --git a/components/Login/helpers/server-library.tsx b/components/Login/helpers/server-library.tsx index d4e1ad58..4e817019 100644 --- a/components/Login/helpers/server-library.tsx +++ b/components/Login/helpers/server-library.tsx @@ -2,8 +2,8 @@ import React, { useEffect } from "react"; import { useApiClientContext } from "../../jellyfin-api-provider"; import { Spinner, Text, ToggleGroup, View } from "tamagui"; import { useAuthenticationContext } from "../provider"; -import { H1, Label } from "../../Global/text"; -import Button from "../../Global/button"; +import { H1, Label } from "../../Global/helpers/text"; +import Button from "../../Global/helpers/button"; import _ from "lodash"; import { useMusicLibraries, usePlaylistLibrary } from "@/api/queries/libraries"; diff --git a/components/Player/component.tsx b/components/Player/component.tsx index 2591a722..3bca9548 100644 --- a/components/Player/component.tsx +++ b/components/Player/component.tsx @@ -7,12 +7,12 @@ import { useApiClientContext } from "../jellyfin-api-provider"; import { getImageApi } from "@jellyfin/sdk/lib/utils/api"; import { ImageType } from "@jellyfin/sdk/lib/generated-client/models"; import { queryConfig } from "../../api/queries/query.config"; -import { Text } from "../Global/text"; +import { Text } from "../Global/helpers/text"; import { SafeAreaView } from "react-native-safe-area-context"; import { playPauseButton } from "./helpers/buttons"; import { BottomTabNavigationEventMap } from "@react-navigation/bottom-tabs"; import { NavigationHelpers, ParamListBase } from "@react-navigation/native"; -import { HorizontalSlider } from "../Global/slider"; +import { HorizontalSlider } from "../Global/helpers/slider"; export default function Player({ navigation }: { navigation : NavigationHelpers }): React.JSX.Element { @@ -45,12 +45,13 @@ export default function Player({ navigation }: { navigation : NavigationHelpers< - - {nowPlaying?.title ?? "Untitled Track"} + + {nowPlaying?.title ?? "Untitled Track"} { navigation.navigate("Artist", { diff --git a/components/Player/helpers/buttons.tsx b/components/Player/helpers/buttons.tsx index 54b99d40..df516ce7 100644 --- a/components/Player/helpers/buttons.tsx +++ b/components/Player/helpers/buttons.tsx @@ -1,7 +1,7 @@ import { State } from "react-native-track-player"; import { Colors } from "react-native/Libraries/NewAppScreen"; import { Spinner } from "tamagui"; -import Icon from "../../Global/icon"; +import Icon from "../../Global/helpers/icon"; export function playPauseButton(playbackState: State | undefined, play: Function, pause: Function) { diff --git a/components/Player/mini-player.tsx b/components/Player/mini-player.tsx index ab0d3088..2e098471 100644 --- a/components/Player/mini-player.tsx +++ b/components/Player/mini-player.tsx @@ -5,8 +5,8 @@ import { usePlayerContext } from "../../player/provider"; import { BottomTabNavigationEventMap } from "@react-navigation/bottom-tabs"; import { NavigationHelpers, ParamListBase } from "@react-navigation/native"; import { BlurView } from "@react-native-community/blur"; -import Icon from "../Global/icon"; -import { Text } from "../Global/text"; +import Icon from "../Global/helpers/icon"; +import { Text } from "../Global/helpers/text"; import { Colors } from "../../enums/colors"; import { CachedImage } from "@georstat/react-native-image-cache"; import { ImageType } from "@jellyfin/sdk/lib/generated-client/models"; diff --git a/components/Settings/helpers/library-details.tsx b/components/Settings/helpers/library-details.tsx index 85dc891c..6cb9dd62 100644 --- a/components/Settings/helpers/library-details.tsx +++ b/components/Settings/helpers/library-details.tsx @@ -1,4 +1,4 @@ -import { Text } from "@/components/Global/text"; +import { Text } from "@/components/Global/helpers/text"; import { useApiClientContext } from "@/components/jellyfin-api-provider"; import React from "react"; import { View } from "tamagui"; diff --git a/components/Settings/helpers/server-details.tsx b/components/Settings/helpers/server-details.tsx index 980c7fa5..162eedae 100644 --- a/components/Settings/helpers/server-details.tsx +++ b/components/Settings/helpers/server-details.tsx @@ -3,7 +3,7 @@ import { useApiClientContext } from "../../jellyfin-api-provider"; import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import { H5, Text, XStack, YStack } from "tamagui"; import { Colors } from "../../../enums/colors"; -import Icon from "../../Global/icon"; +import Icon from "../../Global/helpers/icon"; export default function ServerDetails() : React.JSX.Element { diff --git a/components/Settings/helpers/sign-out.tsx b/components/Settings/helpers/sign-out.tsx index ec4b8896..4a2b8d36 100644 --- a/components/Settings/helpers/sign-out.tsx +++ b/components/Settings/helpers/sign-out.tsx @@ -1,5 +1,5 @@ import React from "react"; -import Button from "../../Global/button"; +import Button from "../../Global/helpers/button"; import { useApiClientContext } from "../../jellyfin-api-provider"; export default function SignOut(): React.JSX.Element {