touchstudy-core 0.1.1 → 0.1.3
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/components/Dialogs/CommonDialog.d.ts +1 -0
- package/dist/components/Dialogs/ConfirmDialog.d.ts +1 -0
- package/dist/configs/constants.d.ts +11 -0
- package/dist/containers/Login/apiClient/index.d.ts +1 -1
- package/dist/containers/Login/configs/constants.d.ts +4 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index.css +96 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +459 -30
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +441 -32
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/TheLanguageDropdown.d.ts +3 -0
- package/dist/redux/commons/action.d.ts +1 -0
- package/dist/utils/addTime.d.ts +3 -0
- package/dist/utils/constants.d.ts +6 -1
- package/dist/utils/diffFromNow.d.ts +1 -1
- package/dist/utils/minutesToTimeSpan.d.ts +2 -0
- package/dist/utils/toISOString.d.ts +2 -0
- package/dist/utils/types.d.ts +8 -0
- package/dist/utils/useGoogleSignOut.d.ts +9 -0
- package/package.json +4 -1
package/dist/index.js
CHANGED
@@ -8,10 +8,14 @@ var reactGoogleRecaptchaV3 = require('react-google-recaptcha-v3');
|
|
8
8
|
var reactstrap = require('reactstrap');
|
9
9
|
var formik = require('formik');
|
10
10
|
var yup = require('yup');
|
11
|
-
var GoogleLogin =
|
11
|
+
var GoogleLogin = require('@leecheuk/react-google-login');
|
12
|
+
var GoogleLogin__default = _interopDefault(GoogleLogin);
|
12
13
|
var axios = _interopDefault(require('axios'));
|
13
14
|
var reactRedux = require('react-redux');
|
14
15
|
var gapiScript = require('gapi-script');
|
16
|
+
var i18n = _interopDefault(require('i18next'));
|
17
|
+
var reactI18next = require('react-i18next');
|
18
|
+
var io5 = require('react-icons/io5');
|
15
19
|
|
16
20
|
function _extends() {
|
17
21
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
@@ -607,12 +611,18 @@ function createBrowserHistory(props) {
|
|
607
611
|
var setLoading = toolkit.createAction("common/setLoading");
|
608
612
|
var setAlert = toolkit.createAction("common/setAlert");
|
609
613
|
var setUser = toolkit.createAction("common/setUser");
|
614
|
+
var setLanguage = toolkit.createAction("common/setLanguage");
|
610
615
|
|
611
616
|
var GOOGLE_CLIENT_ID = "64118819726-0qlur4qjrs9jbuu6rnoa0u91g680lmpg.apps.googleusercontent.com";
|
612
617
|
var GOOGLE_RECAPTCHA_ID = "6LfNtLUaAAAAAL24lbBV11jS-gBtt1mhtxb4NXs0";
|
613
618
|
var ACCESS_TOKEN = "ACCESS_TOKEN";
|
614
619
|
var DATE_MIN_VALUE = "0001-01-01T00:00:00+00:00";
|
615
|
-
var BASE_URL = "
|
620
|
+
var BASE_URL = "http://api.touchstudy.kr";
|
621
|
+
var PUSHER_CONFIG = {
|
622
|
+
cluster: "ap1",
|
623
|
+
key: "9018c77328885a14150b"
|
624
|
+
};
|
625
|
+
var EXAM_CHANNEL = "EXAM-CHANNEL";
|
616
626
|
var getAccessToken = function getAccessToken() {
|
617
627
|
try {
|
618
628
|
return localStorage.getItem(ACCESS_TOKEN);
|
@@ -661,7 +671,7 @@ function _catch(body, recover) {
|
|
661
671
|
return result;
|
662
672
|
}
|
663
673
|
|
664
|
-
var styles = {"btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1"};
|
674
|
+
var styles = {"btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi"};
|
665
675
|
|
666
676
|
var api = axios.create({
|
667
677
|
baseURL: BASE_URL,
|
@@ -696,13 +706,14 @@ var apiUpload = axios.create({
|
|
696
706
|
return i.interceptors.response.use(function (response) {
|
697
707
|
return response;
|
698
708
|
}, function (error) {
|
709
|
+
var _error$response, _error$response2;
|
699
710
|
console.log({
|
700
711
|
error: error
|
701
712
|
});
|
702
|
-
if (error.response.status === 401) {
|
713
|
+
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 401) {
|
703
714
|
window.location.href = "/login";
|
704
715
|
}
|
705
|
-
if (error.response.status == 403) {
|
716
|
+
if (((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) == 403) {
|
706
717
|
localStorage.removeItem(ACCESS_TOKEN);
|
707
718
|
localStorage.removeItem("USER_EMAIL");
|
708
719
|
window.location.href = "/login";
|
@@ -711,8 +722,30 @@ var apiUpload = axios.create({
|
|
711
722
|
});
|
712
723
|
});
|
713
724
|
|
714
|
-
var apiLoginGoogle = function apiLoginGoogle(body) {
|
715
|
-
return api.post(BASE_URL + "/api/auth/login", body);
|
725
|
+
var apiLoginGoogle = function apiLoginGoogle(body, role) {
|
726
|
+
return api.post(BASE_URL + "/api/auth/" + role + "/login", body);
|
727
|
+
};
|
728
|
+
|
729
|
+
var AuthenticationMessage;
|
730
|
+
(function (AuthenticationMessage) {
|
731
|
+
AuthenticationMessage["NotAllowedToRegister"] = "NotAllowedToRegister";
|
732
|
+
AuthenticationMessage["InvalidGoogleToken"] = "InvalidGoogleToken";
|
733
|
+
})(AuthenticationMessage || (AuthenticationMessage = {}));
|
734
|
+
|
735
|
+
var useGoogleSignOut = function useGoogleSignOut(props) {
|
736
|
+
var onLogoutSuccess = props.onLogoutSuccess,
|
737
|
+
onFailure = props.onFailure;
|
738
|
+
var _useGoogleLogout = GoogleLogin.useGoogleLogout({
|
739
|
+
clientId: GOOGLE_CLIENT_ID,
|
740
|
+
onLogoutSuccess: onLogoutSuccess,
|
741
|
+
onFailure: onFailure
|
742
|
+
}),
|
743
|
+
signOut = _useGoogleLogout.signOut,
|
744
|
+
loaded = _useGoogleLogout.loaded;
|
745
|
+
return {
|
746
|
+
signOut: signOut,
|
747
|
+
loaded: loaded
|
748
|
+
};
|
716
749
|
};
|
717
750
|
|
718
751
|
var ERROR_MESSAGE = "Login fail!";
|
@@ -728,6 +761,8 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
728
761
|
var dispatch = reactRedux.useDispatch();
|
729
762
|
var _useGoogleReCaptcha = reactGoogleRecaptchaV3.useGoogleReCaptcha(),
|
730
763
|
executeRecaptcha = _useGoogleReCaptcha.executeRecaptcha;
|
764
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
765
|
+
signOut = _useGoogleSignOut.signOut;
|
731
766
|
var clickHandler = React.useCallback(function () {
|
732
767
|
try {
|
733
768
|
if (!executeRecaptcha) {
|
@@ -743,10 +778,6 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
743
778
|
var onSuccessGoogle = function onSuccessGoogle(res) {
|
744
779
|
try {
|
745
780
|
var _exit = false;
|
746
|
-
console.log("success");
|
747
|
-
console.log({
|
748
|
-
res: res
|
749
|
-
});
|
750
781
|
return Promise.resolve(function () {
|
751
782
|
if (!!(res !== null && res !== void 0 && res.accessToken)) {
|
752
783
|
var _temp2 = function _temp2(_result) {
|
@@ -764,21 +795,15 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
764
795
|
fullName: name,
|
765
796
|
email: email,
|
766
797
|
token: accessToken,
|
767
|
-
googleId: googleId
|
768
|
-
role: isTeacher ? "Teacher" : "Student"
|
798
|
+
googleId: googleId
|
769
799
|
};
|
770
|
-
|
771
|
-
infoLogin: infoLogin
|
772
|
-
});
|
800
|
+
var role = isTeacher ? "Teacher" : "Student";
|
773
801
|
dispatch(setLoading(true));
|
774
802
|
var _temp = _catch(function () {
|
775
|
-
return Promise.resolve(apiLoginGoogle(infoLogin)).then(function (res1) {
|
803
|
+
return Promise.resolve(apiLoginGoogle(infoLogin, role)).then(function (res1) {
|
776
804
|
var isFirstLogin = res1.data.isFirstLogin;
|
777
805
|
var tokenJWT = res1.data.token;
|
778
806
|
localStorage.setItem("USER_INFORMATION", JSON.stringify(infoLogin));
|
779
|
-
console.log({
|
780
|
-
res1: res1
|
781
|
-
});
|
782
807
|
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
783
808
|
if (isTeacher) {
|
784
809
|
onNavigate("/teacher/overall-status/main");
|
@@ -792,10 +817,22 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
792
817
|
}
|
793
818
|
});
|
794
819
|
}, function (error) {
|
795
|
-
var _error$response;
|
796
|
-
|
820
|
+
var _error$response, _error$response$data;
|
821
|
+
var message = undefined;
|
822
|
+
var type = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.type;
|
823
|
+
if (type === AuthenticationMessage.NotAllowedToRegister) {
|
824
|
+
alert("가입 권한이 없는 계정입니다. 관리자에게 문의하세요.");
|
825
|
+
} else if (type) {
|
826
|
+
var _error$response2, _error$response2$data;
|
827
|
+
message = (error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.message) || ERROR_MESSAGE;
|
828
|
+
} else {
|
829
|
+
var _error$response3;
|
830
|
+
message = (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) || ERROR_MESSAGE;
|
831
|
+
}
|
832
|
+
signOut();
|
833
|
+
!!message && dispatch(setAlert({
|
797
834
|
type: "danger",
|
798
|
-
message:
|
835
|
+
message: message
|
799
836
|
}));
|
800
837
|
});
|
801
838
|
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
@@ -845,13 +882,14 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
845
882
|
onVerify: handleVerify
|
846
883
|
})), React__default.createElement(reactstrap.Col, {
|
847
884
|
className: "p-0 mt-1 mb-4"
|
848
|
-
}, React__default.createElement(
|
885
|
+
}, React__default.createElement(GoogleLogin__default, {
|
849
886
|
clientId: GOOGLE_CLIENT_ID,
|
850
887
|
buttonText: "Google \uACC4\uC815\uC73C\uB85C \uB85C\uADF8\uC778",
|
851
888
|
onSuccess: onSuccessGoogle,
|
852
889
|
onFailure: onFailureGoogle,
|
853
890
|
cookiePolicy: "single_host_origin",
|
854
|
-
className: "" + styles["btn-login-google"]
|
891
|
+
className: "" + styles["btn-login-google"],
|
892
|
+
isSignedIn: true
|
855
893
|
}))))));
|
856
894
|
});
|
857
895
|
};
|
@@ -1134,6 +1172,8 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
1134
1172
|
state.alert = action.payload;
|
1135
1173
|
}).addCase(setUser, function (state, action) {
|
1136
1174
|
state.user = action.payload;
|
1175
|
+
}).addCase(setLanguage, function (state, action) {
|
1176
|
+
state.language = action.payload;
|
1137
1177
|
});
|
1138
1178
|
});
|
1139
1179
|
|
@@ -1270,9 +1310,12 @@ var getInfo = function getInfo() {
|
|
1270
1310
|
var LayoutContext = function LayoutContext(_ref) {
|
1271
1311
|
var children = _ref.children,
|
1272
1312
|
onNavigate = _ref.onNavigate;
|
1313
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
1314
|
+
signOut = _useGoogleSignOut.signOut;
|
1273
1315
|
var dispatch = reactRedux.useDispatch();
|
1274
1316
|
var resetAuth = function resetAuth() {
|
1275
1317
|
localStorage.removeItem(ACCESS_TOKEN);
|
1318
|
+
signOut();
|
1276
1319
|
onNavigate("/login");
|
1277
1320
|
};
|
1278
1321
|
var loadInfo = function loadInfo() {
|
@@ -1315,6 +1358,8 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1315
1358
|
_ref$okText = _ref.okText,
|
1316
1359
|
okText = _ref$okText === void 0 ? "Yes" : _ref$okText,
|
1317
1360
|
isDelete = _ref.isDelete,
|
1361
|
+
_ref$title = _ref.title,
|
1362
|
+
title = _ref$title === void 0 ? "Confirmation" : _ref$title,
|
1318
1363
|
toggle = _ref.toggle,
|
1319
1364
|
onConfirm = _ref.onConfirm;
|
1320
1365
|
return React__default.createElement(reactstrap.Modal, {
|
@@ -1323,7 +1368,7 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1323
1368
|
centered: true
|
1324
1369
|
}, React__default.createElement(reactstrap.ModalHeader, {
|
1325
1370
|
toggle: toggle
|
1326
|
-
},
|
1371
|
+
}, title), React__default.createElement(reactstrap.ModalBody, null, text), React__default.createElement(reactstrap.ModalFooter, null, React__default.createElement(reactstrap.Button, {
|
1327
1372
|
color: "secondary",
|
1328
1373
|
onClick: toggle
|
1329
1374
|
}, cancelText), React__default.createElement(reactstrap.Button, {
|
@@ -1339,8 +1384,10 @@ var CommonDialog = function CommonDialog(_ref) {
|
|
1339
1384
|
title = _ref.title,
|
1340
1385
|
_ref$size = _ref.size,
|
1341
1386
|
size = _ref$size === void 0 ? "xs" : _ref$size,
|
1342
|
-
onClose = _ref.onClose
|
1387
|
+
onClose = _ref.onClose,
|
1388
|
+
backdrop = _ref.backdrop;
|
1343
1389
|
return React__default.createElement(reactstrap.Modal, {
|
1390
|
+
backdrop: backdrop,
|
1344
1391
|
isOpen: open,
|
1345
1392
|
toggle: onClose,
|
1346
1393
|
centered: centered,
|
@@ -1392,10 +1439,11 @@ var formatTime = (function (time, ORIGINAL_FORMAT, FORMAT) {
|
|
1392
1439
|
}
|
1393
1440
|
});
|
1394
1441
|
|
1395
|
-
var diffFromNow = (function (time, unitOfTime) {
|
1396
|
-
if (time === DATE_MIN_VALUE) return 0;
|
1442
|
+
var diffFromNow = (function (time, unitOfTime, targetTime) {
|
1443
|
+
if (time === DATE_MIN_VALUE || targetTime === DATE_MIN_VALUE) return 0;
|
1397
1444
|
try {
|
1398
|
-
|
1445
|
+
var now = !!targetTime ? moment() : moment.utc(targetTime).local();
|
1446
|
+
return now.diff(moment.utc(time).local(), unitOfTime);
|
1399
1447
|
} catch (_unused) {
|
1400
1448
|
return "";
|
1401
1449
|
}
|
@@ -1495,25 +1543,406 @@ var CustomPagination = function CustomPagination(_ref) {
|
|
1495
1543
|
})));
|
1496
1544
|
};
|
1497
1545
|
|
1546
|
+
(function (ExamEvent) {
|
1547
|
+
ExamEvent["StartExam"] = "start-exam";
|
1548
|
+
ExamEvent["TerminateExam"] = "terminate-exam";
|
1549
|
+
ExamEvent["JoinExam"] = "join-exam";
|
1550
|
+
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
1551
|
+
ExamEvent["TeacherDisconnectChannel"] = "teacher-disconnect-channel";
|
1552
|
+
ExamEvent["StudentDisconnectChannel"] = "student-disconnect-channel";
|
1553
|
+
})(exports.ExamEvent || (exports.ExamEvent = {}));
|
1554
|
+
|
1555
|
+
var problem_solving = "문제풀기";
|
1556
|
+
var my_story = "내 스토리";
|
1557
|
+
var search_find = "검색하여 찾기";
|
1558
|
+
var test_code = "시험코드 입력";
|
1559
|
+
var login_success = "로그인 성공";
|
1560
|
+
var welcome_success = "스터디 터치에 오신 것을 환영합니다!";
|
1561
|
+
var description_success = "스터디 터치는 엄태욱 선생님의 수업에서 활용되는 학습 도구입니다.";
|
1562
|
+
var logout = "로그 아웃";
|
1563
|
+
var overall_status = "전체 현황";
|
1564
|
+
var exam_status = "시험별 현";
|
1565
|
+
var user_manager = "사용자 목록";
|
1566
|
+
var recent_exam_results = "최근 시험 결과";
|
1567
|
+
var instructor_name = "강사이름";
|
1568
|
+
var academy_name = "학원 이름";
|
1569
|
+
var total_students = "총 학생수";
|
1570
|
+
var student = "명";
|
1571
|
+
var students = "명";
|
1572
|
+
var extra_time = "추가 시간";
|
1573
|
+
var complete = "완료";
|
1574
|
+
var current_exam = "현재 시험중";
|
1575
|
+
var exam_time = "시험 시간";
|
1576
|
+
var time_remaining = "남은 시간";
|
1577
|
+
var number_results = "결과 {{number}}건";
|
1578
|
+
var number_result = "결과 {{number}}건";
|
1579
|
+
var mins_mins_seconds_seconds = "{{mins}}분 {{seconds}}초";
|
1580
|
+
var mins_mins = "{{mins}}분";
|
1581
|
+
var class_name = "반 이름";
|
1582
|
+
var create_new_exam = "새 시험 생성";
|
1583
|
+
var there_are_no_recent_exams = "최근 시험이 없습니다";
|
1584
|
+
var you_have_created_a_exam_with_code_code_do_you_want_to_continue = "코드가 {{code}}인 시험을 생성했습니다. 계속하시겠습니까?";
|
1585
|
+
var here = "여기";
|
1586
|
+
var do_you_want_to_complete_the_exam = "시험을 완료처리 하시겠습니까?";
|
1587
|
+
var are_you_sure_you_want_to_delete_the_exam = "시험을 삭제하시겠습니까?";
|
1588
|
+
var yes = "예";
|
1589
|
+
var no = "아니요";
|
1590
|
+
var cancel = "취소";
|
1591
|
+
var confirmation = "확인";
|
1592
|
+
var student_name = "학생이름";
|
1593
|
+
var full_pool_time = "전체풀이시간";
|
1594
|
+
var number_question = "{{number}}번";
|
1595
|
+
var answer_rate = "정답률";
|
1596
|
+
var seconds = "초";
|
1597
|
+
var search_placeholder = "시험 이름으로 검색하기";
|
1598
|
+
var study_touch = "영어연구소";
|
1599
|
+
var exam_information = "시험정보";
|
1600
|
+
var issue_number = "문제번호";
|
1601
|
+
var incorrect_rate = "오답률";
|
1602
|
+
var question_time_for_each_student = "학생별 문항 시간";
|
1603
|
+
var correct_answer_for_each_student = "학생별 정답 여부";
|
1604
|
+
var information_by_question = "문항별 정보";
|
1605
|
+
var no_data = "데이터 없음";
|
1606
|
+
var internet_connection_was_lost = "인터넷 연결이 끊어졌습니다";
|
1607
|
+
var problem = "문제";
|
1608
|
+
var problem_solving_time = "문제풀이 시간";
|
1609
|
+
var lang_ko = {
|
1610
|
+
problem_solving: problem_solving,
|
1611
|
+
my_story: my_story,
|
1612
|
+
search_find: search_find,
|
1613
|
+
test_code: test_code,
|
1614
|
+
login_success: login_success,
|
1615
|
+
welcome_success: welcome_success,
|
1616
|
+
description_success: description_success,
|
1617
|
+
logout: logout,
|
1618
|
+
overall_status: overall_status,
|
1619
|
+
exam_status: exam_status,
|
1620
|
+
user_manager: user_manager,
|
1621
|
+
recent_exam_results: recent_exam_results,
|
1622
|
+
instructor_name: instructor_name,
|
1623
|
+
academy_name: academy_name,
|
1624
|
+
total_students: total_students,
|
1625
|
+
student: student,
|
1626
|
+
students: students,
|
1627
|
+
extra_time: extra_time,
|
1628
|
+
complete: complete,
|
1629
|
+
current_exam: current_exam,
|
1630
|
+
exam_time: exam_time,
|
1631
|
+
time_remaining: time_remaining,
|
1632
|
+
number_results: number_results,
|
1633
|
+
number_result: number_result,
|
1634
|
+
mins_mins_seconds_seconds: mins_mins_seconds_seconds,
|
1635
|
+
mins_mins: mins_mins,
|
1636
|
+
class_name: class_name,
|
1637
|
+
create_new_exam: create_new_exam,
|
1638
|
+
there_are_no_recent_exams: there_are_no_recent_exams,
|
1639
|
+
you_have_created_a_exam_with_code_code_do_you_want_to_continue: you_have_created_a_exam_with_code_code_do_you_want_to_continue,
|
1640
|
+
here: here,
|
1641
|
+
do_you_want_to_complete_the_exam: do_you_want_to_complete_the_exam,
|
1642
|
+
are_you_sure_you_want_to_delete_the_exam: are_you_sure_you_want_to_delete_the_exam,
|
1643
|
+
yes: yes,
|
1644
|
+
no: no,
|
1645
|
+
cancel: cancel,
|
1646
|
+
confirmation: confirmation,
|
1647
|
+
student_name: student_name,
|
1648
|
+
full_pool_time: full_pool_time,
|
1649
|
+
number_question: number_question,
|
1650
|
+
answer_rate: answer_rate,
|
1651
|
+
seconds: seconds,
|
1652
|
+
search_placeholder: search_placeholder,
|
1653
|
+
study_touch: study_touch,
|
1654
|
+
exam_information: exam_information,
|
1655
|
+
issue_number: issue_number,
|
1656
|
+
incorrect_rate: incorrect_rate,
|
1657
|
+
question_time_for_each_student: question_time_for_each_student,
|
1658
|
+
correct_answer_for_each_student: correct_answer_for_each_student,
|
1659
|
+
information_by_question: information_by_question,
|
1660
|
+
no_data: no_data,
|
1661
|
+
internet_connection_was_lost: internet_connection_was_lost,
|
1662
|
+
problem: problem,
|
1663
|
+
problem_solving_time: problem_solving_time
|
1664
|
+
};
|
1665
|
+
|
1666
|
+
var problem_solving$1 = "Problem Solving";
|
1667
|
+
var my_story$1 = "My Story";
|
1668
|
+
var search_find$1 = "Search and find";
|
1669
|
+
var test_code$1 = "Enter test code";
|
1670
|
+
var login_success$1 = "Login Success";
|
1671
|
+
var welcome_success$1 = "Welcome to Study Touch!";
|
1672
|
+
var description_success$1 = "Study Touch is a learning tool used in teacher Taewook Eom's classes.";
|
1673
|
+
var logout$1 = "Logout";
|
1674
|
+
var overall_status$1 = "Overall Status";
|
1675
|
+
var exam_status$1 = "Exam Status";
|
1676
|
+
var user_manager$1 = "User Manager";
|
1677
|
+
var recent_exam_results$1 = "Recent exam";
|
1678
|
+
var instructor_name$1 = "Instructor name";
|
1679
|
+
var academy_name$1 = "Academy name";
|
1680
|
+
var total_students$1 = "Total students";
|
1681
|
+
var students$1 = "Students";
|
1682
|
+
var student$1 = "Student";
|
1683
|
+
var extra_time$1 = "Extra time";
|
1684
|
+
var complete$1 = "Complete";
|
1685
|
+
var current_exam$1 = "Current exam";
|
1686
|
+
var exam_time$1 = "Extra time";
|
1687
|
+
var time_remaining$1 = "Time remaining";
|
1688
|
+
var number_results$1 = "{{number}} Results";
|
1689
|
+
var number_result$1 = "{{number}} Result";
|
1690
|
+
var mins_mins_seconds_seconds$1 = "{{mins}}m {{seconds}}s";
|
1691
|
+
var mins_mins$1 = "{{mins}}m";
|
1692
|
+
var class_name$1 = "Class name";
|
1693
|
+
var create_new_exam$1 = "Create exam";
|
1694
|
+
var there_are_no_recent_exams$1 = "There are no recent exams";
|
1695
|
+
var you_have_created_a_exam_with_code_code_do_you_want_to_continue$1 = "You have created a exam with code {{code}}, do you want to continue?";
|
1696
|
+
var here$1 = "here";
|
1697
|
+
var do_you_want_to_complete_the_exam$1 = "Do you want to complete the exam?";
|
1698
|
+
var are_you_sure_you_want_to_delete_the_exam$1 = "Are you sure you want to delete the exam?";
|
1699
|
+
var yes$1 = "Yes";
|
1700
|
+
var no$1 = "No";
|
1701
|
+
var cancel$1 = "Cancel";
|
1702
|
+
var confirmation$1 = "Confirmation";
|
1703
|
+
var student_name$1 = "Student name";
|
1704
|
+
var full_pool_time$1 = "Full pool time";
|
1705
|
+
var number_question$1 = "No.{{number}}";
|
1706
|
+
var answer_rate$1 = "Answer rate";
|
1707
|
+
var seconds$1 = "s";
|
1708
|
+
var search_placeholder$1 = "Search by exam name";
|
1709
|
+
var study_touch$1 = "Study touch";
|
1710
|
+
var exam_information$1 = "Exam information";
|
1711
|
+
var issue_number$1 = "Issue number";
|
1712
|
+
var incorrect_rate$1 = "Incorrect rate";
|
1713
|
+
var question_time_for_each_student$1 = "Question time for each student";
|
1714
|
+
var correct_answer_for_each_student$1 = "Correct answer for each student";
|
1715
|
+
var information_by_question$1 = "Information by question";
|
1716
|
+
var no_data$1 = "No data";
|
1717
|
+
var internet_connection_was_lost$1 = "Internet connection was lost";
|
1718
|
+
var problem$1 = "Problem ";
|
1719
|
+
var problem_solving_time$1 = "Problem solving time";
|
1720
|
+
var lang_en = {
|
1721
|
+
problem_solving: problem_solving$1,
|
1722
|
+
my_story: my_story$1,
|
1723
|
+
search_find: search_find$1,
|
1724
|
+
test_code: test_code$1,
|
1725
|
+
login_success: login_success$1,
|
1726
|
+
welcome_success: welcome_success$1,
|
1727
|
+
description_success: description_success$1,
|
1728
|
+
logout: logout$1,
|
1729
|
+
overall_status: overall_status$1,
|
1730
|
+
exam_status: exam_status$1,
|
1731
|
+
user_manager: user_manager$1,
|
1732
|
+
recent_exam_results: recent_exam_results$1,
|
1733
|
+
instructor_name: instructor_name$1,
|
1734
|
+
academy_name: academy_name$1,
|
1735
|
+
total_students: total_students$1,
|
1736
|
+
students: students$1,
|
1737
|
+
student: student$1,
|
1738
|
+
extra_time: extra_time$1,
|
1739
|
+
complete: complete$1,
|
1740
|
+
current_exam: current_exam$1,
|
1741
|
+
exam_time: exam_time$1,
|
1742
|
+
time_remaining: time_remaining$1,
|
1743
|
+
number_results: number_results$1,
|
1744
|
+
number_result: number_result$1,
|
1745
|
+
mins_mins_seconds_seconds: mins_mins_seconds_seconds$1,
|
1746
|
+
mins_mins: mins_mins$1,
|
1747
|
+
class_name: class_name$1,
|
1748
|
+
create_new_exam: create_new_exam$1,
|
1749
|
+
there_are_no_recent_exams: there_are_no_recent_exams$1,
|
1750
|
+
you_have_created_a_exam_with_code_code_do_you_want_to_continue: you_have_created_a_exam_with_code_code_do_you_want_to_continue$1,
|
1751
|
+
here: here$1,
|
1752
|
+
do_you_want_to_complete_the_exam: do_you_want_to_complete_the_exam$1,
|
1753
|
+
are_you_sure_you_want_to_delete_the_exam: are_you_sure_you_want_to_delete_the_exam$1,
|
1754
|
+
yes: yes$1,
|
1755
|
+
no: no$1,
|
1756
|
+
cancel: cancel$1,
|
1757
|
+
confirmation: confirmation$1,
|
1758
|
+
student_name: student_name$1,
|
1759
|
+
full_pool_time: full_pool_time$1,
|
1760
|
+
number_question: number_question$1,
|
1761
|
+
answer_rate: answer_rate$1,
|
1762
|
+
seconds: seconds$1,
|
1763
|
+
search_placeholder: search_placeholder$1,
|
1764
|
+
study_touch: study_touch$1,
|
1765
|
+
exam_information: exam_information$1,
|
1766
|
+
issue_number: issue_number$1,
|
1767
|
+
incorrect_rate: incorrect_rate$1,
|
1768
|
+
question_time_for_each_student: question_time_for_each_student$1,
|
1769
|
+
correct_answer_for_each_student: correct_answer_for_each_student$1,
|
1770
|
+
information_by_question: information_by_question$1,
|
1771
|
+
no_data: no_data$1,
|
1772
|
+
internet_connection_was_lost: internet_connection_was_lost$1,
|
1773
|
+
problem: problem$1,
|
1774
|
+
problem_solving_time: problem_solving_time$1
|
1775
|
+
};
|
1776
|
+
|
1777
|
+
i18n.use(reactI18next.initReactI18next).init({
|
1778
|
+
lng: "ko",
|
1779
|
+
fallbackLng: "ko",
|
1780
|
+
interpolation: {
|
1781
|
+
escapeValue: false
|
1782
|
+
},
|
1783
|
+
resources: {
|
1784
|
+
ko: {
|
1785
|
+
translation: lang_ko
|
1786
|
+
},
|
1787
|
+
en: {
|
1788
|
+
translation: lang_en
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
});
|
1792
|
+
|
1793
|
+
var DEFAULT_LANGUAGE_CODE = "ko";
|
1794
|
+
var LANGUAGES = [{
|
1795
|
+
code: "ko",
|
1796
|
+
fullName: "Korean",
|
1797
|
+
shortName: "Korean",
|
1798
|
+
nativeName: "Korean",
|
1799
|
+
name: "Korean",
|
1800
|
+
image: "/images/korea.png"
|
1801
|
+
}, {
|
1802
|
+
code: "en",
|
1803
|
+
fullName: "English",
|
1804
|
+
shortName: "English",
|
1805
|
+
nativeName: "English",
|
1806
|
+
name: "English",
|
1807
|
+
image: "/images/usa.png"
|
1808
|
+
}];
|
1809
|
+
var SUPPORTED_LANGUAGES_CODE = LANGUAGES.map(function (i) {
|
1810
|
+
return i.code;
|
1811
|
+
});
|
1812
|
+
|
1813
|
+
var TheLanguageDropdown = function TheLanguageDropdown() {
|
1814
|
+
var defaultLanguage = !!localStorage.getItem("language") ? localStorage.getItem("language") : navigator.language || DEFAULT_LANGUAGE_CODE;
|
1815
|
+
var dispatch = reactRedux.useDispatch();
|
1816
|
+
var _useTranslation = reactI18next.useTranslation(),
|
1817
|
+
i18n = _useTranslation.i18n;
|
1818
|
+
var _useState = React.useState(false),
|
1819
|
+
dropdownOpen = _useState[0],
|
1820
|
+
setDropdownOpen = _useState[1];
|
1821
|
+
var _useState2 = React.useState(defaultLanguage),
|
1822
|
+
language = _useState2[0],
|
1823
|
+
setItemLanguage = _useState2[1];
|
1824
|
+
var toggle = function toggle() {
|
1825
|
+
return setDropdownOpen(function (prevState) {
|
1826
|
+
return !prevState;
|
1827
|
+
});
|
1828
|
+
};
|
1829
|
+
var changeLanguageApp = function changeLanguageApp(lang) {
|
1830
|
+
if (!SUPPORTED_LANGUAGES_CODE.includes(lang)) lang = DEFAULT_LANGUAGE_CODE;
|
1831
|
+
i18n.changeLanguage(lang);
|
1832
|
+
localStorage.setItem("language", lang);
|
1833
|
+
setItemLanguage(lang);
|
1834
|
+
dispatch(setLanguage(lang));
|
1835
|
+
};
|
1836
|
+
var currentLanguage = React.useMemo(function () {
|
1837
|
+
var currentLang = LANGUAGES.find(function (i) {
|
1838
|
+
return i.code === language;
|
1839
|
+
});
|
1840
|
+
if (!currentLang) return null;
|
1841
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("img", {
|
1842
|
+
className: "mr-2 " + styles['dropdown-menu-flag'],
|
1843
|
+
src: currentLang.image
|
1844
|
+
}), " ", currentLang.shortName);
|
1845
|
+
}, [language]);
|
1846
|
+
React.useEffect(function () {
|
1847
|
+
changeLanguageApp(language);
|
1848
|
+
}, [language]);
|
1849
|
+
return React__default.createElement(reactstrap.Dropdown, {
|
1850
|
+
isOpen: dropdownOpen,
|
1851
|
+
toggle: toggle,
|
1852
|
+
className: "" + styles["dropdown-menu"]
|
1853
|
+
}, React__default.createElement(reactstrap.DropdownToggle, {
|
1854
|
+
className: styles["header-avatar"] + " d-flex align-items-center"
|
1855
|
+
}, React__default.createElement("span", {
|
1856
|
+
style: {
|
1857
|
+
color: "#000",
|
1858
|
+
textTransform: "capitalize",
|
1859
|
+
display: 'flex',
|
1860
|
+
alignItems: 'center'
|
1861
|
+
}
|
1862
|
+
}, currentLanguage, React__default.createElement(io5.IoChevronDown, {
|
1863
|
+
className: "ml-2",
|
1864
|
+
style: {
|
1865
|
+
fontSize: '15px',
|
1866
|
+
marginLeft: "5px",
|
1867
|
+
marginTop: "2px"
|
1868
|
+
}
|
1869
|
+
}))), React__default.createElement(reactstrap.DropdownMenu, {
|
1870
|
+
className: styles["dropdown-content-language"]
|
1871
|
+
}, LANGUAGES.map(function (lang, index) {
|
1872
|
+
return React__default.createElement(reactstrap.DropdownItem, {
|
1873
|
+
key: lang.code,
|
1874
|
+
className: styles["dropdown-change"] + " px-0 py-0 " + (index === LANGUAGES.length - 1 ? "pb-2" : "pt-2"),
|
1875
|
+
onClick: function onClick() {
|
1876
|
+
return setItemLanguage(lang.code);
|
1877
|
+
}
|
1878
|
+
}, React__default.createElement("div", {
|
1879
|
+
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (language == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
1880
|
+
}, React__default.createElement("span", {
|
1881
|
+
className: "mr-2 d-flex hover-opacity"
|
1882
|
+
}, React__default.createElement("img", {
|
1883
|
+
style: {
|
1884
|
+
width: "30px",
|
1885
|
+
marginRight: "10px"
|
1886
|
+
},
|
1887
|
+
src: lang.image
|
1888
|
+
})), lang.name));
|
1889
|
+
})));
|
1890
|
+
};
|
1891
|
+
|
1892
|
+
var minutesToTimeSpan = (function (time) {
|
1893
|
+
var h = Math.floor(time / 60);
|
1894
|
+
var m = time % 60;
|
1895
|
+
return h.toString().padStart(2, "0") + ":" + m.toString().padStart(2, "0") + ":00";
|
1896
|
+
});
|
1897
|
+
|
1898
|
+
var toISOString = (function (time) {
|
1899
|
+
try {
|
1900
|
+
return moment(time).toISOString();
|
1901
|
+
} catch (_unused) {
|
1902
|
+
return "";
|
1903
|
+
}
|
1904
|
+
});
|
1905
|
+
|
1498
1906
|
var historyCore = createBrowserHistory();
|
1499
1907
|
|
1908
|
+
Object.defineProperty(exports, 'I18nextProvider', {
|
1909
|
+
enumerable: true,
|
1910
|
+
get: function () {
|
1911
|
+
return reactI18next.I18nextProvider;
|
1912
|
+
}
|
1913
|
+
});
|
1914
|
+
Object.defineProperty(exports, 'useTranslation', {
|
1915
|
+
enumerable: true,
|
1916
|
+
get: function () {
|
1917
|
+
return reactI18next.useTranslation;
|
1918
|
+
}
|
1919
|
+
});
|
1500
1920
|
exports.ACCESS_TOKEN = ACCESS_TOKEN;
|
1501
1921
|
exports.BASE_URL = BASE_URL;
|
1502
1922
|
exports.CommonAlert = CommonAlert;
|
1503
1923
|
exports.CommonDialog = CommonDialog;
|
1504
1924
|
exports.ConfirmDialog = ConfirmDialog;
|
1505
1925
|
exports.CustomPagination = CustomPagination;
|
1926
|
+
exports.DATE_MIN_VALUE = DATE_MIN_VALUE;
|
1927
|
+
exports.EXAM_CHANNEL = EXAM_CHANNEL;
|
1506
1928
|
exports.LayoutContext = LayoutContext;
|
1507
1929
|
exports.Loading = Loading;
|
1508
1930
|
exports.Login = Login;
|
1509
1931
|
exports.NotFound = NotFound;
|
1932
|
+
exports.PUSHER_CONFIG = PUSHER_CONFIG;
|
1933
|
+
exports.TheLanguageDropdown = TheLanguageDropdown;
|
1510
1934
|
exports.api = api$1;
|
1511
1935
|
exports.diffFromNow = diffFromNow;
|
1512
1936
|
exports.formatTime = formatTime;
|
1513
1937
|
exports.historyCore = historyCore;
|
1938
|
+
exports.i18n = i18n;
|
1939
|
+
exports.minutesToTimeSpan = minutesToTimeSpan;
|
1514
1940
|
exports.setAlert = setAlert;
|
1941
|
+
exports.setLanguage = setLanguage;
|
1515
1942
|
exports.setLoading = setLoading;
|
1516
1943
|
exports.setUser = setUser;
|
1517
1944
|
exports.store = store;
|
1945
|
+
exports.toISOString = toISOString;
|
1946
|
+
exports.useGoogleSignOut = useGoogleSignOut;
|
1518
1947
|
exports.utcToLocalTime = utcToLocalTime;
|
1519
1948
|
//# sourceMappingURL=index.js.map
|