Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar show type #590

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions public/show_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/show_placeholder_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions public/svg-icons/DefaultShowIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 22 additions & 2 deletions src/components/App/SideBar/Relevance/Episode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ export const Episode = ({
const selectedTimestamp = useDataStore((s) => s.selectedTimestamp)
const isSelected = !!(selectedTimestamp && selectedTimestamp.id === id)

const description = type === 'show' ? showTitle : episodeTitle;
const subtitle = type === 'show' ? '' : showTitle;

return (
<EpisodeWrapper className={className} isSelected={isSelected} onClick={onClick}>
{type !== 'tweet' && type !== 'person' && type !== 'guest' && (
<Flex direction="row">
{!isSelectedView && (
<Flex align="center" pr={16}>
<Avatar size={64} src={imageUrl} type={type || ''} />
<Avatar size={64} src={imageUrl} type={type || ''} />
</Flex>
)}

Expand All @@ -102,10 +106,10 @@ export const Episode = ({
) : null}
</Flex>

<Description data-testid="episode-description">{episodeTitle}</Description>
<Description data-testid="episode-description">{description}</Description>
<Flex align="center" direction="row" justify="flex-start">
{Boolean(date) && <Date>{moment.unix(date).fromNow()}</Date>}
{Boolean(showTitle) && <Title>{showTitle}</Title>}
{Boolean(subtitle) && <Title>{subtitle}</Title>}
{!isSelectedView && boostCount > 0 && (
<Flex style={{ marginLeft: 'auto' }}>
<BoostAmt amt={boostCount} />
Expand Down Expand Up @@ -180,6 +184,22 @@ export const Title = styled(Date)`
flex-shrink: 0;
height: 4px;
background: ${colors.GRAY6};

margin-top: 20px;

}

&.is-show {
margin: 20px 0px;
padding: 0px;
color: var(--Primary-Text, #FFF);
leading-trim: both;
text-edge: cap;
font-family: Barlow;
font-size: 13px;
font-style: normal;
font-weight: 500;
line-height: 17px; /* 130.769% */
}
`

Expand Down
2 changes: 1 addition & 1 deletion src/components/App/SideBar/Relevance/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button } from '@mui/material'
import { useCallback, useMemo, useRef, useState } from 'react'
import styled from 'styled-components'
import { Flex } from '~/components/common/Flex'
import { ScrollView } from '~/components/ScrollView'
import { Flex } from '~/components/common/Flex'
import { useAppStore } from '~/stores/useAppStore'
import { useDataStore, useFilteredNodes } from '~/stores/useDataStore'
import { NodeExtended } from '~/types'
Expand Down
23 changes: 23 additions & 0 deletions src/components/Icons/DefaultShowIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable */
import React from 'react'

const DefaultShowIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="1em" height="1em" viewBox="0 0 34 34" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_2777_4506" maskUnits="userSpaceOnUse" x="0" y="0" width="34" height="34">
<rect width="1em" height="1em" fill="currentColor" />
</mask>
<g mask="url(#mask0_2777_4506)">
<mask id="mask1_2777_4506" maskUnits="userSpaceOnUse" x="0" y="0" width="34" height="34">
<rect width="1em" height="1em" fill="currentColor" />
</mask>
<g mask="url(#mask1_2777_4506)">
<path
d="M8.25212 29.988L10.5542 20.0359L2.83337 13.3421L13.0334 12.4567L17 3.07129L20.9667 12.4567L31.1667 13.3421L23.4459 20.0359L25.748 29.988L17 24.7109L8.25212 29.988Z"
fill="currentColor"
/>
</g>
</g>
</svg>
)

export default DefaultShowIcon
1 change: 1 addition & 0 deletions src/components/common/Avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const TypesMapper: TTypeMapper = {
person: 'person',
guest: 'person',
twitter_space: 'audio',
show: 'show'
}

export const Avatar = styled.div<Props>`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TypeBadge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type EpisodeTypeImage = {
const EpisodeTypeImages: EpisodeTypeImage = {
podcast: { img: 'audio_badge.svg', label: 'podcast' },
clip: { img: 'audio_badge.svg', label: 'clip' },
show: { img: 'audio_badge.svg', label: 'show' },
show: { img: 'show_badge.svg', label: 'show' },
tweet: { img: 'twitter_badge.svg', label: 'tweet' },
twitter_space: { img: 'audio_badge.svg', label: 'clip' },
youtube: { img: 'video_badge.svg', label: 'clip' },
Expand Down
Loading