Browse Source

Ajout de react-intl et les requetes axios ont été déplacées

Lou 3 years ago
parent
commit
c013b7657a

+ 1
- 0
package.json View File

15
     "jwt-decode": "^3.1.2",
15
     "jwt-decode": "^3.1.2",
16
     "react": "^17.0.0",
16
     "react": "^17.0.0",
17
     "react-dom": "^17.0.0",
17
     "react-dom": "^17.0.0",
18
+    "react-intl": "^5.20.6",
18
     "react-redux": "^7.2.4",
19
     "react-redux": "^7.2.4",
19
     "react-router-dom": "^5.2.0",
20
     "react-router-dom": "^5.2.0",
20
     "redux": "^4.1.0",
21
     "redux": "^4.1.0",

+ 1
- 1
src/components/forms/LoginForm/index.jsx View File

4
 import jwt_decode from "jwt-decode";
4
 import jwt_decode from "jwt-decode";
5
 import Cookies from "js-cookie";
5
 import Cookies from "js-cookie";
6
 
6
 
7
-import post from "../../../services/request/Post";
7
+import post from "../../../tools/request/Post";
8
 import { setCurrentUser } from "../../../redux/action";
8
 import { setCurrentUser } from "../../../redux/action";
9
 import "./index.scss";
9
 import "./index.scss";
10
 
10
 

+ 1
- 1
src/components/forms/SignupForm/index.jsx View File

1
 import React, { useState, useEffect } from "react";
1
 import React, { useState, useEffect } from "react";
2
 import { useHistory } from "react-router-dom";
2
 import { useHistory } from "react-router-dom";
3
 
3
 
4
-import post from "../../../services/request/Post";
4
+import post from "../../../tools/request/Post";
5
 import "./index.scss";
5
 import "./index.scss";
6
 
6
 
7
 const SignupForm = () => {
7
 const SignupForm = () => {

+ 1
- 1
src/components/forms/UserUpdateForm/index.jsx View File

3
 import { useHistory } from "react-router-dom";
3
 import { useHistory } from "react-router-dom";
4
 import Cookies from "js-cookie";
4
 import Cookies from "js-cookie";
5
 
5
 
6
-import update from "../../../services/request/Update";
6
+import update from "../../../tools/request/Update";
7
 import { setCurrentUser } from "../../../redux/action";
7
 import { setCurrentUser } from "../../../redux/action";
8
 
8
 
9
 const UserUpdateForm = () => {
9
 const UserUpdateForm = () => {

+ 0
- 0
src/lang/en.json View File


+ 0
- 0
src/lang/fr_FR.json View File


+ 8
- 0
src/main.jsx View File

1
 import React from "react";
1
 import React from "react";
2
 import ReactDOM from "react-dom";
2
 import ReactDOM from "react-dom";
3
+import { IntlProvider } from "react-intl";
3
 import { Provider } from "react-redux";
4
 import { Provider } from "react-redux";
4
 import { PersistGate } from "redux-persist/integration/react";
5
 import { PersistGate } from "redux-persist/integration/react";
5
 import { store, persistor } from "./redux/store/index";
6
 import { store, persistor } from "./redux/store/index";
6
 
7
 
7
 import App from "./App.jsx";
8
 import App from "./App.jsx";
8
 import "./main.scss";
9
 import "./main.scss";
10
+import fr_FR from "./lang/fr_FR.json";
11
+import en_default from "./lang/en.json";
12
+
13
+const locale = navigator.language;
14
+let lang = "";
15
+if (locale !== "fr") {
16
+}
9
 
17
 
10
 ReactDOM.render(
18
 ReactDOM.render(
11
 	<React.StrictMode>
19
 	<React.StrictMode>

+ 1
- 1
src/pages/Profile/index.jsx View File

3
 import { useHistory } from "react-router-dom";
3
 import { useHistory } from "react-router-dom";
4
 import Cookies from "js-cookie";
4
 import Cookies from "js-cookie";
5
 
5
 
6
-import del from "../../services/request/Delete";
6
+import del from "../../tools/request/Delete";
7
 import { removeCurrentUser } from "../../redux/action/index";
7
 import { removeCurrentUser } from "../../redux/action/index";
8
 import UserUpdateForm from "../../components/forms/UserUpdateForm";
8
 import UserUpdateForm from "../../components/forms/UserUpdateForm";
9
 
9
 

src/services/request/Delete.js → src/tools/request/Delete.js View File


src/services/request/Get.js → src/tools/request/Get.js View File


src/services/request/Post.js → src/tools/request/Post.js View File


src/services/request/Update.js → src/tools/request/Update.js View File


src/services/request/config.js → src/tools/request/config.js View File


+ 94
- 2
yarn.lock View File

1368
     minimatch "^3.0.4"
1368
     minimatch "^3.0.4"
1369
     strip-json-comments "^3.1.1"
1369
     strip-json-comments "^3.1.1"
1370
 
1370
 
1371
+"@formatjs/ecma402-abstract@1.9.5":
1372
+  version "1.9.5"
1373
+  resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.9.5.tgz#89ddbc6f18f2ac3cbe841ae13cb1e0a65eddbf53"
1374
+  integrity sha512-cGpEBzrf9bL2lTMEuRZ3gjLrEUEucxAXDIdX4tNqNdNZO81ZN558BfjiFfyPgrhILEuJU/+sgLwWxddSn6usHw==
1375
+  dependencies:
1376
+    "@formatjs/intl-localematcher" "0.2.18"
1377
+    tslib "^2.1.0"
1378
+
1379
+"@formatjs/fast-memoize@1.1.1":
1380
+  version "1.1.1"
1381
+  resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.1.1.tgz#3006b58aca1e39a98aca213356b42da5d173f26b"
1382
+  integrity sha512-mIqBr5uigIlx13eZTOPSEh2buDiy3BCdMYUtewICREQjbb4xarDiVWoXSnrERM7NanZ+0TAHNXSqDe6HpEFQUg==
1383
+
1384
+"@formatjs/icu-messageformat-parser@2.0.8":
1385
+  version "2.0.8"
1386
+  resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.8.tgz#a7a8714e92c7a1afec3dc4ed94e9e82256f0afb2"
1387
+  integrity sha512-fZlQ7ls3eQswO4RFB0lSi+ritPvud0Z2EQB6SU8qI5+MIS4qU4AHjq/dFJNvhdEdmJqLWHe31K4yHaRdavkSQQ==
1388
+  dependencies:
1389
+    "@formatjs/ecma402-abstract" "1.9.5"
1390
+    "@formatjs/icu-skeleton-parser" "1.2.9"
1391
+    tslib "^2.1.0"
1392
+
1393
+"@formatjs/icu-skeleton-parser@1.2.9":
1394
+  version "1.2.9"
1395
+  resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.2.9.tgz#70c36735be9cffec0669fa089d061fa6b60e5a8a"
1396
+  integrity sha512-cx8Ug1gxRtv0rRddWd6dt5Sn/BhnhktSHvokbmLUVOEp2dy/6Ehvv2e00wow28AaSIzvBvM6ew1Qwe9wzDzcOw==
1397
+  dependencies:
1398
+    "@formatjs/ecma402-abstract" "1.9.5"
1399
+    tslib "^2.1.0"
1400
+
1401
+"@formatjs/intl-displaynames@5.2.0":
1402
+  version "5.2.0"
1403
+  resolved "https://registry.yarnpkg.com/@formatjs/intl-displaynames/-/intl-displaynames-5.2.0.tgz#b2cc92d941d1fe7c83ff081b955197e647d26d10"
1404
+  integrity sha512-Vox3IbI2I1aG2agCQUKdmtB8aM9C7iaGui2S2Apo50MVC7sJuFz7sXq5vuqp8erCAalhuCfRMQREQ3jw/rwW6w==
1405
+  dependencies:
1406
+    "@formatjs/ecma402-abstract" "1.9.5"
1407
+    "@formatjs/intl-localematcher" "0.2.18"
1408
+    tslib "^2.1.0"
1409
+
1410
+"@formatjs/intl-listformat@6.3.0":
1411
+  version "6.3.0"
1412
+  resolved "https://registry.yarnpkg.com/@formatjs/intl-listformat/-/intl-listformat-6.3.0.tgz#d64b8cb99050b74e7a2acf360e98b5a3d9f40f26"
1413
+  integrity sha512-xfNODLDWAV2pAZIK3a/HedvNmvg7GJxFVyOSbYMJP3uTrgjxIUZXeUIu5A5aHe8hn6Tv/GdT9QltDol/YlXmcg==
1414
+  dependencies:
1415
+    "@formatjs/ecma402-abstract" "1.9.5"
1416
+    "@formatjs/intl-localematcher" "0.2.18"
1417
+    tslib "^2.1.0"
1418
+
1419
+"@formatjs/intl-localematcher@0.2.18":
1420
+  version "0.2.18"
1421
+  resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.18.tgz#8fd26045d4f8d85a69519a29f5ee491577ff3eb8"
1422
+  integrity sha512-xI9X+mi7wbucbh35GNTY+C0+oMJXAp8ueC73SOyJlBpRNjLuOlSwgw3yJaCZxy3WpjcRBCP0laJ5zlpITO0QpA==
1423
+  dependencies:
1424
+    tslib "^2.1.0"
1425
+
1426
+"@formatjs/intl@1.13.4":
1427
+  version "1.13.4"
1428
+  resolved "https://registry.yarnpkg.com/@formatjs/intl/-/intl-1.13.4.tgz#7c0143558647800359bea4875fc1005844794031"
1429
+  integrity sha512-Hk3jPFsi2g75Yc0bdEsQTgk8TM9CrCBfBwHbngfsNYX0P0QHq00vxIK0kXB/QyOP4SL3hVENA30yRb6cbNp6ww==
1430
+  dependencies:
1431
+    "@formatjs/ecma402-abstract" "1.9.5"
1432
+    "@formatjs/fast-memoize" "1.1.1"
1433
+    "@formatjs/icu-messageformat-parser" "2.0.8"
1434
+    "@formatjs/intl-displaynames" "5.2.0"
1435
+    "@formatjs/intl-listformat" "6.3.0"
1436
+    intl-messageformat "9.8.1"
1437
+    tslib "^2.1.0"
1438
+
1371
 "@hapi/address@2.x.x":
1439
 "@hapi/address@2.x.x":
1372
   version "2.1.4"
1440
   version "2.1.4"
1373
   resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
1441
   resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
1936
   dependencies:
2004
   dependencies:
1937
     "@types/node" "*"
2005
     "@types/node" "*"
1938
 
2006
 
1939
-"@types/hoist-non-react-statics@^3.3.0":
2007
+"@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1":
1940
   version "3.3.1"
2008
   version "3.3.1"
1941
   resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
2009
   resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
1942
   integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
2010
   integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
6346
     has "^1.0.3"
6414
     has "^1.0.3"
6347
     side-channel "^1.0.4"
6415
     side-channel "^1.0.4"
6348
 
6416
 
6417
+intl-messageformat@9.8.1:
6418
+  version "9.8.1"
6419
+  resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-9.8.1.tgz#f2352f1e12dcc1b135da315a9d565a473ba7bffe"
6420
+  integrity sha512-2rSZQu8GmLOlxNiehRvxWjkIqzemW833zm8ZS63JNvSpSuGnpqSWRqqwqv1kEBto/97/UBjtWy14m/CIdwVqFg==
6421
+  dependencies:
6422
+    "@formatjs/fast-memoize" "1.1.1"
6423
+    "@formatjs/icu-messageformat-parser" "2.0.8"
6424
+    tslib "^2.1.0"
6425
+
6349
 ip-regex@^2.1.0:
6426
 ip-regex@^2.1.0:
6350
   version "2.1.0"
6427
   version "2.1.0"
6351
   resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
6428
   resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
9741
   resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"
9818
   resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"
9742
   integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==
9819
   integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==
9743
 
9820
 
9821
+react-intl@^5.20.6:
9822
+  version "5.20.6"
9823
+  resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-5.20.6.tgz#fc64d09143d0df233b373d40a646542b167c118c"
9824
+  integrity sha512-+G5HIb0GCBgIMd/OWISCnUCbRE6fHOkNJxaefbrjvXwCXZLLpUUYtO65DJOEuc+hB3VkAsM6QJDJ6AarO3hPKQ==
9825
+  dependencies:
9826
+    "@formatjs/ecma402-abstract" "1.9.5"
9827
+    "@formatjs/icu-messageformat-parser" "2.0.8"
9828
+    "@formatjs/intl" "1.13.4"
9829
+    "@formatjs/intl-displaynames" "5.2.0"
9830
+    "@formatjs/intl-listformat" "6.3.0"
9831
+    "@types/hoist-non-react-statics" "^3.3.1"
9832
+    hoist-non-react-statics "^3.3.2"
9833
+    intl-messageformat "9.8.1"
9834
+    tslib "^2.1.0"
9835
+
9744
 react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
9836
 react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
9745
   version "16.13.1"
9837
   version "16.13.1"
9746
   resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
9838
   resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
11441
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
11533
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
11442
   integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
11534
   integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
11443
 
11535
 
11444
-tslib@^2.0.3:
11536
+tslib@^2.0.3, tslib@^2.1.0:
11445
   version "2.3.0"
11537
   version "2.3.0"
11446
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
11538
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
11447
   integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
11539
   integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==

Loading…
Cancel
Save