Skip to content

Commit

Permalink
WIP: модальное окно для получения адреса МС-ТЮК
Browse files Browse the repository at this point in the history
  • Loading branch information
Roundabout1 committed Sep 11, 2024
1 parent 13831f0 commit c1c5dc0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/renderer/src/components/AddressModalMS.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Modal } from '@renderer/components/UI';

interface AddressModalMSProps {
isOpen: boolean;
onClose: () => void;
}

export const AddressModalMS: React.FC<AddressModalMSProps> = ({ onClose, ...props }) => {
return (
<Modal {...props} onRequestClose={onClose} title="Адрес">
<div>Текст</div>
</Modal>
);
};
5 changes: 5 additions & 0 deletions src/renderer/src/components/ManagerMS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
*/
import { useState } from 'react';

import { useModal } from '@renderer/hooks';
import { useSerialMonitor } from '@renderer/store/useSerialMonitor';
import { Device } from '@renderer/types/FlasherTypes';

import { AddressModalMS } from './AddressModalMS';
import { Flasher } from './Modules/Flasher';
import { ManagerMS } from './Modules/ManagerMS';
import { TextField } from './UI';
Expand All @@ -18,9 +20,11 @@ export const ManagerMSTab: React.FC<ManagerMSProps> = ({ device }) => {
const { device: serialMonitorDevice, connectionStatus: serialConnectionStatus } =
useSerialMonitor();
const [address, setAddress] = useState<string>('');
const [isAddressModalOpen, openAddressModal, closeAddressModal] = useModal(false);
const handleGetAddress = () => {
if (!device) return;
ManagerMS.getAddress(device.deviceID);
openAddressModal();
};
const handleSendBin = () => {
if (!device) return;
Expand Down Expand Up @@ -61,6 +65,7 @@ export const ManagerMSTab: React.FC<ManagerMSProps> = ({ device }) => {
Пинг
</button>
</div>
<AddressModalMS isOpen={isAddressModalOpen} onClose={closeAddressModal}></AddressModalMS>
</section>
);
};

0 comments on commit c1c5dc0

Please sign in to comment.