mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
improve modal frame content
This commit is contained in:
parent
997685dac9
commit
ce4c66f28b
@ -1,6 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { Modal as AntdModal } from "antd"
|
import { Modal as AntdModal } from "antd"
|
||||||
import classnames from "classnames"
|
import classnames from "classnames"
|
||||||
|
|
||||||
|
import { Icons } from "components/Icons"
|
||||||
|
|
||||||
import useLayoutInterface from "hooks/useLayoutInterface"
|
import useLayoutInterface from "hooks/useLayoutInterface"
|
||||||
import { DOMWindow } from "components/RenderWindow"
|
import { DOMWindow } from "components/RenderWindow"
|
||||||
|
|
||||||
@ -87,7 +90,17 @@ class Modal extends React.Component {
|
|||||||
ref={this.contentRef}
|
ref={this.contentRef}
|
||||||
onTouchEnd={this.handleClickOutside}
|
onTouchEnd={this.handleClickOutside}
|
||||||
onMouseDown={this.handleClickOutside}
|
onMouseDown={this.handleClickOutside}
|
||||||
|
style={this.props.frameContentStyle}
|
||||||
>
|
>
|
||||||
|
{
|
||||||
|
this.props.includeCloseButton && <div
|
||||||
|
className="app_modal_close"
|
||||||
|
onClick={this.close}
|
||||||
|
>
|
||||||
|
<Icons.MdClose />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
React.cloneElement(this.props.children, {
|
React.cloneElement(this.props.children, {
|
||||||
close: this.close
|
close: this.close
|
||||||
@ -106,6 +119,8 @@ export default () => {
|
|||||||
render,
|
render,
|
||||||
{
|
{
|
||||||
framed = true,
|
framed = true,
|
||||||
|
frameContentStyle = null,
|
||||||
|
includeCloseButton = false,
|
||||||
|
|
||||||
confirmOnOutsideClick = false,
|
confirmOnOutsideClick = false,
|
||||||
confirmOnClickTitle,
|
confirmOnClickTitle,
|
||||||
@ -126,7 +141,9 @@ export default () => {
|
|||||||
onClose={() => {
|
onClose={() => {
|
||||||
win.destroy()
|
win.destroy()
|
||||||
}}
|
}}
|
||||||
|
includeCloseButton={includeCloseButton}
|
||||||
framed={framed}
|
framed={framed}
|
||||||
|
frameContentStyle={frameContentStyle}
|
||||||
confirmOnOutsideClick={confirmOnOutsideClick}
|
confirmOnOutsideClick={confirmOnOutsideClick}
|
||||||
confirmOnClickTitle={confirmOnClickTitle}
|
confirmOnClickTitle={confirmOnClickTitle}
|
||||||
confirmOnClickContent={confirmOnClickContent}
|
confirmOnClickContent={confirmOnClickContent}
|
||||||
|
@ -44,6 +44,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.app_modal_content {
|
.app_modal_content {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -62,6 +64,31 @@
|
|||||||
|
|
||||||
transition: all 150ms ease-in-out;
|
transition: all 150ms ease-in-out;
|
||||||
|
|
||||||
|
.app_modal_close {
|
||||||
|
position: sticky;
|
||||||
|
|
||||||
|
align-self: flex-end;
|
||||||
|
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
font-size: 1.5rem;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
|
||||||
|
padding: 5px;
|
||||||
|
|
||||||
|
border-radius: 12px;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// fixments
|
// fixments
|
||||||
.postCreator {
|
.postCreator {
|
||||||
box-shadow: @card-shadow;
|
box-shadow: @card-shadow;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user