feat: optiminize modal UE on mobile dev
This commit is contained in:
parent
5ea6206319
commit
996537d262
|
@ -26,6 +26,7 @@ export interface ModalProps {
|
|||
headerBordered?: boolean;
|
||||
modelClassName?: string;
|
||||
onOpen?: (v: boolean) => void;
|
||||
maskCloseble?: boolean;
|
||||
}
|
||||
|
||||
export interface WarnProps
|
||||
|
@ -70,6 +71,7 @@ const Modal = (props: ModalProps) => {
|
|||
headerBordered,
|
||||
modelClassName,
|
||||
onOpen,
|
||||
maskCloseble = true,
|
||||
} = props;
|
||||
|
||||
const [open, setOpen] = useState(!!visible);
|
||||
|
@ -121,6 +123,11 @@ const Modal = (props: ModalProps) => {
|
|||
<AlertDialog.Overlay
|
||||
className="bg-modal-mask fixed inset-0 animate-mask "
|
||||
style={{ zIndex: baseZIndex - 1 }}
|
||||
onClick={() => {
|
||||
if (maskCloseble) {
|
||||
handleClose();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<AlertDialog.Content
|
||||
className={`
|
||||
|
@ -128,7 +135,16 @@ const Modal = (props: ModalProps) => {
|
|||
`}
|
||||
style={{ zIndex: baseZIndex - 1 }}
|
||||
>
|
||||
<div className="flex-1"> </div>
|
||||
<div
|
||||
className="flex-1"
|
||||
onClick={() => {
|
||||
if (maskCloseble) {
|
||||
handleClose();
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
</div>
|
||||
<div
|
||||
className={`flex flex-col flex-0
|
||||
bg-moda-panel text-modal-mask
|
||||
|
|
|
@ -54,12 +54,12 @@ export default function SessionItem(props: {
|
|||
}
|
||||
`}
|
||||
onClick={props.onClick}
|
||||
// ref={(ele) => {
|
||||
// draggableRef.current = ele;
|
||||
// provided.innerRef(ele);
|
||||
// }}
|
||||
// {...provided.draggableProps}
|
||||
// {...provided.dragHandleProps}
|
||||
ref={(ele) => {
|
||||
draggableRef.current = ele;
|
||||
provided.innerRef(ele);
|
||||
}}
|
||||
{...provided.draggableProps}
|
||||
{...provided.dragHandleProps}
|
||||
title={`${props.title}\n${Locale.ChatItem.ChatItemCount(
|
||||
props.count,
|
||||
)}`}
|
||||
|
|
|
@ -97,20 +97,13 @@ export default MenuLayout(function SessionList(props) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`flex-1 overflow-y-auto max-md:pb-chat-panel-mobile `}
|
||||
// onClick={(e) => {
|
||||
// if (e.target === e.currentTarget) {
|
||||
// navigate(Path.Home);
|
||||
// }
|
||||
// }}
|
||||
>
|
||||
<div className={`flex-1 overflow-y-auto max-md:pb-chat-panel-mobile `}>
|
||||
<DragDropContext onDragEnd={onDragEnd}>
|
||||
<Droppable droppableId="chat-list">
|
||||
{(provided) => (
|
||||
<div
|
||||
// ref={provided.innerRef}
|
||||
// {...provided.droppableProps}
|
||||
ref={provided.innerRef}
|
||||
{...provided.droppableProps}
|
||||
className={`w-[100%]`}
|
||||
>
|
||||
{sessions.map((item, i) => (
|
||||
|
|
Loading…
Reference in New Issue