Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: small ui issues

Ilian Sapundshiev033d0843a295
diff --git a/app/components/TagContainer.tsx b/app/components/TagContainer.tsx
index ef5294958..2cb539912 100644
--- a/app/components/TagContainer.tsx
+++ b/app/components/TagContainer.tsx
@@ -23,6 +23,7 @@ import MoreVertIcon from '@mui/icons-material/MoreVert';
import PlaceIcon from '@mui/icons-material/Place';
import DateIcon from '@mui/icons-material/DateRange';
import RemoveTagIcon from '@mui/icons-material/Close';
+import Tooltip from '-/components/Tooltip';
import { formatDateTime } from '@tagspaces/tagspaces-platforms/misc';
import { getAllTags, getTagColors } from '-/reducers/taglibrary';
import { getTagColor, getTagTextColor } from '-/reducers/settings';
@@ -194,52 +195,53 @@ function TagContainer(props: Props) {
display: 'inline-block'
}}
>
- <Button
- title={tagTitle}
- size="small"
- style={{
- opacity: isDragging ? 0.5 : 1,
- fontSize: 13,
- textTransform: 'none',
- color: textColor,
- backgroundColor,
- minHeight: 0,
- minWidth: 0,
- margin: 2,
- paddingTop: 0,
- paddingBottom: 0,
- paddingRight: 0,
- paddingLeft: 5,
- borderRadius: 5
- }}
- >
- <span style={{ flexGrow: 1 }}>
- {(isTagGeo || isGeoSmartTag) && (
- <PlaceIcon
- style={{
- color: tag.textcolor,
- height: 20,
- marginBottom: -5,
- marginLeft: -5,
- marginRight: 0
- }}
- />
- )}
- {(isTagDate || isDateSmartTag) && (
- <DateIcon
- style={{
- color: tag.textcolor,
- height: 20,
- marginBottom: -5,
- marginLeft: -5,
- marginRight: 0
- }}
- />
- )}
- {!isTagGeo && title}
- </span>
- {getActionMenu()}
- </Button>
+ <Tooltip title={tagTitle}>
+ <Button
+ size="small"
+ style={{
+ opacity: isDragging ? 0.5 : 1,
+ fontSize: 13,
+ textTransform: 'none',
+ color: textColor,
+ backgroundColor,
+ minHeight: 0,
+ minWidth: 0,
+ margin: 2,
+ paddingTop: 0,
+ paddingBottom: 0,
+ paddingRight: 0,
+ paddingLeft: 5,
+ borderRadius: 5
+ }}
+ >
+ <span style={{ flexGrow: 1 }}>
+ {(isTagGeo || isGeoSmartTag) && (
+ <PlaceIcon
+ style={{
+ color: tag.textcolor,
+ height: 20,
+ marginBottom: -5,
+ marginLeft: -5,
+ marginRight: 0
+ }}
+ />
+ )}
+ {(isTagDate || isDateSmartTag) && (
+ <DateIcon
+ style={{
+ color: tag.textcolor,
+ height: 20,
+ marginBottom: -5,
+ marginLeft: -5,
+ marginRight: 0
+ }}
+ />
+ )}
+ {!isTagGeo && title}
+ </span>
+ {getActionMenu()}
+ </Button>
+ </Tooltip>
</div>
);
}
diff --git a/app/perspectives/grid-perspective/components/GridPagination.tsx b/app/perspectives/grid-perspective/components/GridPagination.tsx
index d981b9224..413ac2003 100644
--- a/app/perspectives/grid-perspective/components/GridPagination.tsx
+++ b/app/perspectives/grid-perspective/components/GridPagination.tsx
@@ -309,167 +309,171 @@ function GridPagination(props: Props) {
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions,jsx-a11y/no-static-element-interactions
<div
- ref={containerEl}
- onContextMenu={(event: React.MouseEvent<HTMLDivElement>) =>
- props.onContextMenu(event)
- }
- onClick={(event: React.MouseEvent<HTMLDivElement>) =>
- props.onClick(event)
- }
style={{
height: '100%',
- // @ts-ignore
- overflowY: AppConfig.isFirefox ? 'auto' : 'overlay',
- backgroundImage: `url(${folderBgndPath}?${new Date().getTime()})`,
- backgroundColor: `${dirColor}`,
- backgroundSize: 'cover',
- backgroundRepeat: 'no-repeat'
- /*background:
- 'linear-gradient(62deg, rgb(65, 88, 208) 0%, rgb(200, 80, 192) 46%, rgb(255, 204, 112) 100%)',*/
+ background: `${dirColor}`
}}
>
- {showDetails && (
- <>
- <div
- style={{
- position: 'relative',
- height: 150
- }}
- >
- <img
- alt="thumbnail"
- src={folderTmbPath}
- // @ts-ignore
- onError={i => (i.target.style.display = 'none')}
- loading="lazy"
+ <div
+ ref={containerEl}
+ onContextMenu={(event: React.MouseEvent<HTMLDivElement>) =>
+ props.onContextMenu(event)
+ }
+ onClick={(event: React.MouseEvent<HTMLDivElement>) =>
+ props.onClick(event)
+ }
+ style={{
+ height: '100%',
+ // @ts-ignore
+ overflowY: AppConfig.isFirefox ? 'auto' : 'overlay',
+ backgroundImage: `url(${folderBgndPath}?${new Date().getTime()})`,
+ backgroundSize: 'cover',
+ backgroundRepeat: 'no-repeat'
+ }}
+ >
+ {showDetails && (
+ <>
+ <div
style={{
- objectFit: 'contain',
- position: 'absolute',
- width: '100%',
+ position: 'relative',
height: 150
}}
- />
- <EntryIcon isFile={false} />
- </div>
- <Typography
- style={{
- display: 'block',
- padding: 10,
- paddingTop: 55,
- borderRadius: 5,
- marginBottom: 5,
- height: 50,
- overflow: 'auto',
- textShadow: '1px 1px #8f8f8f',
- color: theme.palette.text.primary
- }}
- role="button"
- id="descriptionArea"
- >
- {folderName}
- </Typography>
- {(directories.length > 0 || pageFiles.length > 0) && (
- <div style={{ padding: 15, bottom: 10 }}>
- <Typography
+ >
+ <img
+ alt="thumbnail"
+ src={folderTmbPath}
+ // @ts-ignore
+ onError={i => (i.target.style.display = 'none')}
+ loading="lazy"
style={{
- fontSize: '0.9rem',
- color: theme.palette.text.secondary,
- textShadow: '1px 1px #8f8f8f'
+ objectFit: 'contain',
+ position: 'absolute',
+ width: '100%',
+ height: 150
}}
- >
- {directories.length +
- ' folder(s) and ' +
- allFilesCount +
- ' file(s) found'}
- </Typography>
+ />
+ <EntryIcon isFile={false} />
</div>
- )}
- </>
- )}
- <TagsPreview tags={currentDirectoryTags} />
- <div
- className={className}
- style={style}
- data-tid="perspectiveGridFileTable"
- >
- {page.current === 1 && directories.map(entry => renderCell(entry))}
- {pageFiles.map((entry, index, dArray) =>
- renderCell(entry, index === dArray.length - 1)
- )}
- {!isAppLoading && pageFiles.length < 1 && directories.length < 1 && (
- <div style={{ textAlign: 'center' }}>
- <EntryIcon isFile={false} />
<Typography
- style={{ padding: 15, color: theme.palette.text.secondary }}
+ style={{
+ display: 'block',
+ padding: 10,
+ paddingTop: 55,
+ borderRadius: 5,
+ marginBottom: 5,
+ height: 50,
+ overflow: 'auto',
+ textShadow: '1px 1px #8f8f8f',
+ color: theme.palette.text.primary
+ }}
+ role="button"
+ id="descriptionArea"
>
- {i18n.t('core:noFileFolderFound')}
- </Typography>
- <Typography style={{ color: theme.palette.text.secondary }}>
- {i18n.t('core:dragAndDropToImport')}
+ {folderName}
</Typography>
- </div>
+ {(directories.length > 0 || pageFiles.length > 0) && (
+ <div style={{ padding: 15, bottom: 10 }}>
+ <Typography
+ style={{
+ fontSize: '0.9rem',
+ color: theme.palette.text.secondary,
+ textShadow: '1px 1px #8f8f8f'
+ }}
+ >
+ {directories.length +
+ ' folder(s) and ' +
+ allFilesCount +
+ ' file(s) found'}
+ </Typography>
+ </div>
+ )}
+ </>
)}
- {!isAppLoading &&
- pageFiles.length < 1 &&
- directories.length >= 1 &&
- !showDirectories && (
+ <TagsPreview tags={currentDirectoryTags} />
+ <div
+ className={className}
+ style={style}
+ data-tid="perspectiveGridFileTable"
+ >
+ {page.current === 1 && directories.map(entry => renderCell(entry))}
+ {pageFiles.map((entry, index, dArray) =>
+ renderCell(entry, index === dArray.length - 1)
+ )}
+ {!isAppLoading && pageFiles.length < 1 && directories.length < 1 && (
<div style={{ textAlign: 'center' }}>
<EntryIcon isFile={false} />
<Typography
style={{ padding: 15, color: theme.palette.text.secondary }}
>
- {i18n.t('core:noFileButFoldersFound')}
+ {i18n.t('core:noFileFolderFound')}
</Typography>
<Typography style={{ color: theme.palette.text.secondary }}>
{i18n.t('core:dragAndDropToImport')}
</Typography>
</div>
)}
- </div>
- {showPagination && (
- <Tooltip
- title={
- directories.length +
- ' folder(s) and ' +
- allFilesCount +
- ' file(s) found'
- }
- >
- <Pagination
- style={{
- left: 15,
- bottom: 65,
- zIndex: 1100,
- position: 'absolute',
- backgroundColor: theme.palette.background.default,
- opacity: 0.97,
- border: '1px solid lightgray',
- borderRadius: 5,
- padding: 3
- }}
- count={paginationCount}
- page={page.current}
- onChange={handleChange}
- />
- </Tooltip>
- )}
- {!showDetails &&
- !showPagination &&
- (directories.length > 0 || pageFiles.length > 0) && (
- <div style={{ padding: 15, bottom: 10 }}>
- <Typography
+ {!isAppLoading &&
+ pageFiles.length < 1 &&
+ directories.length >= 1 &&
+ !showDirectories && (
+ <div style={{ textAlign: 'center' }}>
+ <EntryIcon isFile={false} />
+ <Typography
+ style={{ padding: 15, color: theme.palette.text.secondary }}
+ >
+ {i18n.t('core:noFileButFoldersFound')}
+ </Typography>
+ <Typography style={{ color: theme.palette.text.secondary }}>
+ {i18n.t('core:dragAndDropToImport')}
+ </Typography>
+ </div>
+ )}
+ </div>
+ {showPagination && (
+ <Tooltip
+ title={
+ directories.length +
+ ' folder(s) and ' +
+ allFilesCount +
+ ' file(s) found'
+ }
+ >
+ <Pagination
style={{
- fontSize: '0.9rem',
- color: theme.palette.text.secondary
+ left: 15,
+ bottom: 65,
+ zIndex: 1100,
+ position: 'absolute',
+ backgroundColor: theme.palette.background.default,
+ opacity: 0.97,
+ border: '1px solid lightgray',
+ borderRadius: 5,
+ padding: 3
}}
- >
- {directories.length +
- ' folder(s) and ' +
- allFilesCount +
- ' file(s) found'}
- </Typography>
- </div>
+ count={paginationCount}
+ page={page.current}
+ onChange={handleChange}
+ />
+ </Tooltip>
)}
+ {!showDetails &&
+ !showPagination &&
+ (directories.length > 0 || pageFiles.length > 0) && (
+ <div style={{ padding: 15, bottom: 10 }}>
+ <Typography
+ style={{
+ fontSize: '0.9rem',
+ color: theme.palette.text.secondary
+ }}
+ >
+ {directories.length +
+ ' folder(s) and ' +
+ allFilesCount +
+ ' file(s) found'}
+ </Typography>
+ </div>
+ )}
+ </div>
</div>
);
}
diff --git a/app/perspectives/grid-perspective/components/GridSettingsDialog.tsx b/app/perspectives/grid-perspective/components/GridSettingsDialog.tsx
index d3d87f676..8244421d6 100644
--- a/app/perspectives/grid-perspective/components/GridSettingsDialog.tsx
+++ b/app/perspectives/grid-perspective/components/GridSettingsDialog.tsx
@@ -393,16 +393,11 @@ function GridSettingsDialog(props: Props) {
</FormControl>
</DialogContent>
<DialogActions style={{ justifyContent: 'space-between' }}>
- <Button
- data-tid="gridPerspectiveHelp"
- title={i18n.t('core:help')}
- onClick={openHelpWebPage}
- >
+ <Button data-tid="gridPerspectiveHelp" onClick={openHelpWebPage}>
{i18n.t('core:help')}
</Button>
<Button
data-tid="defaultSettings"
- title={i18n.t('core:defaultSettings')}
onClick={() => {
onClose(true);
}}
@@ -413,7 +408,6 @@ function GridSettingsDialog(props: Props) {
{Pro && (
<Button
data-tid="directorySettings"
- title={i18n.t('core:directorySettings')}
onClick={() => {
onClose(false);
}}