Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 点击存储路径即可打开至文件资源管理器 #516

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/pages/Backup/components/SavePath/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import ProList from "@/components/ProList";
import ProListItem from "@/components/ProListItem";
import { open } from "@tauri-apps/api/dialog";
import { emit } from "@tauri-apps/api/event";
import { join } from "@tauri-apps/api/path";
import { join, sep } from "@tauri-apps/api/path";
import { Button, Flex, message } from "antd";
import { isString } from "antd/es/button";
import type { FC } from "react";
import { useSnapshot } from "valtio";
import type { State } from "../..";

const SavePath: FC<{ state: State }> = (props) => {
const { state } = props;
const { env } = useSnapshot(globalStore);

const handleClick = async () => {
try {
Expand Down Expand Up @@ -43,9 +41,16 @@ const SavePath: FC<{ state: State }> = (props) => {
<ProList header="存储路径">
<ProListItem
title={
<Flex vertical gap={2}>
<Flex vertical align="flex-start" gap={2}>
自定义存储路径
<span className="color-3 break-all text-12">{env.saveDataDir}</span>
<span
className="color-3 hover:color-primary cursor-pointer break-all text-12 transition"
onMouseDown={() => {
previewPath(getSaveDataDir());
}}
>
{getSaveDataDir().replace(new RegExp(`${sep}$`, "g"), "")}
</span>
</Flex>
}
>
Expand Down