Skip to content

Commit

Permalink
final updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ddusichka committed Dec 4, 2024
1 parent d84e0ca commit 70c6ad3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions frontend/components/search/AlbumSearchCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import React from "react";
import { router } from "expo-router";
import { View, Text, StyleSheet, Image, TouchableOpacity } from "react-native";

interface AlbumSearchCardProps {
interface SearchCardProps {
id: number;
rank?: number;
rank: number;
artist_name: string;
album_name: string;
cover: string;
type?: string;
}

const AlbumSearchCard: React.FC<AlbumSearchCardProps> = ({
const SearchCard: React.FC<SearchCardProps> = ({
id,
rank,
artist_name,
Expand Down Expand Up @@ -112,4 +112,4 @@ const styles = StyleSheet.create({
},
});

export default AlbumSearchCard;
export default SearchCard;
8 changes: 4 additions & 4 deletions frontend/components/search/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TouchableOpacity,
} from "react-native";
import SongChip from "@/components/search/SongChip";
import AlbumSearchCard from "@/components/search/AlbumSearchCard";
import SearchCard from "@/components/search/AlbumSearchCard";
import ProfileChip from "@/components/search/ProfileChip";
import Filter from "@/components/search/Filter";
import AntDesign from "@expo/vector-icons/AntDesign";
Expand Down Expand Up @@ -113,7 +113,7 @@ const SearchResults: React.FC<SearchResultsProps> = ({
>
{songs?.map((song, idx) => (
<View style={{ width: "48%", marginBottom: 16 }}>
<AlbumSearchCard
<SearchCard
rank={idx + 1}
type={song.media_type}
key={idx}
Expand Down Expand Up @@ -169,13 +169,13 @@ const SearchResults: React.FC<SearchResultsProps> = ({
justifyContent: "space-between",
}}
>
{songs.length === 0 ? (
{albums.length === 0 ? (
<Text style={styles.noResults}>No albums found</Text>
) : (
(selectedFilter === "all" ? albums.slice(0, 2) : albums)?.map(
(album, idx) => (
<View style={styles.albumsList}>
<AlbumSearchCard
<SearchCard
rank={idx + 1}
type={"album"}
key={idx}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/search/TopAlbums.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { View, Text, StyleSheet } from "react-native";
import AlbumSearchCard from "@/components/search/AlbumSearchCard";
import SearchCard from "@/components/search/AlbumSearchCard";
import { ScrollView } from "react-native";

type AlbumCardProps = {
Expand All @@ -18,7 +18,7 @@ const TopAlbums = ({ albums }: AlbumCardProps) => {
showsHorizontalScrollIndicator={false}
>
{albums?.map((album, index) => (
<AlbumSearchCard
<SearchCard
type={"album"}
key={album.media.id}
id={album.media.id}
Expand Down

0 comments on commit 70c6ad3

Please sign in to comment.