mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-25 20:48:39 -06:00
make search great again
This commit is contained in:
@@ -2,8 +2,12 @@ import { usePlayerContext } from "../../../player/provider";
|
||||
import { StackParamList } from "../../../components/types";
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { Separator, View, XStack } from "tamagui";
|
||||
import { Separator, Spacer, View, XStack } from "tamagui";
|
||||
import { Text } from "../helpers/text";
|
||||
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
||||
import BlurhashedImage from "../helpers/blurhashed-image";
|
||||
import Icon from "../helpers/icon";
|
||||
import { Colors } from "../../../enums/colors";
|
||||
|
||||
export default function Item({
|
||||
item,
|
||||
@@ -17,6 +21,8 @@ export default function Item({
|
||||
|
||||
const { usePlayNewQueue } = usePlayerContext();
|
||||
|
||||
const { width } = useSafeAreaFrame();
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Separator />
|
||||
@@ -24,6 +30,7 @@ export default function Item({
|
||||
<XStack
|
||||
alignContent="center"
|
||||
flex={1}
|
||||
minHeight={width / 9}
|
||||
onPress={() => {
|
||||
switch (item.Type) {
|
||||
case ("MusicArtist") : {
|
||||
@@ -58,7 +65,18 @@ export default function Item({
|
||||
})
|
||||
}}
|
||||
>
|
||||
<BlurhashedImage item={item} size={width / 9} />
|
||||
<Text>{ item.Name ?? ""}</Text>
|
||||
|
||||
{ item.UserData?.IsFavorite ? (
|
||||
<Icon
|
||||
small
|
||||
color={Colors.Primary}
|
||||
name="heart"
|
||||
/>
|
||||
) : (
|
||||
<Spacer />
|
||||
)}
|
||||
</XStack>
|
||||
</View>
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function Search({
|
||||
useEffect(() => {
|
||||
debounce(() => {
|
||||
refetch()
|
||||
}, 500)
|
||||
}, 750)
|
||||
}, [
|
||||
searchString
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user