|
1 |
| -import React, { useState } from "react"; |
| 1 | +import React, { useState, Fragment } from "react"; |
2 | 2 | import { Tabs, Tag, Button, Table, Empty, message, Collapse } from "antd";
|
3 | 3 | import marked from "marked";
|
4 | 4 | import hljs from "highlight.js";
|
5 | 5 | import "highlight.js/styles/github.css";
|
6 | 6 |
|
7 | 7 | import { copy } from "./utils";
|
8 | 8 | import db from "./db/db";
|
9 |
| -import { LEETCODE_CN_URL, LEETCODE_URL } from "./constant/index"; |
| 9 | +import { LEETCODE_CN_URL, LEETCODE_URL, ISSUES_URL } from "./constant/index"; |
10 | 10 |
|
11 | 11 | import "antd/dist/antd.css";
|
12 | 12 | import "./App.css";
|
@@ -118,7 +118,13 @@ function App() {
|
118 | 118 | </TabPane>
|
119 | 119 | <TabPane tab="关键点" key="1">
|
120 | 120 | {problems[problemId].keyPoints.map(({ id, link, text, color }) => (
|
121 |
| - <TagOrLink key={text} text={text} link={link} color={color} /> |
| 121 | + <TagOrLink |
| 122 | + key={text} |
| 123 | + text={text} |
| 124 | + link={link} |
| 125 | + color={color} |
| 126 | + style={{ marginBottom: 6 }} |
| 127 | + /> |
122 | 128 | ))}
|
123 | 129 | </TabPane>
|
124 | 130 | <TabPane tab="题解" key="2">
|
@@ -147,11 +153,12 @@ function App() {
|
147 | 153 | <Button
|
148 | 154 | type="primary"
|
149 | 155 | size="small"
|
150 |
| - onClick={() => |
| 156 | + onClick={(e) => { |
| 157 | + e.stopPropagation(); |
151 | 158 | copy(c.text, () => {
|
152 | 159 | message.success("复制成功~");
|
153 |
| - }) |
154 |
| - } |
| 160 | + }); |
| 161 | + }} |
155 | 162 | >
|
156 | 163 | 复制
|
157 | 164 | </Button>
|
@@ -187,7 +194,14 @@ function App() {
|
187 | 194 | </div>
|
188 | 195 | </TabPane>
|
189 | 196 | <TabPane tab="公司" key="4">
|
190 |
| - {problems[problemId].company.map((c) => c.name).join(",")} |
| 197 | + {problems[problemId].company.map((c) => c.name).join(",") || ( |
| 198 | + <Fragment> |
| 199 | + 暂无公司资料, |
| 200 | + <a href={ISSUES_URL} target="_blank"> |
| 201 | + 点击反馈 |
| 202 | + </a> |
| 203 | + </Fragment> |
| 204 | + )} |
191 | 205 | </TabPane>
|
192 | 206 | <TabPane
|
193 | 207 | tab="可视化调试(敬请期待)"
|
|
0 commit comments