Преглед изворни кода

Merge branch 'master' of spring/comment into master

AdamFu пре 5 година
родитељ
комит
fb5ab36d0e
3 измењених фајлова са 9 додато и 3 уклоњено
  1. 1
    0
      package.json
  2. 7
    3
      src/App.js
  3. 1
    0
      src/components/Editor/index.css

+ 1
- 0
package.json Прегледај датотеку

@@ -17,6 +17,7 @@
17 17
     "antd": "^3.6.6",
18 18
     "axios": "^0.18.0",
19 19
     "dayjs": "^1.7.2",
20
+    "js-cookie": "^2.2.0",
20 21
     "prop-types": "^15.6.2",
21 22
     "react": "^16.4.1",
22 23
     "react-dom": "^16.4.1",

+ 7
- 3
src/App.js Прегледај датотеку

@@ -2,6 +2,7 @@ import React, { Component } from "react";
2 2
 import PropTypes from "prop-types";
3 3
 import { message } from "antd";
4 4
 import axios from "axios";
5
+import Cookies from "js-cookie";
5 6
 import intl from "react-intl-universal";
6 7
 import { ERROR_DEFAULT, LIMIT, COMMENT_TYPE, LANGUAGE_LINK } from "./constant";
7 8
 import { CommentContext } from "./Comment";
@@ -65,10 +66,13 @@ class App extends Component {
65 66
    */
66 67
   loadLocales() {
67 68
     let { locales: currentLocale } = this.props;
69
+    const cookieLang = Cookies.get("lnk_lang");
68 70
     if (!currentLocale) {
69
-      currentLocale = intl.determineLocale({
70
-        urlLocaleKey: "lang"
71
-      });
71
+      currentLocale =
72
+        cookieLang ||
73
+        intl.determineLocale({
74
+          urlLocaleKey: "lang"
75
+        });
72 76
     }
73 77
     currentLocale = SUPPORT_LOCALES.find(item => item.value === currentLocale)
74 78
       ? currentLocale

+ 1
- 0
src/components/Editor/index.css Прегледај датотеку

@@ -62,6 +62,7 @@
62 62
 }
63 63
 
64 64
 .comment-toolbar .comment-toolbar-icon {
65
+  width: 25px;
65 66
   font-size: 23px;
66 67
   cursor: pointer;
67 68
   transition: color 0.3s;