Skip to content

Commit aa4ef72

Browse files
committed
Various modal improvements
1 parent dd126a5 commit aa4ef72

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

src/components/CameraModal.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ const CameraViewerContainer = styled.div`
1818
const CameraListContainer = styled.div`
1919
grid-area: sidebar;
2020
font-size: 11pt;
21+
22+
h3 {
23+
margin: 0;
24+
padding: 20px;
25+
}
26+
2127
ul {
2228
list-style: none;
2329
padding: 0;
2430
margin: 0;
31+
width: 100%;
2532
2633
li {
2734
cursor: pointer;
@@ -60,6 +67,7 @@ export default ({ hass, entityId, cameraList, isOpen, onRequestClose }) => {
6067
onRequestClose={onRequestClose}
6168
/>
6269
<CameraListContainer>
70+
<h3>Cameras Available</h3>
6371
<ul>
6472
{cameraList.map((entityId) => {
6573
const {

src/components/Modal.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const UnstyledModalHeader = ({
1616
return (
1717
<div className={`${className} modal-header`}>
1818
<TransparentButton onClick={onRequestClose}>
19-
<Icon name="close" size="24" />
19+
<Icon name="close" size="42" />
2020
</TransparentButton>
2121
{title && <h2>{title}</h2>}
2222
{children}
@@ -28,7 +28,6 @@ export const ModalHeader = styled(UnstyledModalHeader)`
2828
grid-area: header;
2929
display: flex;
3030
align-items: center;
31-
padding: 20px;
3231
border-bottom: 1px solid var(--bg-color);
3332
3433
${(props) =>
@@ -44,10 +43,25 @@ export const ModalHeader = styled(UnstyledModalHeader)`
4443
`}
4544
4645
button {
47-
display: inline-block;
48-
width: 24px;
49-
height: 24px;
50-
margin-right: 10px;
46+
display: inline-flex;
47+
align-items: center;
48+
justify-content: center;
49+
width: 60px;
50+
height: 100%;
51+
background: var(--bg-color);
52+
53+
${(props) =>
54+
props.small &&
55+
css`
56+
width: 40px;
57+
padding: 6px;
58+
`}
59+
60+
${(props) =>
61+
props.light &&
62+
css`
63+
background: inherit;
64+
`}
5165
}
5266
5367
button svg {
@@ -58,6 +72,13 @@ export const ModalHeader = styled(UnstyledModalHeader)`
5872
h2 {
5973
display: inline-block;
6074
margin: 0;
75+
padding: 20px;
76+
77+
${(props) =>
78+
props.small &&
79+
css`
80+
padding: 6px;
81+
`}
6182
}
6283
`;
6384

0 commit comments

Comments
 (0)