Skip to content

Commit 0df415f

Browse files
committed
improve locations page UI by props
1 parent d0ed654 commit 0df415f

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

src/components/generics/SearcherActionButton.jsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
import React from "react";
2-
3-
import { Typography, Button } from "@mui/material";
2+
import { Button, IconButton } from "@mui/material";
43

54
import { useModulesManager } from "../../helpers/modules";
65
import { DEFAULT } from "../../constants";
76

8-
const SearcherActionButton = ({ onClick, startIcon, label }) => {
7+
const SearcherActionButton = ({ onClick, startIcon, label, isLocationPane }) => {
98
const modulesManager = useModulesManager();
109
const isWorker = modulesManager.getConf("fe-core", "isWorker", DEFAULT.IS_WORKER);
1110

11+
if (isLocationPane) {
12+
return (
13+
<IconButton
14+
size="small"
15+
onClick={onClick}
16+
color="inherit"
17+
sx={{
18+
padding: "4px",
19+
}}
20+
>
21+
{startIcon}
22+
</IconButton>
23+
);
24+
}
25+
1226
return (
1327
<Button
1428
variant="text"

src/components/generics/SearcherPane.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class SearcherPane extends Component {
103103
appliedFiltersRowStructure = null,
104104
setAppliedFiltersRowStructure = null,
105105
applyNumberCircle = null,
106+
isLocationPane = false,
106107
} = this.props;
107108
return (
108109
<StyledSearcherPane>
@@ -140,6 +141,7 @@ class SearcherPane extends Component {
140141
onClick={a.action}
141142
startIcon={a.icon}
142143
label={a.label || ""}
144+
isLocationPane={isLocationPane}
143145
/>
144146
))}
145147
{!!reset && (
@@ -148,14 +150,16 @@ class SearcherPane extends Component {
148150
startIcon={<ResetFilterIcon />}
149151
onClick={this.debouncedReset}
150152
label={formatMessage(this.props.intl, module, "resetFilterTooltip")}
153+
isLocationPane={isLocationPane}
151154
/>
152155
)}
153-
{!!refresh && (
156+
{(!!refresh && !isLocationPane) && (
154157
<SearcherActionButton
155158
key="action-refresh"
156159
startIcon={<DefaultSearchIcon />}
157160
onClick={this.debouncedRefresh}
158161
label={formatMessage(this.props.intl, module, "refreshFilterTooltip")}
162+
isLocationPane={isLocationPane}
159163
/>
160164
)}
161165
</>

0 commit comments

Comments
 (0)