Spaces:
Sleeping
Sleeping
update app.css home.jsx to adjust homepage layout
Browse files- src/components/Home.jsx +7 -7
src/components/Home.jsx
CHANGED
|
@@ -67,7 +67,7 @@ function Home({ setActiveTab, role, setRole }) {
|
|
| 67 |
}
|
| 68 |
} else {
|
| 69 |
const pwd = window.prompt("Enter Admin Password:");
|
| 70 |
-
if (pwd === "
|
| 71 |
try {
|
| 72 |
await fetch('/api/history', { method: 'DELETE' });
|
| 73 |
const res = await fetch('/test_data.json');
|
|
@@ -96,23 +96,23 @@ function Home({ setActiveTab, role, setRole }) {
|
|
| 96 |
<h1>FocusGuard</h1>
|
| 97 |
<p>Your productivity monitor assistant.</p>
|
| 98 |
|
| 99 |
-
{/*
|
| 100 |
-
<div
|
| 101 |
|
| 102 |
-
<button className="btn-main" onClick={handleNewStart}
|
| 103 |
Start Focus
|
| 104 |
</button>
|
| 105 |
|
| 106 |
-
<button className="btn-main" onClick={handleAutoImport}
|
| 107 |
Auto Import History
|
| 108 |
</button>
|
| 109 |
|
| 110 |
-
<button className="btn-main" onClick={() => fileInputRef.current.click()}
|
| 111 |
Manual Import History
|
| 112 |
</button>
|
| 113 |
<input type="file" ref={fileInputRef} style={{ display: 'none' }} accept=".json" onChange={handleFileChange} />
|
| 114 |
|
| 115 |
-
<button className="btn-main" onClick={handleAdminToggle}
|
| 116 |
{role === 'admin' ? 'Switch to User Mode' : 'Admin Login'}
|
| 117 |
</button>
|
| 118 |
|
|
|
|
| 67 |
}
|
| 68 |
} else {
|
| 69 |
const pwd = window.prompt("Enter Admin Password:");
|
| 70 |
+
if (pwd === "123") {
|
| 71 |
try {
|
| 72 |
await fetch('/api/history', { method: 'DELETE' });
|
| 73 |
const res = await fetch('/test_data.json');
|
|
|
|
| 96 |
<h1>FocusGuard</h1>
|
| 97 |
<p>Your productivity monitor assistant.</p>
|
| 98 |
|
| 99 |
+
{/* 使用全新的 2x2 网格容器 */}
|
| 100 |
+
<div className="home-button-grid">
|
| 101 |
|
| 102 |
+
<button className="btn-main" onClick={handleNewStart}>
|
| 103 |
Start Focus
|
| 104 |
</button>
|
| 105 |
|
| 106 |
+
<button className="btn-main" onClick={handleAutoImport}>
|
| 107 |
Auto Import History
|
| 108 |
</button>
|
| 109 |
|
| 110 |
+
<button className="btn-main" onClick={() => fileInputRef.current.click()}>
|
| 111 |
Manual Import History
|
| 112 |
</button>
|
| 113 |
<input type="file" ref={fileInputRef} style={{ display: 'none' }} accept=".json" onChange={handleFileChange} />
|
| 114 |
|
| 115 |
+
<button className="btn-main" onClick={handleAdminToggle}>
|
| 116 |
{role === 'admin' ? 'Switch to User Mode' : 'Admin Login'}
|
| 117 |
</button>
|
| 118 |
|