Browse Source

Merge branch 'master' into feature-merge-master

pull/40557/head
MadCcc 2 years ago
parent
commit
0f5ce3f94d
  1. 7
      .dumi/theme/builtins/Previewer/index.tsx
  2. 2
      .github/PULL_REQUEST_TEMPLATE/pr_cn.md
  3. 2
      package.json

7
.dumi/theme/builtins/Previewer/index.tsx

@ -87,9 +87,12 @@ const Demo: React.FC<DemoProps> = (props) => {
const { theme } = useContext<SiteContextProps>(SiteContext);
const { hash, pathname, search } = location;
const isDev = process.env.NODE_ENV === 'development';
const docsOnlineUrl = `https://ant.design${pathname}${search}#${meta.id}`;
const regexp = /preview-(\d+)-ant-design/; // matching PR preview addresses
const showOnlineUrl =
process.env.NODE_ENV === 'development' || regexp.test(window.location.hostname);
const handleCodeExpand = (demo: string) => {
setCodeExpand((prev) => !prev);
track({ type: 'expand', demo });
@ -347,7 +350,7 @@ const Demo: React.FC<DemoProps> = (props) => {
</div>
<div className="code-box-description">{introChildren}</div>
<Space wrap size="middle" className="code-box-actions">
{isDev && (
{showOnlineUrl && (
<Tooltip title={<FormattedMessage id="app.demo.online" />}>
<a
className="code-box-code-action"

2
.github/PULL_REQUEST_TEMPLATE/pr_cn.md

@ -24,12 +24,14 @@
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 工作流程
- [ ] 其他改动(是关于什么的改动?)
### 🔗 相关 Issue
<!--
1. 描述相关需求的来源,如相关的 issue 讨论链接。
2. 例如 close #xxxx、 fix #xxxx
-->
### 💡 需求背景和解决方案

2
package.json

@ -208,7 +208,7 @@
"eslint-config-airbnb": "^19.0.0",
"eslint-config-prettier": "^8.0.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-compat": "^4.0.0",
"eslint-plugin-compat": "~4.0.0",
"eslint-plugin-import": "^2.21.1",
"eslint-plugin-jest": "^27.0.1",
"eslint-plugin-jsx-a11y": "^6.2.1",

Loading…
Cancel
Save