From 37ce38135857b4a811d3ad121a5e57ed96d83b5a Mon Sep 17 00:00:00 2001 From: ddusichka <78527291+ddusichka@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:04:53 -0500 Subject: [PATCH] minor updates --- .../components/search/AlbumSearchCard.tsx | 21 +------- frontend/components/search/Filter.tsx | 2 +- frontend/components/search/ProfileChip.tsx | 2 - frontend/components/search/SearchResults.tsx | 54 +++++-------------- frontend/components/search/SongChip.tsx | 6 +-- 5 files changed, 18 insertions(+), 67 deletions(-) diff --git a/frontend/components/search/AlbumSearchCard.tsx b/frontend/components/search/AlbumSearchCard.tsx index 0c6e24e8..298a4fb7 100644 --- a/frontend/components/search/AlbumSearchCard.tsx +++ b/frontend/components/search/AlbumSearchCard.tsx @@ -28,17 +28,14 @@ const AlbumSearchCard: React.FC = ({ router.push({ pathname: "/MediaPage", params: { - mediaType: type === "Song" ? "track" : "album", + mediaType: type, mediaId: id, }, }) } > - {/* Rank */} - {rank !== undefined ? `${rank}. ` : ""} - - {/* Album Cover */} + {rank ? `${rank}. ` : ""} = ({ {album_name} {artist_name} - {type && ( - - {type === "album" ? "Album" : type === "Song" ? "Song" : ""} - - )} ); }; const styles = StyleSheet.create({ - type: { - fontSize: 15, - color: "#9E9E9E", - marginTop: 2, - textAlign: "left", - marginLeft: 24, - fontStyle: "italic", - }, - cardContainer: { alignItems: "flex-start", marginRight: 25, diff --git a/frontend/components/search/Filter.tsx b/frontend/components/search/Filter.tsx index f67779ba..dcb0e3dd 100644 --- a/frontend/components/search/Filter.tsx +++ b/frontend/components/search/Filter.tsx @@ -15,7 +15,7 @@ const Filter: React.FC = ({ return ( - {filterOptions.map((filter) => ( + {filterOptions.map((filter: FilterOption) => ( onFilterChange(filter)} diff --git a/frontend/components/search/ProfileChip.tsx b/frontend/components/search/ProfileChip.tsx index 6ff5e08d..cd90c9d4 100644 --- a/frontend/components/search/ProfileChip.tsx +++ b/frontend/components/search/ProfileChip.tsx @@ -34,9 +34,7 @@ const ProfileChip: React.FC = ({ style={styles.recordImage} /> - console.log(profile_picture) = ({ songs, albums, @@ -36,6 +34,7 @@ const SearchResults: React.FC = ({ return No results found; } + const filterOptions: FilterOption[] = ["all", "songs", "albums", "profile"]; const [selectedFilter, setSelectedFilter] = useState("all"); const handleFilterChange = (filter: FilterOption) => { @@ -46,7 +45,7 @@ const SearchResults: React.FC = ({ @@ -56,7 +55,7 @@ const SearchResults: React.FC = ({ {selectedFilter === "all" ? ( setSelectedFilter("profile")}> - Profiles + Profiles ) : ( @@ -96,7 +95,7 @@ const SearchResults: React.FC = ({ {selectedFilter === "all" ? ( setSelectedFilter("songs")}> - Songs + Songs ) : ( @@ -110,13 +109,13 @@ const SearchResults: React.FC = ({ flexDirection: "row", flexWrap: "wrap", justifyContent: "space-between", - paddingHorizontal: 16, }} > {songs?.map((song, idx) => ( = ({ {songs?.slice(0, 9).map((song, idx) => ( = ({ {selectedFilter === "all" ? ( setSelectedFilter("albums")}> - Albums + Albums ) : ( @@ -168,7 +167,6 @@ const SearchResults: React.FC = ({ flexDirection: "row", flexWrap: "wrap", justifyContent: "space-between", - paddingHorizontal: 16, }} > {songs.length === 0 ? ( @@ -178,6 +176,7 @@ const SearchResults: React.FC = ({ (album, idx) => ( = ({ @@ -30,9 +30,7 @@ const SongChip: React.FC = ({ }) } > - {rank !== undefined && ( - {rank !== undefined ? `${rank}. ` : ""} - )} + {rank && {`${rank}. `}}