x-star-design 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { LangId } from "../code-mirror-wrapper/define";
|
|
2
|
+
export var langVL = new Map([[LangId.CPP17, 'C++17'], [LangId.CPP14, 'C++14'], [LangId.CPP11, 'C++11'], [LangId.CPP, 'C++'], [LangId.GCC, 'C'], [LangId.FPC, 'Pascal'], [LangId.PY2, 'Python2.7'], [LangId.PY3, 'Python3.8'], [LangId.JAVA, 'Java8'], [LangId.PLAIN, 'plain']]);
|
|
@@ -13,6 +13,7 @@ import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
|
13
13
|
import { useLocale } from "../locales";
|
|
14
14
|
import SubmissionStatus from "../submission-status";
|
|
15
15
|
import { prefix } from "../utils/global";
|
|
16
|
+
import { langVL } from "./define";
|
|
16
17
|
var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
17
18
|
var codeData = _ref.codeData,
|
|
18
19
|
open = _ref.open,
|
|
@@ -38,7 +39,10 @@ var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
|
38
39
|
key: 'language',
|
|
39
40
|
align: 'center',
|
|
40
41
|
title: t('Language'),
|
|
41
|
-
dataIndex: 'language'
|
|
42
|
+
dataIndex: 'language',
|
|
43
|
+
render: function render(language) {
|
|
44
|
+
return langVL.get(language);
|
|
45
|
+
}
|
|
42
46
|
}, {
|
|
43
47
|
key: 'status',
|
|
44
48
|
align: 'center',
|
|
@@ -54,6 +58,7 @@ var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
|
54
58
|
align: 'center',
|
|
55
59
|
title: t('Score'),
|
|
56
60
|
dataIndex: 'score',
|
|
61
|
+
width: 60,
|
|
57
62
|
render: function render(score) {
|
|
58
63
|
return score ? /*#__PURE__*/React.createElement("span", null, score) : '-';
|
|
59
64
|
}
|
|
@@ -71,15 +76,19 @@ var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
|
71
76
|
align: 'center',
|
|
72
77
|
title: t('File'),
|
|
73
78
|
dataIndex: 'link',
|
|
79
|
+
width: 60,
|
|
74
80
|
render: function render(v) {
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
-
href: v
|
|
77
|
-
|
|
81
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
82
|
+
href: v,
|
|
83
|
+
type: "link",
|
|
84
|
+
icon: /*#__PURE__*/React.createElement(DownloadOutlined, null)
|
|
85
|
+
});
|
|
78
86
|
}
|
|
79
87
|
} : {
|
|
80
88
|
key: 'code',
|
|
81
89
|
align: 'center',
|
|
82
90
|
title: t('Code'),
|
|
91
|
+
width: 60,
|
|
83
92
|
render: function render() {
|
|
84
93
|
return /*#__PURE__*/React.createElement("a", {
|
|
85
94
|
rel: "noreferrer",
|
|
@@ -104,7 +113,7 @@ var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
|
104
113
|
},
|
|
105
114
|
open: open,
|
|
106
115
|
onCancel: onCancel,
|
|
107
|
-
width:
|
|
116
|
+
width: 800,
|
|
108
117
|
footer: null
|
|
109
118
|
}, props), /*#__PURE__*/React.createElement(Table, {
|
|
110
119
|
pagination: false,
|
package/dist/locales/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { useCookieState } from 'ahooks';
|
|
3
1
|
import React, { useContext, useRef } from 'react';
|
|
4
2
|
import en_US from "./en_US";
|
|
5
3
|
import zh_CN from "./zh_CN";
|
|
@@ -14,10 +12,7 @@ export var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
14
12
|
};
|
|
15
13
|
export var useLocale = function useLocale(slice) {
|
|
16
14
|
var _zh_CN$en_US$locale;
|
|
17
|
-
var
|
|
18
|
-
_useCookieState2 = _slicedToArray(_useCookieState, 1),
|
|
19
|
-
cookieLang = _useCookieState2[0];
|
|
20
|
-
var locale = useContext(LocaleContext) || cookieLang === 'zh' ? 'zh_CN' : 'en_US';
|
|
15
|
+
var locale = useContext(LocaleContext);
|
|
21
16
|
var message = ((_zh_CN$en_US$locale = {
|
|
22
17
|
zh_CN: zh_CN,
|
|
23
18
|
en_US: en_US
|