Display movie title for interactive search modal

pull/10296/head
Bogdan 3 months ago
parent 1efe7db5f3
commit 7d5236de21

@ -286,10 +286,10 @@ class MovieDetails extends Component {
const fanartUrl = getFanartUrl(images);
const marqueeWidth = isSmallScreen ? titleWidth : (titleWidth - 150);
const pageTitle = `${title}${year > 0 ? ` (${year})` : ''}`;
const titleWithYear = `${title}${year > 0 ? ` (${year})` : ''}`;
return (
<PageContent title={pageTitle}>
<PageContent title={titleWithYear}>
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
@ -737,6 +737,7 @@ class MovieDetails extends Component {
<MovieInteractiveSearchModalConnector
isOpen={isInteractiveSearchModalOpen}
movieId={id}
movieTitle={title}
onModalClose={this.onInteractiveSearchModalClose}
/>
</PageContentBody>

@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React from 'react';
import Button from 'Components/Link/Button';
import ModalBody from 'Components/Modal/ModalBody';
@ -9,41 +8,36 @@ import { scrollDirections } from 'Helpers/Props';
import InteractiveSearchConnector from 'InteractiveSearch/InteractiveSearchConnector';
import translate from 'Utilities/String/translate';
function MovieInteractiveSearchModalContent(props) {
const {
movieId,
movieTitle,
onModalClose
} = props;
interface MovieInteractiveSearchModalContentProps {
movieId: number;
movieTitle?: string;
onModalClose(): void;
}
function MovieInteractiveSearchModalContent(
props: MovieInteractiveSearchModalContentProps
) {
const { movieId, movieTitle, onModalClose } = props;
return (
<ModalContent onModalClose={onModalClose}>
<ModalHeader>
{movieTitle === undefined ?
translate('InteractiveSearchModalHeader') :
translate('InteractiveSearchModalHeaderTitle', { title: movieTitle })
}
{movieTitle
? translate('InteractiveSearchModalHeaderTitle', {
title: movieTitle,
})
: translate('InteractiveSearchModalHeader')}
</ModalHeader>
<ModalBody scrollDirection={scrollDirections.BOTH}>
<InteractiveSearchConnector
searchPayload={{ movieId }}
/>
<InteractiveSearchConnector searchPayload={{ movieId }} />
</ModalBody>
<ModalFooter>
<Button onPress={onModalClose}>
{translate('Close')}
</Button>
<Button onPress={onModalClose}>{translate('Close')}</Button>
</ModalFooter>
</ModalContent>
);
}
MovieInteractiveSearchModalContent.propTypes = {
movieId: PropTypes.number.isRequired,
movieTitle: PropTypes.string,
onModalClose: PropTypes.func.isRequired
};
export default MovieInteractiveSearchModalContent;
Loading…
Cancel
Save