Fix Youtube and empty state in PartyFooter
* Fixed Youtube embed styles * Added empty state for description tab
This commit is contained in:
parent
8bde311a6d
commit
15449feff4
2 changed files with 28 additions and 16 deletions
|
|
@ -32,7 +32,8 @@
|
|||
padding: 0 $unit;
|
||||
}
|
||||
|
||||
.noRemixes {
|
||||
.noRemixes,
|
||||
.noDescription {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -47,10 +48,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: $font-regular;
|
||||
line-height: $font-regular * 1.2;
|
||||
|
|
@ -65,7 +62,7 @@
|
|||
margin-bottom: $unit-2x;
|
||||
}
|
||||
|
||||
.YoutubeWrapper {
|
||||
.youtube {
|
||||
background-color: var(--card-bg);
|
||||
border-radius: $card-corner;
|
||||
margin: $unit 0;
|
||||
|
|
@ -120,7 +117,7 @@
|
|||
}
|
||||
|
||||
/* Play button */
|
||||
& > .PlayerButton {
|
||||
& > .playerButton {
|
||||
background: none;
|
||||
border: none;
|
||||
background-image: url('/icons/youtube.svg');
|
||||
|
|
@ -130,8 +127,8 @@
|
|||
transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
& > .PlayerButton,
|
||||
& > .PlayerButton:before {
|
||||
& > .playerButton,
|
||||
& > .playerButton:before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
|
|
@ -143,7 +140,7 @@
|
|||
cursor: unset;
|
||||
}
|
||||
&.lyt-activated::before,
|
||||
&.lyt-activated > .PlayerButton {
|
||||
&.lyt-activated > .playerButton {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { youtube } from '~utils/youtube'
|
|||
import type { DetailsObject } from 'types'
|
||||
|
||||
import RemixIcon from '~public/icons/Remix.svg'
|
||||
import EditIcon from '~public/icons/Edit.svg'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
// Props
|
||||
|
|
@ -41,9 +42,10 @@ const PartyFooter = (props: Props) => {
|
|||
const youtubeUrlRegex =
|
||||
/(?:https:\/\/www\.youtube\.com\/watch\?v=|https:\/\/youtu\.be\/)([\w-]+)/g
|
||||
|
||||
const [open, setOpen] = useState(false)
|
||||
// State: UI
|
||||
const [currentSegment, setCurrentSegment] = useState(0)
|
||||
|
||||
// State: Data
|
||||
const [remixes, setRemixes] = useState<Party[]>([])
|
||||
const [embeddedDescription, setEmbeddedDescription] =
|
||||
useState<React.ReactNode>()
|
||||
|
|
@ -67,8 +69,8 @@ const PartyFooter = (props: Props) => {
|
|||
key={`${match}-${i}`}
|
||||
id={match}
|
||||
title={videoTitles[i]}
|
||||
wrapperClass="YoutubeWrapper"
|
||||
playerClass="PlayerButton"
|
||||
wrapperClass={styles.youtube}
|
||||
playerClass={styles.playerButton}
|
||||
/>
|
||||
)
|
||||
)
|
||||
|
|
@ -168,14 +170,27 @@ const PartyFooter = (props: Props) => {
|
|||
selected={currentSegment === 1}
|
||||
onClick={() => setCurrentSegment(1)}
|
||||
>
|
||||
{t('footer.remixes.label')}
|
||||
{t('footer.remixes.label', { count: party?.remixes?.length })}
|
||||
</Segment>
|
||||
</SegmentedControl>
|
||||
)
|
||||
|
||||
const descriptionSection = (
|
||||
<section className={styles.description}>
|
||||
<Linkify>{embeddedDescription}</Linkify>
|
||||
{party && party.description && party.description.length > 0 && (
|
||||
<Linkify>{embeddedDescription}</Linkify>
|
||||
)}
|
||||
{(!party || !party.description) && (
|
||||
<div className={styles.noDescription}>
|
||||
<h3>{t('footer.description.empty')}</h3>
|
||||
{props.editable && (
|
||||
<Button
|
||||
leftAccessoryIcon={<EditIcon />}
|
||||
text={t('buttons.show_info')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
|
||||
|
|
@ -194,7 +209,7 @@ const PartyFooter = (props: Props) => {
|
|||
)
|
||||
|
||||
function renderRemixes() {
|
||||
return remixes.map((party, i) => {
|
||||
return party?.remixes.map((party, i) => {
|
||||
return (
|
||||
<GridRep
|
||||
id={party.id}
|
||||
|
|
|
|||
Loading…
Reference in a new issue