From 612f36c2b2f6e90b73476430cdeb4a95933c7aec Mon Sep 17 00:00:00 2001 From: Eddy Meals Date: Wed, 4 Dec 2024 19:49:54 -0800 Subject: [PATCH] Change default props types again --- src/renderer/editor/ApiLink.tsx | 4 ++-- src/renderer/editor/HighlightedCode.tsx | 4 ++-- src/renderer/modals/ConfirmModal.tsx | 4 ++-- src/renderer/modals/Modal.tsx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/renderer/editor/ApiLink.tsx b/src/renderer/editor/ApiLink.tsx index 3013f0d..371e9f3 100644 --- a/src/renderer/editor/ApiLink.tsx +++ b/src/renderer/editor/ApiLink.tsx @@ -10,11 +10,11 @@ import './ApiLink.css'; */ export default function ApiLink({ dest, - code, + code = false, children, }: { dest: string; - code: boolean; + code?: boolean; children: string; }) { const text = `(${children})[${dest}]`; diff --git a/src/renderer/editor/HighlightedCode.tsx b/src/renderer/editor/HighlightedCode.tsx index 928e707..afff260 100644 --- a/src/renderer/editor/HighlightedCode.tsx +++ b/src/renderer/editor/HighlightedCode.tsx @@ -13,10 +13,10 @@ import './HighlightedCode.css'; */ export default function HighlightedCode({ children, - indent, + indent = 0, }: { children: string; - indent: number; + indent?: number; }) { const lines = children.split('\n'); if (lines.length && !lines[0].trim()) { diff --git a/src/renderer/modals/ConfirmModal.tsx b/src/renderer/modals/ConfirmModal.tsx index 71dc581..1c2ce99 100644 --- a/src/renderer/modals/ConfirmModal.tsx +++ b/src/renderer/modals/ConfirmModal.tsx @@ -16,14 +16,14 @@ export default function ConfirmModal({ onConfirm, isActive, modalTitle, - noAutoClose, + noAutoClose = false, children, }: { onClose: () => void; onConfirm: () => void; isActive: boolean; modalTitle: string; - noAutoClose: boolean; + noAutoClose?: boolean; children: ReactNode; }) { const handleConfirm = () => { diff --git a/src/renderer/modals/Modal.tsx b/src/renderer/modals/Modal.tsx index ece7df8..77379a2 100644 --- a/src/renderer/modals/Modal.tsx +++ b/src/renderer/modals/Modal.tsx @@ -14,13 +14,13 @@ export default function Modal({ isActive, modalTitle, children, - className, + className = '', }: { onClose: () => void; isActive: boolean; modalTitle: string; + className?: string; children: ReactNode; - className: string; }) { return (