Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 21 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState } from "react";
import React, { useState, Fragment } from "react";
import { Tabs, Tag, Button, Table, Empty, message, Collapse } from "antd";
import marked from "marked";
import hljs from "highlight.js";
import "highlight.js/styles/github.css";

import { copy } from "./utils";
import db from "./db/db";
import { LEETCODE_CN_URL, LEETCODE_URL } from "./constant/index";
import { LEETCODE_CN_URL, LEETCODE_URL, ISSUES_URL } from "./constant/index";

import "antd/dist/antd.css";
import "./App.css";
Expand Down Expand Up @@ -118,7 +118,13 @@ function App() {
</TabPane>
<TabPane tab="关键点" key="1">
{problems[problemId].keyPoints.map(({ id, link, text, color }) => (
<TagOrLink key={text} text={text} link={link} color={color} />
<TagOrLink
key={text}
text={text}
link={link}
color={color}
style={{ marginBottom: 6 }}
/>
))}
</TabPane>
<TabPane tab="题解" key="2">
Expand Down Expand Up @@ -147,11 +153,12 @@ function App() {
<Button
type="primary"
size="small"
onClick={() =>
onClick={(e) => {
e.stopPropagation();
copy(c.text, () => {
message.success("复制成功~");
})
}
});
}}
>
复制
</Button>
Expand Down Expand Up @@ -187,7 +194,14 @@ function App() {
</div>
</TabPane>
<TabPane tab="公司" key="4">
{problems[problemId].company.map((c) => c.name).join(",")}
{problems[problemId].company.map((c) => c.name).join(",") || (
<Fragment>
暂无公司资料,
<a href={ISSUES_URL} target="_blank">
点击反馈
</a>
</Fragment>
)}
</TabPane>
<TabPane
tab="可视化调试(敬请期待)"
Expand Down
1 change: 1 addition & 0 deletions src/constant/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const LEETCODE_CN_URL = "https://leetcode-cn.com";
export const LEETCODE_URL = "https://leetcode.com";
export const ISSUES_URL = "https://github.com/azl397985856/leetcode/issues/";
4 changes: 0 additions & 4 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
a {
color: #000;
text-decoration: none;
}