Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed Feb 22, 2024
1 parent 952dd2a commit aee7c98
Showing 1 changed file with 68 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ const TracksSearchPage = ({
})
)
}
playTrack={(uid: UID) =>
dispatch(tracksActions.play(uid))
}
playTrack={(uid: UID) => dispatch(tracksActions.play(uid))}
pauseTrack={() => dispatch(tracksActions.pause())}
actions={tracksActions}
/>
Expand Down Expand Up @@ -242,7 +240,7 @@ const CardSearchPage = ({
id: user.user_id,
userId: user.user_id,
route: profilePage(user.handle),
primaryText: 'hi',
primaryText: user.name,
secondaryText: followers,
imageSize: user._profile_picture_sizes
}
Expand Down Expand Up @@ -277,9 +275,7 @@ const CardSearchPage = ({
imageSize={imageSize}
primaryText={primaryText}
secondaryText={secondaryText}
onClick={() => {
goToRoute(route)
}}
onClick={() => goToRoute(route)}
className=''
/>
)
Expand All @@ -299,7 +295,7 @@ const CardSearchPage = ({
}

const messages = {
title: 'More Resultsss',
title: 'More Results',
tagSearchTitle: 'Tag Search',
tracksTitle: 'Tracks',
albumsTitle: 'Albums',
Expand Down Expand Up @@ -348,71 +344,71 @@ const SearchPageContent = (props: SearchPageContentProps) => {
const computedTabs = useMemo(() => {
return isTagSearch
? {
didChangeTabsFrom,
tabs: [
{
icon: <IconNote />,
text: messages.tracksTitle,
label: Tabs.TRACKS
},
{
icon: <IconUser />,
text: messages.peopleTitle,
label: Tabs.PEOPLE
}
],
elements: [
<TracksSearchPage key='tagTrackSearch' {...props} />,
<CardSearchPage
key='tagUserSearch'
{...props}
cardType={CardType.USER}
/>
]
}
didChangeTabsFrom,
tabs: [
{
icon: <IconNote />,
text: messages.tracksTitle,
label: Tabs.TRACKS
},
{
icon: <IconUser />,
text: messages.peopleTitle,
label: Tabs.PEOPLE
}
],
elements: [
<TracksSearchPage key='tagTrackSearch' {...props} />,
<CardSearchPage
key='tagUserSearch'
{...props}
cardType={CardType.USER}
/>
]
}
: {
didChangeTabsFrom,
tabs: [
{
icon: <IconUser />,
text: messages.peopleTitle,
label: Tabs.PEOPLE
},
{
icon: <IconNote />,
text: messages.tracksTitle,
label: Tabs.TRACKS
},
{
icon: <IconAlbum />,
text: messages.albumsTitle,
label: Tabs.ALBUMS
},
{
icon: <IconPlaylists />,
text: messages.playlistsTitle,
label: Tabs.PLAYLISTS
}
],
elements: [
<CardSearchPage
key='userSearch'
{...props}
cardType={CardType.USER}
/>,
<TracksSearchPage key='trackSearch' {...props} />,
<CardSearchPage
key='albumSearch'
{...props}
cardType={CardType.ALBUM}
/>,
<CardSearchPage
key='playlistSearch'
{...props}
cardType={CardType.PLAYLIST}
/>
]
}
didChangeTabsFrom,
tabs: [
{
icon: <IconUser />,
text: messages.peopleTitle,
label: Tabs.PEOPLE
},
{
icon: <IconNote />,
text: messages.tracksTitle,
label: Tabs.TRACKS
},
{
icon: <IconAlbum />,
text: messages.albumsTitle,
label: Tabs.ALBUMS
},
{
icon: <IconPlaylists />,
text: messages.playlistsTitle,
label: Tabs.PLAYLISTS
}
],
elements: [
<CardSearchPage
key='userSearch'
{...props}
cardType={CardType.USER}
/>,
<TracksSearchPage key='trackSearch' {...props} />,
<CardSearchPage
key='albumSearch'
{...props}
cardType={CardType.ALBUM}
/>,
<CardSearchPage
key='playlistSearch'
{...props}
cardType={CardType.PLAYLIST}
/>
]
}
}, [isTagSearch, props, didChangeTabsFrom])

const { tabs, body } = useTabs(computedTabs)
Expand Down

0 comments on commit aee7c98

Please sign in to comment.