aboutsummaryrefslogtreecommitdiffstats
path: root/packages/renderer/src/components/locationBar/ButtonAdornment.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/renderer/src/components/locationBar/ButtonAdornment.tsx')
-rw-r--r--packages/renderer/src/components/locationBar/ButtonAdornment.tsx69
1 files changed, 0 insertions, 69 deletions
diff --git a/packages/renderer/src/components/locationBar/ButtonAdornment.tsx b/packages/renderer/src/components/locationBar/ButtonAdornment.tsx
deleted file mode 100644
index 2cf230b..0000000
--- a/packages/renderer/src/components/locationBar/ButtonAdornment.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2022 Kristóf Marussy <kristof@marussy.com>
3 *
4 * This file is part of Sophie.
5 *
6 * Sophie is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 *
18 * SPDX-License-Identifier: AGPL-3.0-only
19 */
20
21import InputAdornment from '@mui/material/InputAdornment';
22import { styled } from '@mui/material/styles';
23
24export const NO_LABEL_BUTTON_CLASS_NAME = 'ButtonAdornment-NoLabel';
25
26const ButtonAdornment = styled(InputAdornment, {
27 name: 'ButtonAdornment',
28})(({ theme, position }) => {
29 const { direction } = theme;
30 const left = direction === 'ltr' ? 'start' : 'end';
31 return {
32 ...(position === left
33 ? {
34 marginRight: 2,
35 marginLeft: -8,
36 }
37 : {
38 marginLeft: 2,
39 marginRight: -8,
40 }),
41 '.MuiButton-root': {
42 minWidth: 32,
43 height: 32,
44 paddingLeft: 6,
45 paddingRight: 6,
46 borderRadius: 16,
47 },
48 ...(direction === 'ltr'
49 ? {
50 '.MuiButton-startIcon': {
51 marginLeft: 0,
52 },
53 [`.${NO_LABEL_BUTTON_CLASS_NAME} .MuiButton-startIcon`]: {
54 marginRight: 0,
55 },
56 }
57 : {
58 '.MuiButton-startIcon': {
59 marginRight: 0,
60 marginLeft: theme.spacing(1),
61 },
62 [`.${NO_LABEL_BUTTON_CLASS_NAME} .MuiButton-startIcon`]: {
63 marginLeft: 0,
64 },
65 }),
66 };
67});
68
69export default ButtonAdornment;