forked from accordproject/template-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullScreenModal.tsx
More file actions
53 lines (49 loc) · 1.6 KB
/
FullScreenModal.tsx
File metadata and controls
53 lines (49 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React, { useState, useEffect } from "react";
import { Modal } from "antd";
import AgreementHtml from "../AgreementHtml";
import { FullscreenOutlined } from "@ant-design/icons";
import useAppStore from "../store/store";
const FullScreenModal: React.FC = () => {
const [open, setOpen] = useState(false);
const textColor = useAppStore((state) => state.textColor);
const backgroundColor = useAppStore((state) => state.backgroundColor);
useEffect(() => {
const style = document.createElement("style");
style.innerHTML = `
.ant-modal-content {
background-color: ${backgroundColor} !important;
color: ${textColor} !important;
}
.ant-modal-header {
background-color: ${backgroundColor} !important;
color: ${textColor} !important;
}
.ant-modal-title{
color: ${textColor} !important;
}
`;
document.head.appendChild(style);
return () => {
document.head.removeChild(style);
};
}, [textColor, backgroundColor]);
return (
<div style={{ textAlign: "right", display: "flex", alignItems: "center", justifyContent: "flex-end", color: textColor, }} className="preview-element">
<FullscreenOutlined
style={{ fontSize: "24px", cursor: "pointer", margin: "5px" }}
onClick={() => setOpen(true)}
/>
<Modal
title="Output"
centered
open={open}
onOk={() => setOpen(false)}
onCancel={() => setOpen(false)}
width={1000}
>
<AgreementHtml loading={false} isModal={true} />
</Modal>
</div>
);
};
export default FullScreenModal;