TagSpaces is an offline, open source, document manager with tagging support
polish: improving paging, fixing Cordova issues
Ilian Sapundshievf1e080f409e8
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsxindex 2afbabf41..6e9850e57 100644--- a/app/components/EntryContainer.tsx+++ b/app/components/EntryContainer.tsx@@ -1079,6 +1079,7 @@ const EntryContainer = (props: Props) => {resizerStyle={{backgroundColor: props.theme.palette.divider}}+ style={{ zIndex: 2000 }}// size={this.state.entryPropertiesSplitSize}// minSize={defaultSplitSize}// maxSize={fullSplitSize}diff --git a/app/containers/MainPage.tsx b/app/containers/MainPage.tsxindex c1d744cc6..306468fb8 100644--- a/app/containers/MainPage.tsx+++ b/app/containers/MainPage.tsx@@ -310,9 +310,17 @@ const MainPage = (props: Props) => {>(window.ExtDefaultVerticalPanel !== 'none' && !props.isEntryInFullWidth); */// const [mainSplitSize, setMainSplitSize] = useState<any>('100%');// const [isDrawerOpened, setDrawerOpened] = useState<boolean>(true);+ const width =+ window.innerWidth ||+ document.documentElement.clientWidth ||+ body.clientWidth;+ const height =+ window.innerHeight ||+ document.documentElement.clientHeight ||+ body.clientHeight;const [dimensions, setDimensions] = useState<any>({- width: 1000,- height: 1000+ width,+ height});useEffect(() => {diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsxindex 7d9246ac7..21b199ccf 100644--- a/app/perspectives/grid-perspective/components/CellContent.tsx+++ b/app/perspectives/grid-perspective/components/CellContent.tsx@@ -42,9 +42,11 @@ const maxDescriptionPreviewLength = 100;interface Props {selected: boolean;+ isLast?: boolean;fsEntry: TS.FileSystemEntry;entrySize: string;classes: any;+ style?: any;theme: any;supportedFileTypes: Array<Object>;thumbnailMode: any;@@ -84,7 +86,8 @@ const CellContent = (props: Props) => {showTags,openFsEntry,selectEntry,- deselectEntry+ deselectEntry,+ isLast} = props;const fsEntryBackgroundColor = fsEntry.color; // ? fsEntry.color : 'transparent';const entryTitle = extractTitle(@@ -413,6 +416,7 @@ const CellContent = (props: Props) => {)}style={{minHeight: layoutType === 'row' ? entryHeight : 'auto',+ marginBottom: isLast ? 40 : 'auto',backgroundColor: theme.palette.background.default}}onContextMenu={event => handleGridContextMenu(event, fsEntry)}diff --git a/app/perspectives/grid-perspective/components/GridPagination.tsx b/app/perspectives/grid-perspective/components/GridPagination.tsxindex e992093f0..2f716b098 100644--- a/app/perspectives/grid-perspective/components/GridPagination.tsx+++ b/app/perspectives/grid-perspective/components/GridPagination.tsx@@ -37,7 +37,7 @@ interface Props {directories: Array<TS.FileSystemEntry>;showDirectories: boolean;files: Array<TS.FileSystemEntry>;- renderCell: (entry: TS.FileSystemEntry) => void;+ renderCell: (entry: TS.FileSystemEntry, isLast?: boolean) => void;currentDirectoryColor: string;isAppLoading: boolean;currentPage: number;@@ -89,74 +89,71 @@ const GridPagination = (props: Props) => {return (<div+ onContextMenu={(e: React.MouseEvent<HTMLDivElement>) =>+ props.onContextMenu(e)+ }style={{height: '100%',- backgroundColor: theme.palette.background.default+ // @ts-ignore+ overflowY: AppConfig.isFirefox ? 'auto' : 'overlay',+ backgroundColor: currentDirectoryColor || 'transparent'}}><div- onContextMenu={(e: React.MouseEvent<HTMLDivElement>) =>- props.onContextMenu(e)- }- style={{- height: '100%',- // @ts-ignore- overflowY: AppConfig.isFirefox ? 'auto' : 'overlay',- backgroundColor: currentDirectoryColor || 'transparent'- }}- >- <div- className={className}- style={style}- /* ref={ref => {+ className={className}+ style={style}+ /* ref={ref => {gridRef = ref;}} */- data-tid="perspectiveGridFileTable"- >- {page === 1 && directories.map(entry => renderCell(entry))}- {files.map(entry => renderCell(entry))}- {isAppLoading && (- <Typography- style={{ padding: 15, color: theme.palette.text.primary }}- >- {i18n.t('core:loading')}- </Typography>- )}- {!isAppLoading && files.length < 1 && directories.length < 1 && (+ data-tid="perspectiveGridFileTable"+ >+ {page === 1 && directories.map(entry => renderCell(entry))}+ {files.map((entry, index, dArray) =>+ renderCell(entry, index === dArray.length - 1)+ )}+ {isAppLoading && (+ <Typography+ style={{ padding: 15, color: theme.palette.text.primary }}+ >+ {i18n.t('core:loading')}+ </Typography>+ )}+ {!isAppLoading && files.length < 1 && directories.length < 1 && (+ <Typography+ style={{ padding: 15, color: theme.palette.text.primary }}+ >+ {i18n.t('core:noFileFolderFound')}+ </Typography>+ )}+ {!isAppLoading &&+ files.length < 1 &&+ directories.length >= 1 &&+ !showDirectories && (<Typographystyle={{ padding: 15, color: theme.palette.text.primary }}>- {i18n.t('core:noFileFolderFound')}+ {i18n.t('core:noFileButFoldersFound')}</Typography>)}- {!isAppLoading &&- files.length < 1 &&- directories.length >= 1 &&- !showDirectories && (- <Typography- style={{ padding: 15, color: theme.palette.text.primary }}- >- {i18n.t('core:noFileButFoldersFound')}- </Typography>- )}- </div>- {showPagination && (- <p- style={{- display: 'flex',- justifyContent: 'center',- alignItems: 'center',- marginBottom: 2- }}- >- <Pagination- count={paginationCount}- page={page}- onChange={handleChange}- />- </p>- )}</div>+ {showPagination && (+ <Pagination+ style={{+ left: 30,+ bottom: 30,+ zIndex: 1100,+ position: 'absolute',+ backgroundColor: theme.palette.background.default,+ opacity: 0.97,+ border: '1px solid lightgray',+ borderRadius: 5,+ padding: 3+ }}+ count={paginationCount}+ page={page}+ onChange={handleChange}+ />+ )}</div>);};diff --git a/app/perspectives/grid-perspective/components/MainContainer.tsx b/app/perspectives/grid-perspective/components/MainContainer.tsxindex 9fd6276de..be0e056a0 100644--- a/app/perspectives/grid-perspective/components/MainContainer.tsx+++ b/app/perspectives/grid-perspective/components/MainContainer.tsx@@ -559,7 +559,7 @@ const GridPerspective = (props: Props) => {}};- const renderCell = (fsEntry: TS.FileSystemEntry) => {+ const renderCell = (fsEntry: TS.FileSystemEntry, isLast?: boolean) => {const {classes,theme,@@ -595,6 +595,7 @@ const GridPerspective = (props: Props) => {fsEntry={fsEntry}entrySize={entrySize}classes={classes}+ isLast={isLast}theme={theme}supportedFileTypes={supportedFileTypes}thumbnailMode={thumbnailMode}@@ -718,10 +719,7 @@ const GridPerspective = (props: Props) => {return (<divstyle={{- height:- 'calc(100% - ' +- (AppConfig.isCordova ? '320' : '51') + // todo handle cordova screen sizes- 'px)'+ height: 'calc(100% - 51px)'}}><MainToolbar@@ -755,6 +753,7 @@ const GridPerspective = (props: Props) => {layoutType === 'grid' ? classes.gridContainer : classes.rowContainer}style={{+ height: '100%',marginTop: 53,gridTemplateColumns:layoutType === 'grid'@@ -806,7 +805,6 @@ const GridPerspective = (props: Props) => {selectedFiles={selectedFilePaths}/>)}-{Boolean(fileContextMenuAnchorEl) && (<FileMenuanchorEl={fileContextMenuAnchorEl}