From 83c31c124160967e7c78bd3928c3bde73d69c212 Mon Sep 17 00:00:00 2001
From: zihanjian
Date: Fri, 16 May 2025 23:09:47 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20DonationModal=20=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=B9=B6=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E9=80=BB?=
=?UTF-8?q?=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96=E6=8D=90=E8=B5=A0=E5=BC=B9?=
=?UTF-8?q?=E7=AA=97=E7=9A=84=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F=EF=BC=8C?=
=?UTF-8?q?=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=E5=92=8C?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8F=AF=E8=AF=BB=E6=80=A7=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/page.tsx | 74 +++-----------------------------
src/components/DonationModal.tsx | 66 ++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 69 deletions(-)
create mode 100644 src/components/DonationModal.tsx
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 11582f1..9b4c651 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -117,6 +117,9 @@ import GridTooltip from '../components/GridTooltip';
import CustomPaletteEditor from '../components/CustomPaletteEditor';
import { loadPaletteSelections, savePaletteSelections, presetToSelections, PaletteSelections } from '../utils/localStorageUtils';
+// 1. 导入新的 DonationModal 组件
+import DonationModal from '../components/DonationModal';
+
export default function Home() {
const [originalImageSrc, setOriginalImageSrc] = useState(null);
const [granularity, setGranularity] = useState(50);
@@ -1658,75 +1661,8 @@ export default function Home() {
- {/* Donation Modal */}
- {isDonationModalOpen && (
- // Backdrop remains the same (semi-transparent black)
-
- {/* Apply dark mode styles to the modal container */}
-
-
- {/* Modal header */}
-
- {/* Title gradient likely fine, text color implicitly inherited? Check rendering. */}
-
- {/* SVG colors fine */}
-
- Buy Me A Milk Tea
-
- {/* Close button color */}
-
-
-
- {/* Modal body */}
-
- {/* Text color */}
-
- 开源项目是把作者和用户紧紧联系在一起的社群,如果您希望这个项目继续发展,可以请作者喝一杯奶茶。
-
- {/* Text color */}
-
- 您的支持是作者把项目继续下去的动力。
-
-
- {/* QR Code container */}
-
- {/* Apply dark mode background */}
-
- {/* Image itself is fine */}
-
-
-
-
- {/* Final text bubble */}
- {/* Apply dark mode styles */}
-
- 微信扫描上方赞赏码,请作者喝一杯奶茶。
-
-
-
-
-
- )}
+ {/* Donation Modal - 现在使用新的组件 */}
+ setIsDonationModalOpen(false)} />
{/* 使用导入的下载设置弹窗组件 */}
void;
+}
+
+const DonationModal: React.FC = ({ isOpen, onClose }) => {
+ if (!isOpen) {
+ return null;
+ }
+
+ return (
+
+
+
+
+
+
+ Buy Me A Milk Tea
+
+
+
+
+
+ 开源项目是把作者和用户紧紧联系在一起的社群,如果您希望这个项目继续发展,可以请作者喝一杯奶茶。
+
+
+ 您的支持是作者把项目继续下去的动力。
+
+
+
+ 微信扫描上方赞赏码,请作者喝一杯奶茶。
+
+
+
+
+
+ );
+};
+
+export default DonationModal;
\ No newline at end of file