Skip to content

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

chore: improvenents for the description in perspectives and entry properties

Ilian Sapundshievedaf9d587c87
diff --git a/app/components/EditDescription.tsx b/app/components/EditDescription.tsx
index 09fc4777d..6ecac10df 100644
--- a/app/components/EditDescription.tsx
+++ b/app/components/EditDescription.tsx
@@ -82,6 +82,7 @@ function EditDescription(props: Props) {
</span>
);
+ const noDescription = !description || description.length < 1;
return (
<>
<span style={{ verticalAlign: 'sub', paddingLeft: 5 }}>
@@ -102,22 +103,34 @@ function EditDescription(props: Props) {
borderRadius: 5,
padding: 2,
minHeight: 50,
- maxHeight: 250,
+ maxHeight: noDescription && !editMode ? 100 : 250,
width: 'calc(100% - 8px)',
// @ts-ignore
overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
}}
>
- <MilkdownEditor
- ref={fileDescriptionRef}
- content={description || ''}
- onChange={milkdownListener}
- onFocus={milkdownOnFocus}
- readOnly={!editMode}
- dark={isDarkTheme}
- lightMode={true}
- currentFolder={currentFolder}
- />
+ {noDescription && !editMode ? (
+ <Typography
+ variant="caption"
+ style={{
+ color: primaryColor,
+ padding: 10
+ }}
+ >
+ {i18n.t('core:addMarkdownDescription')}
+ </Typography>
+ ) : (
+ <MilkdownEditor
+ ref={fileDescriptionRef}
+ content={description || ''}
+ onChange={milkdownListener}
+ onFocus={milkdownOnFocus}
+ readOnly={!editMode}
+ dark={isDarkTheme}
+ lightMode={true}
+ currentFolder={currentFolder}
+ />
+ )}
</div>
<Typography
variant="caption"
diff --git a/app/perspectives/grid-perspective/components/GridPagination.tsx b/app/perspectives/grid-perspective/components/GridPagination.tsx
index 571b62d2b..eaf030683 100644
--- a/app/perspectives/grid-perspective/components/GridPagination.tsx
+++ b/app/perspectives/grid-perspective/components/GridPagination.tsx
@@ -424,7 +424,6 @@ function GridPagination(props: Props) {
<Grid item xs={12}>
<div
style={{
- padding: 10,
marginLeft: 10,
marginRight: 10,
marginTop: 0,
@@ -510,8 +509,6 @@ function GridPagination(props: Props) {
<div
style={{
borderRadius: 8,
- marginLeft: 'auto',
- marginRight: 'auto',
height: 140,
width: 140,
backgroundImage: 'url("' + folderTmbPath.current + '")',
@@ -519,8 +516,8 @@ function GridPagination(props: Props) {
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center center',
position: 'absolute',
- top: 10,
- right: 10
+ top: 0,
+ right: 0
}}
>
{/* <EntryIcon isFile={false} /> */}
@@ -535,8 +532,11 @@ function GridPagination(props: Props) {
xs={12}
style={{
backgroundColor: theme.palette.background.default,
+ marginTop: showDetails ? 0 : 10,
marginLeft: 25,
marginRight: 10,
+ paddingBottom: 16,
+ paddingRight: 16,
borderRadius: 5
}}
>