Skip to content

Commit

Permalink
feat: add changelog button
Browse files Browse the repository at this point in the history
  • Loading branch information
yb6b committed Jul 9, 2024
1 parent 3d17334 commit 2caa146
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
33 changes: 33 additions & 0 deletions src/components/changelog/ChangelogDrawer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useState, useEffect, useRef, useReducer } from "react";
import * as A from "antd";
import * as atoms from "~/atoms";

//#region ChangelogDrawer default component
export interface ChangelogDrawerProps {}
export default function ChangelogDrawer(props: ChangelogDrawerProps) {
const Content = React.lazy(() => import("./changelog.mdx"));
const [open, setOpen] = useState(false);

return (
<>
<A.Button type="link" size="small" onClick={() => setOpen(true)}>
更新历史
</A.Button>
<A.Drawer
title="更新历史"
onClose={() => setOpen(false)}
closable
destroyOnClose
placement="right"
open={open}
>
<React.Suspense fallback="Loading...">
<div className="prose">
<Content />
</div>
</React.Suspense>
</A.Drawer>
</>
);
}
//#endregion
8 changes: 4 additions & 4 deletions src/components/changelog/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# v0.1.13
## v0.1.13

1. 支持加载三键、四键当量模型
2. 支持差指法的分级数量统计

# v0.1.12
## v0.1.12

1. 所有计算操作自动化,减少人机交互
2. 在编码页面实时计算基本的测评数据
3. 增加码表层面的统计功能(序列表层面的为「统计一」,码表层面的为「统计二」)

# v0.1.11
## v0.1.11

1. 修复 libchai 不支持固定键位的 bug
2. 修复 libchai 在网页上计算 7 码以上方案的溢出问题
3. 增强了序列表层面的分析功能
4. 用户体验优化

# v0.1.10
## v0.1.10

1. 支持设置词间速度当量和差指法的权重
2. 支持自定义字音
2 changes: 2 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { md5 } from "js-md5";
import { useChaifenTitle, validateConfig } from "~/atoms";
import { MenuProps } from "antd/lib";
import styled from "styled-components";
import Changelog from "~/components/changelog/ChangelogDrawer";

type Status = "login" | "signup" | "signin";

Expand Down Expand Up @@ -310,6 +311,7 @@ export default function HomeLayout() {
<Typography.Title level={3} style={{ marginTop: "-2rem" }}>
v{APP_VERSION}
</Typography.Title>
<Changelog />
<Typography.Text>
© 汉字自动拆分开发团队 2019 - {new Date().getFullYear()}
</Typography.Text>
Expand Down

0 comments on commit 2caa146

Please sign in to comment.