Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed Feb 22, 2024
1 parent aee7c98 commit 357b2eb
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 60 deletions.
8 changes: 4 additions & 4 deletions packages/mobile/src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const useStyles = makeStyles(({ palette, typography, spacing }) => ({

type BaseCardProps = {
onPress: (id: ID) => void
noNavigatePress: () => void
noNavigatePress?: () => void
primaryText: string
renderImage: (options?: ImageProps) => ReactNode
secondaryText?: string
Expand All @@ -88,20 +88,20 @@ export type CardProps = ProfileCardProps | CollectionCardProps

export const Card = (props: CardProps) => {
const {
onPress,
primaryText,
renderImage,
secondaryText,
style,
styles: stylesProp,
TileProps = {}
TileProps = {},
noNavigatePress
} = props

const styles = useStyles()

return (
<Tile
onPress={onPress}
onPress={noNavigatePress}
styles={{ root: style, content: styles.cardContent }}
{...TileProps}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ const FullCollectionList = (props: FullCollectionListProps) => {
collectionIdsToNumTracks,
createPlaylistCallback,
createPlaylistSource,
createPlaylistTrackId
createPlaylistTrackId,
trackSearchResultSelect
]
)

Expand Down
6 changes: 3 additions & 3 deletions packages/mobile/src/components/lineup/Lineup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const getItemCount = (
) =>
Math.ceil(
(Dimensions.get('window').height / totalTileHeight[variant]) *
(typeof multiplier === 'function' ? multiplier() : multiplier)
(typeof multiplier === 'function' ? multiplier() : multiplier)
)

// Calculate minimum, initial, and loadMore itemCounts
Expand All @@ -93,7 +93,7 @@ const useItemCounts = (variant: LineupVariant) =>
[variant]
)

const fallbackLineupSelector = (() => { }) as any
const fallbackLineupSelector = (() => {}) as any

const styles = StyleSheet.create({
root: {
Expand Down Expand Up @@ -522,7 +522,7 @@ export const Lineup = ({
const pullToRefreshProps =
pullToRefresh || refreshProp
? // Need to disable refresh so scrolling the "ListEmptyComponent" doesn't trigger refresh
{ onRefresh: areSectionsEmpty ? undefined : refresh, refreshing }
{ onRefresh: areSectionsEmpty ? undefined : refresh, refreshing }
: {}

const handleEndReached = useCallback(() => handleLoadMore(), [handleLoadMore])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ListProps = Omit<CardListProps<User>, 'data'>

export type ProfileListProps = {
profiles: User[] | undefined
onCardPress: (user_id: ID) => void
onCardPress?: (user_id: ID) => void
} & Partial<ListProps>

export const ProfileList = (props: ProfileListProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export const SuggestedArtistsList = (props: SuggestedArtistsListProps) => {

const textStyles = isSelected
? {
primaryText: styles.activeText,
secondaryText: styles.activeText
}
primaryText: styles.activeText,
secondaryText: styles.activeText
}
: undefined

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,6 @@ export const TagSearchScreen = () => {
dispatch(fetchSearch(query))
}, [dispatch, query])

const trackPress = (
id: ID,
kind: 'track' | 'profile' | 'playlist' | 'album'
) => {
console.log('asdf tag track')
track(
make({
eventName: EventNames.SEARCH_TAG_SEARCH,
tag: searchQuery,
source: 'more results page'
})
)
}

const tracksScreen = tabScreen({
name: 'Tracks',
Icon: IconNote,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
} from '@audius/common/models'
import { SquareSizes } from '@audius/common/models'
import { getSearchBarText } from 'audius-client/src/common/store/search-bar/selectors'

import { View } from 'react-native'
import { useDispatch, useSelector } from 'react-redux'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import path from 'path'

import { difference } from 'lodash'
import RNFS from 'react-native-fs'
import ReactNativeBlobUtil from 'react-native-blob-util'
import RNFS from 'react-native-fs'
import { call, put, select } from 'typed-redux-saga'

import { make, track } from 'app/services/analytics'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CANCEL } from 'redux-saga'
import ReactNativeBlobUtil from 'react-native-blob-util'
import { CANCEL } from 'redux-saga'

// Downloads file from uri to destination, with saga cancellation
export function downloadFile(uri: string, destination: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ function* removeItemFromDisk(
getLocalCollectionDir,
item.id.toString()
)
const exists = yield* call(ReactNativeBlobUtil.fs.exists, collectionDirectory)
const exists = yield* call(
ReactNativeBlobUtil.fs.exists,
collectionDirectory
)
if (exists) {
yield* call(ReactNativeBlobUtil.fs.unlink, collectionDirectory)
}
Expand Down
42 changes: 21 additions & 21 deletions packages/web/src/components/lineup/LineupProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const getLoadMoreTrackCount = (
) =>
Math.ceil(
(innerHeight / totalTileHeight[variant]) *
(typeof multiplier === 'function' ? multiplier() : multiplier)
(typeof multiplier === 'function' ? multiplier() : multiplier)
)

// Call load more when the user is LOAD_MORE_PAGE_THRESHOLD of the view height
Expand Down Expand Up @@ -212,7 +212,7 @@ export interface LineupProviderProps {
rankIconCount?: number

/** Track search result click metrics */
trackSearchResultClick?: (trackId: ID) => void;
trackSearchResultClick?: (trackId: ID) => void
}

interface LineupProviderState {
Expand Down Expand Up @@ -542,7 +542,7 @@ class LineupProvider extends PureComponent<CombinedProps, LineupProviderState> {
isTrending,
showRankIcon: index < rankIconCount,
showFeedTipTile,
trackSearchResultClick,
trackSearchResultClick
}
if (entry.id === leadingElementId) {
trackProps = { ...trackProps, ...leadingElementTileProps }
Expand Down Expand Up @@ -735,29 +735,29 @@ class LineupProvider extends PureComponent<CombinedProps, LineupProviderState> {
{(featuredId: ID | null) =>
featuredId
? (props) => (
<div
className={cn(
styles.featuredContainer,
leadingElementClassName
)}
style={{
height: '100%',
maxHeight: props.maxHeight,
marginBottom: props.marginBottom
}}
>
<div
className={styles.featuredContent}
className={cn(
styles.featuredContainer,
leadingElementClassName
)}
style={{
height: '100%',
opacity: props.opacity,
maxHeight: props.maxHeight
maxHeight: props.maxHeight,
marginBottom: props.marginBottom
}}
>
{allTracks[featuredId]}
<div
className={styles.featuredContent}
style={{
height: '100%',
opacity: props.opacity,
maxHeight: props.maxHeight
}}
>
{allTracks[featuredId]}
</div>
</div>
</div>
)
)
: () => null
}
</Transition>
Expand All @@ -777,7 +777,7 @@ class LineupProvider extends PureComponent<CombinedProps, LineupProviderState> {
<InfiniteScroll
aria-label={this.props['aria-label']}
pageStart={0}
loadMore={lineup.hasMore ? this.loadMore : () => { }}
loadMore={lineup.hasMore ? this.loadMore : () => {}}
hasMore={lineup.hasMore && canLoadMore}
// If we're on mobile, we scroll the entire page so we should use the window
// to calculate scroll position.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const ConnectedTrackTile = ({
isTrending,
isFeed = false,
showRankIcon,
trackSearchResultClick,
trackSearchResultClick
}: ConnectedTrackTileProps) => {
const trackWithFallback = getTrackWithFallback(track)
const {
Expand Down Expand Up @@ -309,10 +309,9 @@ const ConnectedTrackTile = ({
shareTrack(trackId)
}, [shareTrack, trackId])


const onClickTitle = useCallback(() => {
trackSearchResultClick?.(trackId)
}, [trackSearchResultClick])
}, [trackSearchResultClick, trackId])

const openLockedContentModal = useCallback(() => {
dispatch(setLockedContentId({ id: trackId }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { formatCount } from '@audius/common/utils'
import { IconSearch as IconBigSearch } from '@audius/harmony'
import { Redirect } from 'react-router'

import { make } from 'common/store/analytics/actions'
import Card from 'components/card/desktop/Card'
import CategoryHeader from 'components/header/desktop/CategoryHeader'
import Header from 'components/header/desktop/Header'
Expand All @@ -24,7 +25,6 @@ import {
fullSearchResultsPage,
NOT_FOUND_PAGE
} from 'utils/route'
import { make } from 'common/store/analytics/actions'

import styles from './SearchPageContent.module.css'

Expand Down Expand Up @@ -310,7 +310,14 @@ class SearchPageContent extends Component {
)
})
const trackSearchResultClick = (trackId, source) => {
this.props.dispatch(make(Name.SEARCH_RESULT_SELECT, { searchText, kind: 'track', id: trackId, source: source }))
this.props.dispatch(
make(Name.SEARCH_RESULT_SELECT, {
searchText,
kind: 'track',
id: trackId,
source
})
)
}
const foundResults =
artistCards.length > 0 ||
Expand Down Expand Up @@ -363,7 +370,9 @@ class SearchPageContent extends Component {
}}
pauseTrack={() => this.props.dispatch(tracksActions.pause())}
actions={tracksActions}
trackSearchResultClick={(trackId) => { trackSearchResultClick(trackId, 'more results page') }}
trackSearchResultClick={(trackId) => {
trackSearchResultClick(trackId, 'more results page')
}}
/>
</div>
</>
Expand Down Expand Up @@ -451,11 +460,12 @@ class SearchPageContent extends Component {
playTrack={(uid, trackId) => {
trackSearchResultClick(trackId, 'search results page')
this.props.dispatch(tracksActions.play(uid))
}
}
}}
pauseTrack={(uid) => this.props.dispatch(tracksActions.pause())}
actions={tracksActions}
trackSearchResultClick={(trackId) => { trackSearchResultClick(trackId, 'search results page') }}
trackSearchResultClick={(trackId) => {
trackSearchResultClick(trackId, 'search results page')
}}
/>
</div>
) : null}
Expand Down

0 comments on commit 357b2eb

Please sign in to comment.