mirror of
https://github.com/lordmathis/lemma.git
synced 2025-12-25 19:04:22 +00:00
Migrate all modals to ts
This commit is contained in:
@@ -2,12 +2,18 @@ import React, { useState } from 'react';
|
||||
import { Modal, TextInput, Button, Group, Box } from '@mantine/core';
|
||||
import { useModalContext } from '../../../contexts/ModalContext';
|
||||
|
||||
const CommitMessageModal = ({ onCommitAndPush }) => {
|
||||
interface CommitMessageModalProps {
|
||||
onCommitAndPush: (message: string) => Promise<void>;
|
||||
}
|
||||
|
||||
const CommitMessageModal: React.FC<CommitMessageModalProps> = ({
|
||||
onCommitAndPush,
|
||||
}) => {
|
||||
const [message, setMessage] = useState('');
|
||||
const { commitMessageModalVisible, setCommitMessageModalVisible } =
|
||||
useModalContext();
|
||||
|
||||
const handleSubmit = async () => {
|
||||
const handleSubmit = async (): Promise<void> => {
|
||||
if (message) {
|
||||
await onCommitAndPush(message);
|
||||
setMessage('');
|
||||
Reference in New Issue
Block a user