style: subdrawer width
This commit is contained in:
@@ -4,9 +4,10 @@ import { FormContext } from '@/pages/gpu-service/storage/config/form-context';
|
||||
import useQueryStorageClass from '@/pages/gpu-service/storage/services/use-query-storage-class';
|
||||
import { ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { FormData as StorageFormData } from '../../storage/config/types';
|
||||
import GPUServiceStorageForm from '../../storage/forms';
|
||||
import useOverlayLayout from '../hooks/use-overlay-layout';
|
||||
|
||||
interface StorageOverlayProps {
|
||||
open: boolean;
|
||||
@@ -24,6 +25,7 @@ const StorageOverlay: React.FC<StorageOverlayProps> = ({
|
||||
useQueryStorageClass();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const formRef = useRef<any>(null);
|
||||
const { drawerWidth, getOverlayContainer } = useOverlayLayout(open);
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
@@ -49,19 +51,11 @@ const StorageOverlay: React.FC<StorageOverlayProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const getOverlayContainer = useCallback(() => {
|
||||
const containers = document.querySelectorAll<HTMLElement>(
|
||||
'.ant-layout-content'
|
||||
);
|
||||
|
||||
return containers[containers.length - 1] ?? null;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<FormOverlayView
|
||||
title={intl.formatMessage({ id: 'gpuservice.storage.add' })}
|
||||
open={open}
|
||||
width={600}
|
||||
width={drawerWidth}
|
||||
onCancel={handleCancel}
|
||||
getContainer={getOverlayContainer}
|
||||
footer={
|
||||
|
||||
Reference in New Issue
Block a user