Skip to content

Commit

Permalink
Merge pull request #770 from SquirrelCorporation/386-improve-height-o…
Browse files Browse the repository at this point in the history
…f-the-add-device-modal-so-it-says-the-same

[CHORE] Set a minimum height for NewDeviceModal components
  • Loading branch information
SquirrelDeveloper authored Feb 22, 2025
2 parents 66cacb3 + 1f76067 commit cbb475c
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions client/src/components/NewDeviceModal/NewDeviceModal.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import AgentInstallMethod from '@/components/DeviceConfiguration/AgentInstallMethod';
import { DownloadOutlined } from '@ant-design/icons';
import React, { useRef, useState } from 'react';
import { Button, Col, Modal, Row, Alert, Typography, Tag, Grid } from 'antd';
import {
ProFormDependency,
ProFormInstance,
ProFormText,
StepsForm,
} from '@ant-design/pro-components';
import { motion } from 'framer-motion';
import CheckDeviceConnection from '@/components/DeviceConfiguration/CheckDeviceConnection';
import SSHConnectionFormElements from '@/components/DeviceConfiguration/SSHConnectionFormElements';
import {
GrommetIconsInstall,
StreamlineComputerConnection,
} from '@/components/Icons/CustomIcons';
import {
putDevice,
postCheckAnsibleConnection,
postCheckDockerConnection,
postCheckRemoteSystemInformationConnection,
putDevice,
} from '@/services/rest/device';
import SSHConnectionFormElements from '@/components/DeviceConfiguration/SSHConnectionFormElements';
import CheckDeviceConnection from '@/components/DeviceConfiguration/CheckDeviceConnection';
import { SsmAnsible, SsmAgent, API } from 'ssm-shared-lib';
import { DownloadOutlined } from '@ant-design/icons';
import {
ProFormDependency,
ProFormInstance,
ProFormText,
StepsForm,
} from '@ant-design/pro-components';
import { Alert, Button, Col, Grid, Modal, Row, Tag, Typography } from 'antd';
import { motion } from 'framer-motion';
import React, { useRef, useState } from 'react';
import { API, SsmAgent, SsmAnsible } from 'ssm-shared-lib';
import AnimationPlayer from './AnimationPlayer';
import StepFormCard from './StepFormCard';
import SummaryCard from './SummaryCard';
import AnimationPlayer from './AnimationPlayer';

export type NewDeviceModalProps = {
isModalOpen: boolean;
Expand Down Expand Up @@ -174,6 +174,8 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
visible: { opacity: 1, x: 0 },
};

const MODAL_MIN_HEIGHT = 600;

return (
<Modal
title={
Expand All @@ -187,7 +189,12 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
width={1000}
footer={(_, { CancelBtn }) => <CancelBtn />}
>
<Row style={{ alignItems: 'center' }} justify="center">
<Row
style={{
alignItems: 'center',
}}
justify="center"
>
{!screens.xs && (
<Col span={8}>
<AnimationPlayer />
Expand Down Expand Up @@ -255,6 +262,7 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
style={{
alignItems: 'start',
maxWidth: screens.xs ? '80%' : '100%',
minHeight: MODAL_MIN_HEIGHT,
}}
>
<SSHConnectionFormElements formRef={formRef} />
Expand All @@ -266,6 +274,7 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
style={{
alignItems: 'start',
maxWidth: screens.xs ? '80%' : '100%',
minHeight: MODAL_MIN_HEIGHT,
}}
>
<StepFormCard
Expand Down Expand Up @@ -341,6 +350,7 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
style={{
alignItems: 'start',
maxWidth: screens.xs ? '80%' : '100%',
minHeight: MODAL_MIN_HEIGHT,
}}
>
<StepFormCard
Expand All @@ -363,7 +373,10 @@ const NewDeviceModal: React.FC<NewDeviceModalProps> = (props) => {
<StepsForm.StepForm
name="confirm"
title="Confirm"
style={{ maxWidth: screens.xs ? '80%' : '100%' }}
style={{
maxWidth: screens.xs ? '80%' : '100%',
minHeight: MODAL_MIN_HEIGHT,
}}
>
<SummaryCard sshConnection={sshConnection} />
</StepsForm.StepForm>
Expand Down

0 comments on commit cbb475c

Please sign in to comment.