Display movie title for interactive search modal

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

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

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