Skip to content

Commit d077b49

Browse files
committed
Initializes PopupBase
1 parent eeaeb9f commit d077b49

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

src/components/common/PopupBase.tsx

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as React from 'react';
2+
import styled from 'styled-components';
3+
import OpaqueLayer from './OpaqueLayer';
4+
import zIndexes from '../../lib/styles/zIndexes';
5+
6+
const PopupBaseBlock = styled.div`
7+
position: fixed;
8+
top: 0;
9+
left: 0;
10+
width: 100%;
11+
height: 100%;
12+
z-index: ${zIndexes.Popup};
13+
display: flex;
14+
align-items: center;
15+
justify-content: center;
16+
& > .wrapper {
17+
width: 25rem;
18+
background: white;
19+
padding: 2rem 1.5rem;
20+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.09);
21+
}
22+
`;
23+
24+
interface PopupBaseProps {
25+
visible: boolean;
26+
}
27+
28+
const PopupBase: React.SFC<PopupBaseProps> = ({ visible }) => {
29+
return (
30+
<>
31+
<OpaqueLayer visible={visible} />
32+
<PopupBaseBlock>
33+
<div className="wrapper">Hey tehre!</div>
34+
</PopupBaseBlock>
35+
</>
36+
);
37+
};
38+
39+
export default PopupBase;

src/components/write/QuillEditor.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import TitleTextarea from './TitleTextarea';
1414
import { getScrollTop } from '../../lib/utils';
1515
import convertToMarkdown from '../../lib/convertToMarkdown';
1616

17+
import PopupBase from '../common/PopupBase';
18+
1719
Quill.register('modules/markdownShortcuts', MarkdownShortcuts);
1820

1921
export interface QuillEditorProps {}
@@ -78,6 +80,20 @@ const Editor = styled.div`
7880
overflow-x: auto;
7981
}
8082
83+
h1,
84+
h2,
85+
h3,
86+
h4 {
87+
margin-top: 0.5em;
88+
margin-bottom: 0.5em;
89+
}
90+
91+
p + h1,
92+
p + h2,
93+
p + h3,
94+
p + h4 {
95+
margin-top: 1.5em;
96+
}
8197
ul,
8298
ol {
8399
padding-left: 0;
@@ -110,6 +126,11 @@ const Editor = styled.div`
110126
}
111127
}
112128
${postStyles}
129+
130+
p + blockquote, blockquote + p {
131+
margin-top: 1rem;
132+
margin-bottom: 1rem;
133+
}
113134
}
114135
.ql-editor.ql-blank::before {
115136
left: 0px;
@@ -418,6 +439,7 @@ export default class QuillEditor extends React.Component<
418439
/>
419440
)}
420441
</Editor>
442+
<PopupBase visible={true} />
421443
</QuillEditorWrapper>
422444
);
423445
}

src/lib/styles/zIndexes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const zIndexes = {
22
OpaqueLayer: 10,
33
AuthModal: 20,
44
Toolbar: 10,
5+
Popup: 25,
56
};
67

78
export default zIndexes;

0 commit comments

Comments
 (0)