Skip to content

Commit e714b58

Browse files
committed
add styles to button in WindowHeader
1 parent ea80666 commit e714b58

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/components/Button/Button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const commonButtonStyles = css`
2929
padding-top: ${({ active, isDisabled }) => active && !isDisabled && '2px'};
3030
`;
3131

32-
const StyledButton = styled.button`
32+
export const StyledButton = styled.button`
3333
${({ variant, theme, active, isDisabled, primary }) =>
3434
variant === 'flat'
3535
? css`

src/components/Window/Window.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ const ResizeHandle = styled.span`
4141
`}
4242
`;
4343

44-
// TODO how to pass event handlers to resize handler?
45-
// TODO how to pass refs to both Window component and DragHandle?
46-
4744
const Window = ({ resizable, shadow, children, ...otherProps }) => (
4845
<StyledWindow shadow={shadow} {...otherProps}>
4946
{children}
@@ -60,7 +57,6 @@ Window.defaultProps = {
6057
Window.propTypes = {
6158
shadow: propTypes.bool,
6259
resizable: propTypes.bool,
63-
6460
children: propTypes.node
6561
};
6662

src/components/Window/Window.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ storiesOf('Window', module)
2828
}}
2929
>
3030
<span>react95.exe</span>
31-
<Button style={{ marginRight: 2, height: 25 }} size='sm' square>
31+
<Button>
3232
<span style={{ fontWeight: 'bold', transform: 'translateY(-1px)' }}>
33-
x
33+
X
3434
</span>
3535
</Button>
3636
</WindowHeader>

src/components/WindowHeader/WindowHeader.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import React from 'react';
22
import propTypes from 'prop-types';
33

44
import styled from 'styled-components';
5+
import { StyledButton } from '../Button/Button';
56

67
const SlyledWindowHeader = styled.div`
7-
height: 30px;
8-
line-height: 30px;
8+
height: 33px;
9+
line-height: 33px;
910
padding-left: 0.25rem;
11+
padding-right: 3px;
1012
font-weight: bold;
1113
1214
&[data-active='false'] {
@@ -21,6 +23,10 @@ const SlyledWindowHeader = styled.div`
2123
);
2224
color: ${({ theme }) => theme.textInvert};
2325
}
26+
${StyledButton} {
27+
height: 27px;
28+
width: 31px;
29+
}
2430
`;
2531
// TODO - should we add some aria label indicating if window is currently active?
2632
const WindowHeader = ({ isActive, children, ...otherProps }) => (

0 commit comments

Comments
 (0)