Skip to content

Commit 4f33857

Browse files
committed
#347 display rocket in edit view
1 parent d60d484 commit 4f33857

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

webapp/components/general/SplitButton.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import MenuItem from '@material-ui/core/MenuItem';
1111
import MenuList from '@material-ui/core/MenuList';
1212

1313
export default function SplitButton (props) {
14-
const { options, handleClick, icon } = props;
14+
const {
15+
options, handleClick, icon, skipIconFor,
16+
} = props;
1517
const [open, setOpen] = React.useState(false);
1618
const anchorRef = React.useRef(null);
1719
const [selectedIndex, setSelectedIndex] = React.useState(0);
1820

19-
const handleItemClick = (event) => {
21+
const handleItemClick = () => {
2022
handleClick(options[selectedIndex]);
2123
};
2224

@@ -46,7 +48,7 @@ export default function SplitButton (props) {
4648
aria-label="split button"
4749
>
4850
<Button onClick={handleItemClick}>
49-
{icon}
51+
{typeof skipIconFor === 'undefined' || skipIconFor !== options[selectedIndex] ? icon : null}
5052
{options[selectedIndex]}
5153
</Button>
5254
<Button

webapp/components/topbar/SwitchPageButton.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,18 @@ class SwitchPageButton extends Component {
8787
return (
8888
<div className={classes.container}>
8989
{editModelPage
90-
? <SplitButton options={editOptions} handleClick={(selectedOption) => this.handleClick(selectedOption)} />
90+
? (
91+
<SplitButton
92+
options={editOptions}
93+
handleClick={(selectedOption) => this.handleClick(selectedOption)}
94+
icon={(
95+
<span style={{ marginRight: '5px' }}>
96+
<Icon name="rocket" />
97+
</span>
98+
)}
99+
skipIconFor={CREATE_NETWORK}
100+
/>
101+
)
91102
: (
92103
<>
93104
<Button

0 commit comments

Comments
 (0)