|
|
@ -15,13 +15,40 @@ import ModalContent from 'Components/Modal/ModalContent';
|
|
|
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
|
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
|
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
|
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
|
|
import Scroller from 'Components/Scroller/Scroller';
|
|
|
|
import Scroller from 'Components/Scroller/Scroller';
|
|
|
|
|
|
|
|
import Column from 'Components/Table/Column';
|
|
|
|
|
|
|
|
import VirtualTableRowButton from 'Components/Table/VirtualTableRowButton';
|
|
|
|
import { scrollDirections } from 'Helpers/Props';
|
|
|
|
import { scrollDirections } from 'Helpers/Props';
|
|
|
|
import Movie from 'Movie/Movie';
|
|
|
|
import Movie from 'Movie/Movie';
|
|
|
|
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
|
|
|
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
|
|
|
import dimensions from 'Styles/Variables/dimensions';
|
|
|
|
import dimensions from 'Styles/Variables/dimensions';
|
|
|
|
|
|
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
|
|
|
|
import SelectMovieModalTableHeader from './SelectMovieModalTableHeader';
|
|
|
|
import SelectMovieRow from './SelectMovieRow';
|
|
|
|
import SelectMovieRow from './SelectMovieRow';
|
|
|
|
import styles from './SelectMovieModalContent.css';
|
|
|
|
import styles from './SelectMovieModalContent.css';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'title',
|
|
|
|
|
|
|
|
label: translate('Title'),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'year',
|
|
|
|
|
|
|
|
label: translate('Year'),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'imdbId',
|
|
|
|
|
|
|
|
label: translate('ImdbId'),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'tmdbId',
|
|
|
|
|
|
|
|
label: translate('TmdbId'),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const bodyPadding = parseInt(dimensions.pageContentBodyPadding);
|
|
|
|
const bodyPadding = parseInt(dimensions.pageContentBodyPadding);
|
|
|
|
|
|
|
|
|
|
|
|
interface SelectMovieModalContentProps {
|
|
|
|
interface SelectMovieModalContentProps {
|
|
|
@ -32,6 +59,7 @@ interface SelectMovieModalContentProps {
|
|
|
|
|
|
|
|
|
|
|
|
interface RowItemData {
|
|
|
|
interface RowItemData {
|
|
|
|
items: Movie[];
|
|
|
|
items: Movie[];
|
|
|
|
|
|
|
|
columns: Column[];
|
|
|
|
onMovieSelect(movieId: number): void;
|
|
|
|
onMovieSelect(movieId: number): void;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +68,7 @@ const Row: React.FC<ListChildComponentProps<RowItemData>> = ({
|
|
|
|
style,
|
|
|
|
style,
|
|
|
|
data,
|
|
|
|
data,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
const { items, onMovieSelect } = data;
|
|
|
|
const { items, columns, onMovieSelect } = data;
|
|
|
|
|
|
|
|
|
|
|
|
if (index >= items.length) {
|
|
|
|
if (index >= items.length) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -49,20 +77,24 @@ const Row: React.FC<ListChildComponentProps<RowItemData>> = ({
|
|
|
|
const movie = items[index];
|
|
|
|
const movie = items[index];
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
<VirtualTableRowButton
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
display: 'flex',
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
...style,
|
|
|
|
...style,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
|
|
|
|
onPress={() => onMovieSelect(movie.id)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<SelectMovieRow
|
|
|
|
<SelectMovieRow
|
|
|
|
id={movie.id}
|
|
|
|
id={movie.id}
|
|
|
|
title={movie.title}
|
|
|
|
title={movie.title}
|
|
|
|
|
|
|
|
tmdbId={movie.tmdbId}
|
|
|
|
|
|
|
|
imdbId={movie.imdbId}
|
|
|
|
year={movie.year}
|
|
|
|
year={movie.year}
|
|
|
|
|
|
|
|
columns={columns}
|
|
|
|
onMovieSelect={onMovieSelect}
|
|
|
|
onMovieSelect={onMovieSelect}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</VirtualTableRowButton>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -161,6 +193,7 @@ function SelectMovieModalContent(props: SelectMovieModalContentProps) {
|
|
|
|
autoFocus={false}
|
|
|
|
autoFocus={false}
|
|
|
|
ref={scrollerRef}
|
|
|
|
ref={scrollerRef}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<SelectMovieModalTableHeader columns={columns} />
|
|
|
|
<List<RowItemData>
|
|
|
|
<List<RowItemData>
|
|
|
|
ref={listRef}
|
|
|
|
ref={listRef}
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
@ -174,6 +207,7 @@ function SelectMovieModalContent(props: SelectMovieModalContentProps) {
|
|
|
|
itemSize={38}
|
|
|
|
itemSize={38}
|
|
|
|
itemData={{
|
|
|
|
itemData={{
|
|
|
|
items,
|
|
|
|
items,
|
|
|
|
|
|
|
|
columns,
|
|
|
|
onMovieSelect: onMovieSelectWrapper,
|
|
|
|
onMovieSelect: onMovieSelectWrapper,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|