Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

Refactor: Adjust dimensions and local storage handling in NotesWindow

itzadetunji2819a17ba65f
diff --git a/electron/windows.ts b/electron/windows.ts
index 3db5d9660..b0a519b1e 100644
--- a/electron/windows.ts
+++ b/electron/windows.ts
@@ -324,10 +324,12 @@ export function createCountdownOverlayWindow(): BrowserWindow {
// Frameless Notes Window for taking notes during a recording.
export function createNotesWindow(): BrowserWindow {
const win = new BrowserWindow({
- width: 480,
- height: 640,
+ width: 400,
+ height: 540,
minWidth: 320,
minHeight: 400,
+ maxWidth: 640,
+ maxHeight: 720,
title: "Notes",
backgroundColor: "#09090b",
resizable: true,
diff --git a/src/components/launch/NotesWindow.tsx b/src/components/launch/NotesWindow.tsx
index 1e1028c19..3cbf2b4a8 100644
--- a/src/components/launch/NotesWindow.tsx
+++ b/src/components/launch/NotesWindow.tsx
@@ -1,16 +1,21 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
export function NotesWindow() {
const [notes, setNotes] = useState("");
const handleNotesChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+ localStorage.setItem("notes", e.target.value);
setNotes(e.target.value);
};
+ useEffect(() => {
+ setNotes(localStorage.getItem("notes") ?? "");
+ }, []);
+
return (
- <div className="bg-red-900 h-screen w-screen ">
+ <div className="bg-white h-screen w-screen px-6 py-4">
<textarea
- className="w-full h-full bg-transparent outline-none resize-none"
+ className="w-full h-full bg-transparent outline-none resize-none caret-black text-black"
placeholder="Take notes here..."
value={notes}
onChange={handleNotesChange}