Skip to content

Commit

Permalink
Merge pull request #1692 from MahtabBukhari/If_node_has_no_image_url_…
Browse files Browse the repository at this point in the history
…then_dont_display_image_icon

If node has no image_url then do not display image icon
  • Loading branch information
Rassl authored Jun 25, 2024
2 parents 9ebec67 + 4ae53ff commit 0c6dca2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/components/App/SideBar/Relevance/Episode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ export const Episode = ({

const defaultViewTypes = ['tweet', 'person', 'guest', 'topic', 'document']

const imageType = type === 'video' ? 'video' : 'audio'

return type ? (
<EpisodeWrapper className={className} onClick={onClick}>
{!defaultViewTypes.includes(type) ? (
<Flex align="center" direction="row" justify="center">
{!isSelectedView && (
{!isSelectedView && imageUrl && (
<Flex align="center" pr={16}>
<Avatar size={80} src={imageUrl || `${imageType}_default.svg`} type={type || ''} />
<Avatar size={80} src={imageUrl} type={type || ''} />
</Flex>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export const Tooltip = ({ node }: Props) => {

if (nodeType === 'guest' && !imageUrl) {
displayImageUrl = 'person_placeholder2.png'
} else if (!imageUrl) {
displayImageUrl = 'noimage.jpeg'
}

if (type === 'twitter_space') {
Expand All @@ -78,16 +76,18 @@ export const Tooltip = ({ node }: Props) => {
) : (
<>
<Flex direction="row">
<Divider />
{displayImageUrl && <Divider />}
<Flex align="flex-start" pb={12}>
<Text>{nodeType?.toUpperCase()}</Text>
</Flex>
</Flex>

<Flex direction="row">
<Flex pr={12}>
<Avatar src={displayImageUrl as string} type="person" />
</Flex>
{displayImageUrl && (
<Flex pr={12}>
<Avatar src={displayImageUrl as string} type="person" />
</Flex>
)}

<div>
{(name || label) && (
Expand Down

0 comments on commit 0c6dca2

Please sign in to comment.