-
-
-
-
- {show ? : }
-
-
-
-
-
-
-
-
+ return (
+
+
+
+
+
+ {data.recipient.length > 0 && {data.recipient}}
+
+
+ {dayjs(data.time).format("HH:mm D/M/YYYY")}
+
+
+
-
{dayjs(data.time).format('HH:ss:mm DD/MM/YYYY')}
-
- );
+
+
+
+
+
+ {show ? : }
+
+
+
+
+
+
+
+
+
+
+
+
+ );
}
diff --git a/src/components/settings.tsx b/src/components/settings.tsx
index cc6c534..5aa7fb4 100644
--- a/src/components/settings.tsx
+++ b/src/components/settings.tsx
@@ -1,11 +1,11 @@
-import { Menu } from "@mantine/core";
-import { IconCode, IconRefresh } from "@tabler/icons-react";
+import { Menu, useMantineColorScheme } from "@mantine/core";
+import { IconCode, IconMoon, IconRefresh, IconSun } from "@tabler/icons-react";
import { ReactNode } from "react";
export interface ISettingsProps {
children: ReactNode;
funtions?: {
- refresh?: () => void
- }
+ refresh?: () => void;
+ };
}
export default function Settings({ children, funtions }: ISettingsProps) {
@@ -13,18 +13,34 @@ export default function Settings({ children, funtions }: ISettingsProps) {
window.ipcRenderer?.openDevTools();
};
+ const {toggleColorScheme, colorScheme}= useMantineColorScheme()
return (
);
diff --git a/src/main.tsx b/src/main.tsx
index f2d9822..b194d5d 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -5,7 +5,7 @@ import '@mantine/core/styles.css';
import "./index.css";
ReactDOM.createRoot(document.getElementById("root")!).render(
-
+
);
diff --git a/src/pages/main.tsx b/src/pages/main.tsx
index 837ad3d..5c0d1a1 100644
--- a/src/pages/main.tsx
+++ b/src/pages/main.tsx
@@ -1,13 +1,15 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
ActionIcon,
+ Avatar,
Box,
LoadingOverlay,
ScrollAreaAutosize,
Tooltip,
+ useMantineColorScheme
} from "@mantine/core";
import { useDisclosure, useViewportSize } from "@mantine/hooks"; // 🔥 thêm cái này
-import { IconDotsVertical, IconMail } from "@tabler/icons-react";
+import { IconDotsVertical } from "@tabler/icons-react";
import { useEffect, useRef, useState } from "react";
import { ConfirmModal, Message, Settings } from "../components";
import { showNotification } from "../ultils/fn";
@@ -19,6 +21,9 @@ function MainPage() {
const [opened, { open, close }] = useDisclosure(false);
const { height } = useViewportSize(); // lấy kích thước cửa sổ
const [clickMessage, setClickMessage] = useState(null);
+
+ const {colorScheme} = useMantineColorScheme();
+
const scrollToBottom = () => {
const viewport = viewportRef.current;
if (viewport) {
@@ -50,7 +55,7 @@ function MainPage() {
close();
showNotification("Thông báo", "Đã xóa note: " + clickMessage?.id);
- setClickMessage(null)
+ setClickMessage(null);
} catch (error) {
console.log("%csrc/pages/mails.tsx:88 error", "color: #007acc;", error);
} finally {
@@ -81,9 +86,9 @@ function MainPage() {
});
}, []);
- const openMailsWindow = () => {
- window.ipcRenderer.invoke("open-new-window");
- };
+ // const openMailsWindow = () => {
+ // window.ipcRenderer.invoke("open-new-window");
+ // };
// 🧠 Tính chiều cao dynamic (ví dụ trừ header 80px + padding 30px)
const scrollAreaHeight = height - 70; // Bạn chỉnh số này nếu muốn
@@ -91,19 +96,24 @@ function MainPage() {
return (
{/* Header */}
-
-
+
+ {/*
{
+
+ showNotification('test', 'test', scrollToBottom)
+ }}
variant="light"
radius="md"
size="lg"
>
-
+ */}
- Zulip Notes
+
+{/*
+ Zulip Notes
*/}
void
+) {
await window.ipcRenderer.invoke("show-notification", {
title,
body,
});
+ callback?.();
}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
index f2ec6bf..e4e921f 100644
--- a/src/vite-env.d.ts
+++ b/src/vite-env.d.ts
@@ -15,6 +15,7 @@ interface IMessage {
sender: string;
time: number;
message: string;
+ recipient:string
}
interface IEmail {