Skip to content

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

feat: added new icon for entries with description in the entry container

Ilian Sapundshiev5a5c975d6a06
diff --git a/src/renderer/components/CommonIcons.tsx b/src/renderer/components/CommonIcons.tsx
index 152303d5d..0c82bd513 100644
--- a/src/renderer/components/CommonIcons.tsx
+++ b/src/renderer/components/CommonIcons.tsx
@@ -116,6 +116,8 @@ export { default as RevisionIcon } from '@mui/icons-material/Restore';
export { default as DescriptionIcon } from '@mui/icons-material/Subject';
+export { default as EditDescriptionIcon } from '@mui/icons-material/EditNote';
+
export { default as AudioRecordIcon } from '@mui/icons-material/KeyboardVoice';
export { default as NewFileIcon } from '@mui/icons-material/InsertDriveFile';
diff --git a/src/renderer/components/EntryContainer.tsx b/src/renderer/components/EntryContainer.tsx
index 277f0d107..41d79a5e9 100644
--- a/src/renderer/components/EntryContainer.tsx
+++ b/src/renderer/components/EntryContainer.tsx
@@ -85,7 +85,7 @@ function EntryContainer() {
reflectUpdateOpenedFileContent,
addToEntryContainer,
} = useOpenedEntryContext();
- const { saveDescription } = useDescriptionContext();
+ const { saveDescription, description } = useDescriptionContext();
const { setAutoSave } = useEditedEntryMetaContext();
const { readOnlyMode, switchLocationTypeByID, switchCurrentLocationType } =
useCurrentLocationContext();
@@ -739,12 +739,14 @@ function EntryContainer() {
);
}
}
+ const haveDescription = description?.length > 0;
const tabsComponent = (marginRight = undefined) => (
<EntryContainerTabs
isEditable={isEditable}
isPanelOpened={isPanelOpened}
openPanel={openPanel}
toggleProperties={toggleProperties}
+ haveDescription={haveDescription}
marginRight={marginRight}
/>
);
diff --git a/src/renderer/components/EntryContainerTabs.tsx b/src/renderer/components/EntryContainerTabs.tsx
index f54d13ab2..3dcc479be 100644
--- a/src/renderer/components/EntryContainerTabs.tsx
+++ b/src/renderer/components/EntryContainerTabs.tsx
@@ -34,6 +34,7 @@ import {
import {
FolderPropertiesIcon,
DescriptionIcon,
+ EditDescriptionIcon,
RevisionIcon,
} from '-/components/CommonIcons';
import EditDescription from '-/components/EditDescription';
@@ -82,6 +83,7 @@ const StyledTab = styled((props: StyledTabProps) => (
marginRight: theme.spacing(1),
minHeight: 50,
maxHeight: 50,
+ minWidth: 40,
}));
function a11yProps(index: number) {
@@ -96,6 +98,7 @@ interface EntryContainerTabsProps {
toggleProperties: () => void;
isEditable: boolean;
isPanelOpened: boolean;
+ haveDescription: boolean;
marginRight: string;
}
@@ -112,6 +115,7 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
marginRight,
isEditable,
isPanelOpened,
+ haveDescription,
} = props;
const { t } = useTranslation();
@@ -197,7 +201,9 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
/>
<StyledTab
data-tid="descriptionTabTID"
- icon={<DescriptionIcon />}
+ icon={
+ haveDescription ? <EditDescriptionIcon /> : <DescriptionIcon />
+ }
label={desktopMode && t('core:filePropertiesDescription')}
{...a11yProps(1)}
onClick={handleTabClick}