fix: added fix for the height of the model content to not overflow on smaller devices

This commit is contained in:
Erik Tiekstra
2024-10-17 07:41:03 +02:00
parent 4c1ee66542
commit babb66d989
5 changed files with 2111 additions and 1796 deletions

View File

@@ -1,17 +1,17 @@
import { useState, useEffect, ChangeEvent } from "react"
import {
ModalFooter,
ModalBody,
ModalHeader,
ButtonGroup,
Button,
ButtonGroup,
Field as FieldComponent,
FieldLabel,
ModalBody,
ModalFooter,
ModalHeader,
TextInput,
} from "@contentstack/venus-components"
import { ChangeEvent, useEffect, useState } from "react"
import type { FocalPoint, InsertResponse } from "~/types/imagevault"
import FocalPointPicker from "~/shared-components/FocalPointPicker"
import type { FocalPoint, InsertResponse } from "~/types/imagevault"
type ImageEditModalProps = {
fieldData: InsertResponse
@@ -86,7 +86,9 @@ export default function ImageEditModal({
gap: "1rem",
alignItems: "center",
width: "auto",
maxHeight: "none",
maxHeight: "calc(90dvh - 124px)", // 124px is the height of the header and footer
maxWidth: "90dvw",
overflow: "auto",
}}
>
<FocalPointPicker

View File

@@ -7,18 +7,18 @@ import {
FieldLabel,
cbModal,
} from "@contentstack/venus-components"
import ImageEditModal from "./ImageEditModal"
import FullSizeImage from "./FullSizeImage"
import { isInsertResponse, openImageVault } from "~/utils/imagevault"
import FullSizeImage from "./FullSizeImage"
import ImageEditModal from "./ImageEditModal"
import type { CbModalProps } from "@contentstack/venus-components/build/components/Modal/Modal"
import type UiLocation from "@contentstack/app-sdk/dist/src/uiLocation"
import type { CbModalProps } from "@contentstack/venus-components/build/components/Modal/Modal"
import type { InsertResponse } from "~/types/imagevault"
import type { Lang } from "~/types/lang"
import type {
EntryDataPublishDetails,
ImageVaultDAMConfig,
} from "~/utils/imagevault"
import type { Lang } from "~/types/lang"
export type ImageVaultDAMProps = {
sdk: UiLocation
@@ -177,6 +177,7 @@ export default function ImageVaultDAM({
style: {
content: {
maxHeight: "90dvh",
maxWidth: "90dvw",
width: "auto",
},
overlay: {},