diff --git a/src/components/marker/timeline-preview.tsx b/src/components/marker/timeline-preview.tsx index b5c8b25..7a954ba 100644 --- a/src/components/marker/timeline-preview.tsx +++ b/src/components/marker/timeline-preview.tsx @@ -94,18 +94,17 @@ interface TitleProps { children?: VNode | string; iconName: string; shouldDisplayTitle: boolean; - className: string; ariaLabel?: string; } -const Title = ({iconName, children, shouldDisplayTitle = true, className, ariaLabel = ''}: TitleProps) => { - let additionalProps: any = {}; +const Title = ({iconName, children, shouldDisplayTitle = true, ariaLabel = ''}: TitleProps) => { + let titleWrapperProps: any = { className: styles.titleWrapper }; if (ariaLabel) { - additionalProps.ariaLabel = ariaLabel; + titleWrapperProps.ariaLabel = ariaLabel; } return ( -
+
{shouldDisplayTitle && {children}}
@@ -185,7 +184,7 @@ export class TimelinePreview extends Component { if (!this.props.cuePointsData.length && relevantChapter?.title) { // not a marker - render only chapter return ( - + <Title iconName={'chapter'} shouldDisplayTitle > {relevantChapter.title} ); @@ -193,17 +192,17 @@ export class TimelinePreview extends Component { return ( {hotspots.length > 0 && ( - + <Title iconName={'hotspot'} shouldDisplayTitle ariaLabel={this.props.hotspotTitleAriaLabelTranslate!}> {this.props.hotspotTranslate!} )} {quizQuestions.length > 0 && ( - + <Title iconName={'quiz'} shouldDisplayTitle > {(<span>{`${quizQuestionTitle.type} ${quizQuestionTitle.firstIndex}${quizQuestionTitle.lastIndex}`}</span>) as VNode} )} {answerOnAir.length > 0 && ( - + <Title iconName={'answerOnAir'} shouldDisplayTitle > {this.props.aoaTranslate!} )} @@ -232,13 +231,13 @@ export class TimelinePreview extends Component { const renderItems = () => { if (relevantChapter && this.props.cuePointsData.length === 0) { - return relevantChapter.isDummy ? null : ; + return relevantChapter.isDummy ? null : <Title iconName={'chapter'} shouldDisplayTitle={false} />; } return ( <Fragment> - {hotspots.length > 0 && <Title iconName={'hotspot'} shouldDisplayTitle={false} className={styles.titleWrapper} />} - {quizQuestions.length > 0 && <Title iconName={'quiz'} shouldDisplayTitle={false} className={styles.titleWrapper} />} - {answerOnAir.length > 0 && <Title iconName={'answerOnAir'} shouldDisplayTitle={false} className={styles.titleWrapper} />} + {hotspots.length > 0 && <Title iconName={'hotspot'} shouldDisplayTitle={false} />} + {quizQuestions.length > 0 && <Title iconName={'quiz'} shouldDisplayTitle={false} />} + {answerOnAir.length > 0 && <Title iconName={'answerOnAir'} shouldDisplayTitle={false} />} </Fragment> ); };