Skip to content

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

chore: ui improvements for the search bar

Ilian Sapundshiev0fbb73eacc74
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index 9df05766d..7040ffd7e 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -545,39 +545,6 @@ const FolderContainer = (props: Props) => {
>
<MenuIcon />
</CustomButton>
- {/* <CounterBadge
- showZero={true}
- title={searchResultCounterText}
- badgeContent={searchResultCount}
- color="secondary"
- max={maxSearchResults - 1}
- onClick={() => {
- openSearchPanel();
- }}
- /> */}
- <Tooltip
- title={
- i18n.t('showSearch') + ' (CTRL/⌘+SHIFT+F)'
- // +
- // ' - ' +
- // keyBindings['openSearch'].toUpperCase()
- }
- >
- <CustomButton
- data-tid="toggleSearch"
- onClick={() => {
- if (isSearchVisible) {
- props.setSearchQuery({});
- props.openCurrentDirectory();
- } else {
- setSearchVisible(!isSearchVisible);
- }
- return true;
- }}
- >
- <SearchIcon />
- </CustomButton>
- </Tooltip>
{isSearchVisible ? (
<>
<SearchInline />
@@ -623,6 +590,29 @@ const FolderContainer = (props: Props) => {
flexDirection: 'column'
}}
/>
+ <Tooltip
+ title={
+ i18n.t('showSearch') + ' (CTRL/⌘+SHIFT+F)'
+ // +
+ // ' - ' +
+ // keyBindings['openSearch'].toUpperCase()
+ }
+ >
+ <CustomButton
+ data-tid="toggleSearch"
+ onClick={() => {
+ if (isSearchVisible) {
+ props.setSearchQuery({});
+ props.openCurrentDirectory();
+ } else {
+ setSearchVisible(!isSearchVisible);
+ }
+ return true;
+ }}
+ >
+ <SearchIcon />
+ </CustomButton>
+ </Tooltip>
{props.progress && props.progress.length > 0 && (
<CustomButton
id="progressButton"
diff --git a/app/components/SearchInline.tsx b/app/components/SearchInline.tsx
index 378998c08..abd5cb5d4 100644
--- a/app/components/SearchInline.tsx
+++ b/app/components/SearchInline.tsx
@@ -25,7 +25,7 @@ import {
createStyles,
makeStyles
} from '@material-ui/core/styles';
-import ClearSearchIcon from '@material-ui/icons/CancelOutlined';
+import ClearSearchIcon from '@material-ui/icons/Close';
import HelpOutlineIcon from '@material-ui/icons/HelpOutline';
import Button from '@material-ui/core/Button';
import Tooltip from '@material-ui/core/Tooltip';
@@ -382,7 +382,7 @@ const SearchInline = (props: Props) => {
}
>
<IconButton size="small" edge="end">
- <HelpOutlineIcon />
+ <HelpOutlineIcon style={{ color: 'lightgray' }} />
</IconButton>
</Tooltip>
);
@@ -447,7 +447,7 @@ const SearchInline = (props: Props) => {
margin="dense"
autoFocus
onKeyDown={startSearch}
- placeholder={i18n.t('core:searchWordsWithInterval')}
+ placeholder={i18n.t('core:searchTitle')}
InputProps={{
startAdornment: (
<InputAdornment position="start" style={{ marginRight: 0 }}>
diff --git a/app/components/SearchPopover.tsx b/app/components/SearchPopover.tsx
index 76be88161..91774d9e0 100644
--- a/app/components/SearchPopover.tsx
+++ b/app/components/SearchPopover.tsx
@@ -666,7 +666,7 @@ const SearchPopover = (props: Props) => {
onClick={clearSearch}
id="resetSearchButton"
>
- <CancelSearchIcon />
+ {i18n.t('resetBtn')}
</Button>
</Tooltip>
</ButtonGroup>
diff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsx
index 15a420b37..7f1f735b5 100644
--- a/app/components/menus/LocationMenu.tsx
+++ b/app/components/menus/LocationMenu.tsx
@@ -28,7 +28,7 @@ import ListItemText from '@material-ui/core/ListItemText';
import ListSubHeader from '@material-ui/core/ListSubheader';
import Tooltip from '@material-ui/core/Tooltip';
import { withTheme } from '@material-ui/core/styles';
-import Button from '@material-ui/core/Button';
+import IconButton from '@material-ui/core/IconButton';
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
import i18n from '-/services/i18n';
import { getLocations } from '-/reducers/locations';
@@ -78,27 +78,28 @@ const LocationMenu = (props: Props) => {
>
<Tooltip
title={
- currentLocation &&
- i18n.t('currentLocation') + ': ' + currentLocation.name
+ currentLocation
+ ? i18n.t('currentLocation') + ': ' + currentLocation.name
+ : i18n.t('core:pleaseOpenLocation')
}
>
- <Button
+ <IconButton
data-tid="folderContainerLocationChooser"
id="locationMenuButton"
onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}
style={{
- marginTop: 5,
- paddingRight: 0,
- paddingLeft: 0,
- marginRight: 5,
- borderRadius: 15
+ // paddingRight: 0,
+ // paddingLeft: 0,
+ // marginRight: 5,
+ fontSize: theme.typography.fontSize,
+ borderRadius: 10
}}
>
{currentLocation
? locationIcon // this.state.currentLocation.name
: i18n.t('core:pleaseOpenLocation')}
<ArrowDropDownIcon />
- </Button>
+ </IconButton>
</Tooltip>
{Boolean(locationChooserMenuAnchorEl) && (
<Menu