Skip to content

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

chore: added new tsbutton component

Ilian Sapundshievc09f655fafb8
diff --git a/src/renderer/components/TsButton.tsx b/src/renderer/components/TsButton.tsx
new file mode 100644
index 000000000..e270daffc
--- /dev/null
+++ b/src/renderer/components/TsButton.tsx
@@ -0,0 +1,40 @@
+/**
+ * TagSpaces - universal file and folder organizer
+ * Copyright (C) 2024-present TagSpaces GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License (version 3) as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+import React from 'react';
+import { useSelector } from 'react-redux';
+import Button, { ButtonProps } from '@mui/material/Button';
+import { isDesktopMode } from '-/reducers/settings';
+
+export type TSButtonProps = ButtonProps & {};
+
+export function TsButton(props: TSButtonProps) {
+ const { children, style } = props;
+ const desktopMode = useSelector(isDesktopMode);
+
+ return (
+ <Button
+ size={desktopMode ? 'small' : 'medium'}
+ variant="outlined" // text outlined contained
+ {...props}
+ style={{ borderRadius: 10, textTransform: 'initial', ...style }}
+ >
+ {children}
+ </Button>
+ );
+}
diff --git a/src/renderer/components/TsSelect.tsx b/src/renderer/components/TsSelect.tsx
index 2e42b2882..a15d2b8d8 100644
--- a/src/renderer/components/TsSelect.tsx
+++ b/src/renderer/components/TsSelect.tsx
@@ -22,12 +22,9 @@ import TextField, { TextFieldProps } from '@mui/material/TextField';
import FormHelperText from '@mui/material/FormHelperText';
import { isDesktopMode } from '-/reducers/settings';
-type TSTextFieldProps = TextFieldProps & {
- updateValue?: (string) => void;
- retrieveValue?: () => string;
-};
+type TSSelectProps = TextFieldProps & {};
-function TsSelect(props: TSTextFieldProps) {
+function TsSelect(props: TSSelectProps) {
const { children, label } = props;
const desktopMode = useSelector(isDesktopMode);