Skip to content

Commit 915998f

Browse files
committed
💄 优化颜色面板和快速启动面板的UI
1 parent aa02426 commit 915998f

File tree

3 files changed

+178
-76
lines changed

3 files changed

+178
-76
lines changed

app/src/pages/_start_file_panel.tsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
FolderTree,
1010
HardDriveDownload,
1111
Pin,
12+
PinOff,
1213
RefreshCw,
1314
Trash2,
1415
} from "lucide-react";
@@ -265,14 +266,18 @@ export default function StartFilePanel({ open = false }: { open: boolean }) {
265266
</td>
266267
)}
267268
<td className="flex justify-center">
268-
<button className="mx-0.5 px-2 py-1" onClick={onLoadCurrentStartFile(file.path)}>
269-
<HardDriveDownload />
269+
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onLoadCurrentStartFile(file.path)}>
270+
<HardDriveDownload className="hover:cursor-pointer" />
270271
</button>
271-
<button className="mx-0.5 px-2 py-1" onClick={onSetCurrentStartFile(file.path)}>
272-
<Pin />
272+
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onSetCurrentStartFile(file.path)}>
273+
{currentStartFile === file.path ? (
274+
<Pin className="hover:cursor-pointer" />
275+
) : (
276+
<PinOff className="hover:cursor-pointer" />
277+
)}
273278
</button>
274-
<button className="mx-0.5 px-2 py-1" onClick={onRemoveFile(file.path)}>
275-
<Delete />
279+
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onRemoveFile(file.path)}>
280+
<Delete className="hover:cursor-pointer" />
276281
</button>
277282
</td>
278283
</tr>
@@ -281,10 +286,19 @@ export default function StartFilePanel({ open = false }: { open: boolean }) {
281286
</table>
282287
<div>
283288
<div className="text-panel-details-text mt-3 text-sm">
284-
<p>{t("tips.0")}</p>
285-
<p>{t("tips.1")}</p>
286-
<p>{t("tips.2")}</p>
287-
<p>{t("tips.3")}</p>
289+
<p className="flex h-8 items-center">{t("tips.0")}</p>
290+
<p className="flex h-8 items-center">
291+
<HardDriveDownload />
292+
{t("tips.1")}
293+
</p>
294+
<p className="flex h-8 items-center">
295+
<Pin />
296+
{t("tips.2")}
297+
</p>
298+
<p className="flex h-8 items-center">
299+
<Delete />
300+
{t("tips.3")}
301+
</p>
288302
</div>
289303
<div>
290304
<div className="flex flex-nowrap items-center justify-center">

app/src/pages/_toolbar.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function ColorPanel() {
7979
});
8080
}, []);
8181
return (
82-
<>
82+
<div className="bg-panel-bg rounded-lg">
8383
<div className="flex flex-wrap items-center justify-center">
8484
<div
8585
className="m-1 h-5 w-5 cursor-pointer rounded-full bg-red-500 hover:scale-125"
@@ -126,7 +126,9 @@ export function ColorPanel() {
126126
>
127127
<span>x</span>
128128
</div>
129-
{/* 自定义 */}
129+
</div>
130+
<div className="flex flex-wrap items-center justify-center">
131+
{/* 临时自定义 */}
130132
<input
131133
type="color"
132134
id="colorPicker"
@@ -165,7 +167,7 @@ export function ColorPanel() {
165167
);
166168
})}
167169
</div>
168-
</>
170+
</div>
169171
);
170172
}
171173

@@ -178,12 +180,12 @@ function GenerateNodePanel() {
178180
const [indention, setIndention] = useState(4);
179181

180182
return (
181-
<div className="flex flex-col gap-4">
183+
<div className="bg-panel-bg flex flex-col gap-4 rounded-lg p-2">
182184
<Input value={inputValue} onChange={setInputValue} multiline />
183185
<div>
184-
<span>缩进</span>
186+
<span className="text-panel-text">缩进数量</span>
185187
<Input value={indention.toString()} onChange={setIndention} number />
186-
<p className="text-xs text-neutral-400">会按照您的缩进等级来生成对应的节点结构</p>
188+
<p className="text-panel-details-text text-xs">会按照您的缩进等级来生成对应的节点结构</p>
187189
</div>
188190
<Button
189191
onClick={() => {

0 commit comments

Comments
 (0)