Skip to content

Commit

Permalink
more modal styles cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Nov 29, 2023
1 parent 970d696 commit 0deeaee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/components/File/NewNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ const NewNoteComponent: React.FC<NewNoteComponentProps> = ({

return (
<Modal isOpen={isOpen} onClose={onClose}>
<div className="mr-6">
<h2 className="text-2xl font-semibold mb-4 text-white">
<div className="ml-2 mr-6 mt-0 h-full min-w-[400px]">
<h2 className="text-xl font-semibold mb-4 text-white">
Create New Note
</h2>
<input
type="text"
className="form-input block w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out"
className="block w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out"
value={fileName}
onChange={(e) => setFileName(e.target.value)}
onKeyDown={handleKeyPress}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Generic/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const Modal: React.FC<ModalProps> = ({ isOpen, onClose, children }) => {
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50">
<div
ref={modalRef}
className="bg-gray-800 rounded-lg shadow-xl w-full max-w-lg p-2"
className="flex bg-gray-800 rounded-lg shadow-xl max-w-lg p-2"
>
{children}
<div className="flex justify-end">
<button
onClick={onClose}
Expand All @@ -40,7 +41,6 @@ const Modal: React.FC<ModalProps> = ({ isOpen, onClose, children }) => {
<span className="text-3xl leading-none">&times;</span>
</button>
</div>
{children}
</div>
</div>
);
Expand Down
20 changes: 14 additions & 6 deletions src/components/Settings/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,26 @@ const SettingsModal: React.FC<ModalProps> = ({ isOpen, onClose }) => {

if (!isOpen) return null;

const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === "Enter") {
handleSave();
}
};

return (
<Modal isOpen={isOpen} onClose={onClose}>
<div className=" text-white rounded-lg p-5">
<h2 className="text-xl mb-4">OpenAI Key Settings</h2>
<div className="ml-2 mr-6 mt-0 h-full min-w-[400px]">
<h2 className="text-xl font-semibold mb-4 text-white">
Open AI Key Settings
</h2>
<input
type="password" // Changed to password type
className="w-full p-2 text-black"
placeholder="Enter your OpenAI Key"
type="text"
className="block w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out"
value={openAIKey}
onChange={(e) => setOpenAIKey(e.target.value)}
onKeyDown={handleKeyPress}
placeholder="Note Name"
/>

<Button
className="mt-2 border-none h-10 hover:bg-slate-800 cursor-pointer"
onClick={handleSave}
Expand Down

0 comments on commit 0deeaee

Please sign in to comment.