Skip to content

Commit 7d24c07

Browse files
committed
👌 use common/Button component for IconButton
1 parent 9ca0995 commit 7d24c07

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import styled from 'styled-components';
3-
import { prop, remSize } from '../../theme';
4+
import Button from '../../common/Button';
45

5-
const textColor = prop('primaryTextColor');
6-
7-
const IconButton = styled.button`
6+
const ButtonWrapper = styled(Button)`
87
width: 3rem;
98
> svg {
109
width: 100%;
1110
height: auto;
12-
fill: ${textColor};
13-
stroke: ${textColor};
1411
}
1512
`;
1613

14+
const IconButton = ({ children }) => (<ButtonWrapper
15+
aria-label="Add to collection"
16+
iconBefore={children}
17+
kind={Button.kinds.inline}
18+
/>);
19+
20+
IconButton.propTypes = {
21+
children: PropTypes.element.isRequired
22+
};
23+
1724
export default IconButton;

client/modules/IDE/pages/IDEViewMobile.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const IDEViewMobile = (props) => {
6161
<h3>{selectedFile.name}</h3>
6262
</div>
6363

64-
<div style={{ marginLeft: '2rem' }}>
64+
<div style={{ marginLeft: '2rem', display: 'flex' }}>
6565
<IconButton onClick={() => setOverlay('preferences')}>
6666
<PreferencesIcon focusable="false" aria-hidden="true" />
6767
</IconButton>

0 commit comments

Comments
 (0)