Skip to content

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

chore: ui improvements

Ilian Sapundshievf2543e0fbc86
diff --git a/src/renderer/components/TagsSelect.tsx b/src/renderer/components/TagsSelect.tsx
index b9fefc00f..657ca9f98 100644
--- a/src/renderer/components/TagsSelect.tsx
+++ b/src/renderer/components/TagsSelect.tsx
@@ -17,6 +17,7 @@
*/
import TagContainer from '-/components/TagContainer';
+import TsTextField from '-/components/TsTextField';
import AiGenTagsButton from '-/components/chat/AiGenTagsButton';
import EntryTagMenu from '-/components/menus/EntryTagMenu';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
@@ -31,7 +32,6 @@ import { TS } from '-/tagspaces.namespace';
import { Box, InputAdornment } from '@mui/material';
import Autocomplete from '@mui/material/Autocomplete';
import FormHelperText from '@mui/material/FormHelperText';
-import TextField from '@mui/material/TextField';
import { getUuid } from '@tagspaces/tagspaces-common/utils-io';
import React, { useReducer, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -205,9 +205,8 @@ function TagsSelect(props: Props) {
renderInput={(params) => (
<>
<FormHelperText style={{ marginLeft: 0 }}>{label}</FormHelperText>
- <TextField
+ <TsTextField
{...params}
- variant="outlined"
label={undefined}
placeholder={placeholderText}
margin="normal"
diff --git a/src/renderer/components/TsSelect.tsx b/src/renderer/components/TsSelect.tsx
index 47f6262cd..67c277e8e 100644
--- a/src/renderer/components/TsSelect.tsx
+++ b/src/renderer/components/TsSelect.tsx
@@ -16,17 +16,18 @@
*
*/
-import React from 'react';
-import { useSelector } from 'react-redux';
-import TextField, { TextFieldProps } from '@mui/material/TextField';
-import FormHelperText from '@mui/material/FormHelperText';
+import TsTextField from '-/components/TsTextField';
import { isDesktopMode } from '-/reducers/settings';
-import AppConfig from '-/AppConfig';
+import FormHelperText from '@mui/material/FormHelperText';
+import { TextFieldProps } from '@mui/material/TextField';
+import { useTheme } from '@mui/material/styles';
+import { useSelector } from 'react-redux';
type TSSelectProps = TextFieldProps & {};
function TsSelect(props: TSSelectProps) {
const { children, label } = props;
+ const theme = useTheme();
const desktopMode = useSelector(isDesktopMode);
return (
@@ -34,21 +35,17 @@ function TsSelect(props: TSSelectProps) {
<FormHelperText style={{ marginLeft: 0, marginTop: 0 }}>
{label}
</FormHelperText>
- <TextField
+ <TsTextField
style={{
cursor: 'context-menu',
marginTop: 0,
}}
- margin="dense"
- size={desktopMode ? 'small' : 'medium'}
- variant="outlined"
select
- fullWidth={true}
{...props}
label={undefined}
>
{children}
- </TextField>
+ </TsTextField>
</div>
);
}
diff --git a/src/renderer/components/TsTextField.tsx b/src/renderer/components/TsTextField.tsx
index 980afecf6..229989d79 100644
--- a/src/renderer/components/TsTextField.tsx
+++ b/src/renderer/components/TsTextField.tsx
@@ -16,17 +16,18 @@
*
*/
-import React, { useState, useRef, useEffect } from 'react';
-import { useSelector } from 'react-redux';
-import TextField, { TextFieldProps } from '@mui/material/TextField';
-import Menu from '@mui/material/Menu';
-import MenuItem from '@mui/material/MenuItem';
-import FormHelperText from '@mui/material/FormHelperText';
import TsMenuList from '-/components/TsMenuList';
-import ListItemText from '@mui/material/ListItemText';
import MenuKeyBinding from '-/components/menus/MenuKeyBinding';
-import { useTranslation } from 'react-i18next';
import { isDesktopMode } from '-/reducers/settings';
+import FormHelperText from '@mui/material/FormHelperText';
+import ListItemText from '@mui/material/ListItemText';
+import Menu from '@mui/material/Menu';
+import MenuItem from '@mui/material/MenuItem';
+import TextField, { TextFieldProps } from '@mui/material/TextField';
+import { useTheme } from '@mui/material/styles';
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+import { useSelector } from 'react-redux';
type TSTextFieldProps = TextFieldProps & {
updateValue?: (string) => void;
@@ -35,6 +36,7 @@ type TSTextFieldProps = TextFieldProps & {
function TsTextField(props: TSTextFieldProps) {
const { updateValue, retrieveValue, children, label, ...restProps } = props;
+ const theme = useTheme();
const { t } = useTranslation();
const desktopMode = useSelector(isDesktopMode);
//const textFieldRef = useRef(null);
@@ -111,7 +113,38 @@ function TsTextField(props: TSTextFieldProps) {
size={desktopMode ? 'small' : 'medium'}
variant="outlined"
fullWidth={true}
- // ref={textFieldRef}
+ // sx={{
+ // backgroundColor: alpha(theme.palette.divider, 0.2),
+ // '&:hover': {
+ // backgroundColor: alpha(theme.palette.divider, 0.5),
+ // },
+ // '& .Mui-focused': {
+ // backgroundColor: 'transparent !important',
+ // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // },
+ // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // transition: '0.3s',
+ // '&:hover .MuiOutlinedInput-notchedOutline': {
+ // border: '2px solid transparent',
+ // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // },
+ // '& .MuiOutlinedInput-notchedOutline': {
+ // border: '2px solid transparent',
+ // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // },
+ // '& .Mui-focused .MuiOutlinedInput-notchedOutline': {
+ // border: '2px solid ' + alpha(theme.palette.divider, 0.5),
+ // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // },
+ // // '& fieldset': {
+ // // border: '2px solid transparent',
+ // // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // // },
+ // // '& fieldset:focus': {
+ // // border: '2px solid red !important',
+ // // borderRadius: AppConfig.defaultCSSRadius + 'px',
+ // // },
+ // }}
{...restProps}
label={undefined}
>