diff --git a/package.json b/package.json index 5bbcf47..fbaea06 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "react-transition-group": "^4.4.1", "semver": "6.3.0", "ts-pnp": "1.1.6", - "velocity-animate": "^1.5.2" + "velocity-animate": "^1.5.2", + "velocity-react": "^1.4.3" }, "scripts": { "start": "node scripts/start.js", diff --git a/src/pages/matter/widget/MatterPanel.tsx b/src/pages/matter/widget/MatterPanel.tsx index 2cd43bb..f1accb8 100644 --- a/src/pages/matter/widget/MatterPanel.tsx +++ b/src/pages/matter/widget/MatterPanel.tsx @@ -1,5 +1,6 @@ import React from "react"; import copy from "copy-to-clipboard"; +import VelocityReact from 'velocity-react'; import Matter from "../../../common/model/matter/Matter"; import TankComponent from "../../../common/component/TankComponent"; import Director from "./Director"; @@ -204,13 +205,7 @@ export default class MatterPanel extends TankComponent { }; toggleHandles = () => { - this.transitionStatus = !this.transitionStatus; - if (this.transitionStatus) this.showMore = true; - this.updateUI(); - }; - - onExited = () => { - this.showMore = false; + this.showMore = !this.showMore; this.updateUI(); }; @@ -342,90 +337,95 @@ export default class MatterPanel extends TankComponent { - - {this.showMore ? ( -
-
- {DateUtil.simpleDateHourMinute(matter.updateTime)} - + + + + {this.showMore ? ( +
+
+
+ {DateUtil.simpleDateHourMinute(matter.updateTime)} + {StringUtil.humanFileSize(matter.size)} -
+
- {!matter.dir && matter.privacy && ( -
- SafeUtil.stopPropagationWrap(e)(this.changePrivacy(false)) - } - > - - 设置为公有文件 + {!matter.dir && matter.privacy && ( +
+ SafeUtil.stopPropagationWrap(e)(this.changePrivacy(false)) + } + > + + 设置为公有文件 +
+ )} + + {!matter.dir && !matter.privacy && ( +
+ SafeUtil.stopPropagationWrap(e)(this.changePrivacy(true)) + } + > + + 设置为私有文件 +
+ )} + +
+ SafeUtil.stopPropagationWrap(e)( + Sun.navigateTo("/matter/detail/" + matter.uuid) + ) + } + > + + 文件详情 +
+
+ SafeUtil.stopPropagationWrap(e)(this.prepareRename()) + } + > + + 重命名 +
+
+ SafeUtil.stopPropagationWrap(e)(this.clipboard()) + } + > + + 复制下载链接 +
+
+ SafeUtil.stopPropagationWrap(e)(matter.download()) + } + > + + 下载 +
+
+ SafeUtil.stopPropagationWrap(e)(this.deleteMatter()) + } + > + + 删除 +
- )} +
+ ) : undefined} +
- {!matter.dir && !matter.privacy && ( -
- SafeUtil.stopPropagationWrap(e)(this.changePrivacy(true)) - } - > - - 设置为私有文件 -
- )} - -
- SafeUtil.stopPropagationWrap(e)( - Sun.navigateTo("/matter/detail/" + matter.uuid) - ) - } - > - - 文件详情 -
-
- SafeUtil.stopPropagationWrap(e)(this.prepareRename()) - } - > - - 重命名 -
-
- SafeUtil.stopPropagationWrap(e)(this.clipboard()) - } - > - - 复制下载链接 -
-
- SafeUtil.stopPropagationWrap(e)(matter.download()) - } - > - - 下载 -
-
- SafeUtil.stopPropagationWrap(e)(this.deleteMatter()) - } - > - - 删除 -
-
- ) : null} -
); } diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index fc788c1..be7989f 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -69,3 +69,8 @@ declare module 'velocity-animate' { import Velocity from 'velocity-animate'; export default Velocity; } + +declare module 'velocity-react' { + import VelocityReact from 'velocity-react'; + export default VelocityReact; +}