x-star-design 0.0.23 → 0.0.25
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.
package/dist/locales/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { useCookieState } from 'ahooks';
|
|
1
3
|
import React, { useContext, useRef } from 'react';
|
|
2
4
|
import en_US from "./en_US";
|
|
3
5
|
import zh_CN from "./zh_CN";
|
|
@@ -12,7 +14,10 @@ export var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
12
14
|
};
|
|
13
15
|
export var useLocale = function useLocale(slice) {
|
|
14
16
|
var _zh_CN$en_US$locale;
|
|
15
|
-
var
|
|
17
|
+
var _useCookieState = useCookieState('lang'),
|
|
18
|
+
_useCookieState2 = _slicedToArray(_useCookieState, 1),
|
|
19
|
+
cookieLang = _useCookieState2[0];
|
|
20
|
+
var locale = useContext(LocaleContext) || (cookieLang === 'zh' ? 'zh_CN' : 'en_US');
|
|
16
21
|
var message = ((_zh_CN$en_US$locale = {
|
|
17
22
|
zh_CN: zh_CN,
|
|
18
23
|
en_US: en_US
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
type SubmissionStatusProps = {
|
|
3
3
|
status: string;
|
|
4
4
|
className?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
style?: React.CSSProperties;
|
|
5
7
|
};
|
|
6
|
-
declare const SubmissionStatus: ({ className, status }: SubmissionStatusProps) => React.JSX.Element;
|
|
8
|
+
declare const SubmissionStatus: ({ className, status, onClick, style, }: SubmissionStatusProps) => React.JSX.Element;
|
|
7
9
|
export default SubmissionStatus;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import classNames from 'classnames';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
var scopeColor = new Map([['Accepted', '#00ad07'], ['Wrong Answer', '#f44336'], ['Time Limit Exceeded', '#56A2F5'], ['Compile Error', '#F5B13D'], ['Runtime Error', '#F56ED3'], ['Memory Limit Exceeded', '#9256F5'], ['Running', 'orange'], ['Testing', '#818181'], ['Abnormal', '#9256F5'], ['Pending', 'orange']]);
|
|
4
5
|
var SubmissionStatus = function SubmissionStatus(_ref) {
|
|
5
6
|
var className = _ref.className,
|
|
6
|
-
status = _ref.status
|
|
7
|
+
status = _ref.status,
|
|
8
|
+
onClick = _ref.onClick,
|
|
9
|
+
style = _ref.style;
|
|
7
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
11
|
className: classNames(className),
|
|
9
|
-
style: {
|
|
12
|
+
style: _objectSpread({
|
|
10
13
|
fontWeight: 'bold',
|
|
11
14
|
color: scopeColor.get(status)
|
|
12
|
-
}
|
|
15
|
+
}, style),
|
|
16
|
+
onClick: onClick
|
|
13
17
|
}, status);
|
|
14
18
|
};
|
|
15
19
|
export default SubmissionStatus;
|
|
@@ -3,6 +3,7 @@ type TitleWithIconProps = {
|
|
|
3
3
|
title: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
id?: string;
|
|
6
7
|
};
|
|
7
|
-
declare const TitleWithIcon: ({ className, title, description, }: TitleWithIconProps) => React.JSX.Element;
|
|
8
|
+
declare const TitleWithIcon: ({ className, title, description, id, }: TitleWithIconProps) => React.JSX.Element;
|
|
8
9
|
export default TitleWithIcon;
|
|
@@ -5,9 +5,11 @@ import { prefix } from "../utils/global";
|
|
|
5
5
|
var TitleWithIcon = function TitleWithIcon(_ref) {
|
|
6
6
|
var className = _ref.className,
|
|
7
7
|
title = _ref.title,
|
|
8
|
-
description = _ref.description
|
|
8
|
+
description = _ref.description,
|
|
9
|
+
id = _ref.id;
|
|
9
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
className: classNames(className, "".concat(prefix, "titleSection"))
|
|
11
|
+
className: classNames(className, "".concat(prefix, "titleSection")),
|
|
12
|
+
id: id
|
|
11
13
|
}, /*#__PURE__*/React.createElement("img", {
|
|
12
14
|
src: rightSvg,
|
|
13
15
|
alt: ""
|