-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
61927c4
commit 4059fe8
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { ID } from '@audius/common' | ||
import { cacheCollectionsSelectors } from '@audius/common' | ||
import { useSelector } from 'react-redux' | ||
|
||
import { DogEar, DogEarType } from '../core' | ||
|
||
const { getCollection } = cacheCollectionsSelectors | ||
|
||
type CollectionDogEarProps = { | ||
collectionId: ID | ||
} | ||
|
||
export const CollectionDogEar = (props: CollectionDogEarProps) => { | ||
const { collectionId } = props | ||
|
||
const isPrivate = useSelector( | ||
(state) => getCollection(state, { id: collectionId })?.is_private | ||
) | ||
|
||
const dogEarType = isPrivate ? DogEarType.HIDDEN : null | ||
|
||
if (dogEarType) { | ||
return <DogEar type={dogEarType} /> | ||
} | ||
|
||
return null | ||
} |