touchstudy-core 0.1.82 → 0.1.83

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.
@@ -120,6 +120,7 @@ export declare type MessageResponse = {
120
120
  conversationId?: number;
121
121
  content: string;
122
122
  isRead: boolean;
123
+ isStudent: boolean;
123
124
  readAt?: string;
124
125
  createdAt: string;
125
126
  sender?: StudentsConversationResponse;
@@ -4,6 +4,21 @@ export declare const signInApi: ({ email, password, role }: {
4
4
  password: string;
5
5
  role: string;
6
6
  }) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const signInWithEmailApi: ({ academyDomain, email, reCaptcha }: {
8
+ academyDomain: string;
9
+ email: string;
10
+ reCaptcha: string;
11
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
12
+ export declare const signInWithOTPApi: ({ academyDomain, otp, role }: {
13
+ academyDomain: string;
14
+ otp: number;
15
+ role?: string | undefined;
16
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
17
+ export declare const signInWithKeyApi: ({ academyDomain, key, role }: {
18
+ academyDomain: string;
19
+ key: string;
20
+ role?: string | undefined;
21
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
7
22
  export declare const signInSuperAdminApi: ({ email, password, role }: {
8
23
  email: string;
9
24
  password: string;
@@ -0,0 +1 @@
1
+ export declare const urlSafeFormat: (text: string) => string;
@@ -1,11 +1,24 @@
1
1
  /// <reference types="react" />
2
+ import { Role } from "../../../utils/constants";
2
3
  declare type LoginInfo = {
3
4
  email: string;
4
- password: string;
5
- captcha: string;
6
- rememberMe: boolean;
5
+ otp: number | string;
7
6
  };
8
- declare const useLogin: (homeAcademyUrl: string, homeUrl: string) => {
7
+ declare type Props = {
8
+ history: any;
9
+ homeAcademyUrl: string;
10
+ homeUrl: string;
11
+ registerUrl?: string;
12
+ role: Role;
13
+ };
14
+ declare const useLogin: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }: Props) => {
15
+ isOTP: boolean;
16
+ isEmail: boolean;
17
+ onVerify: (token: string) => void;
18
+ tokenReCaptcha: string;
19
+ refreshReCaptcha: boolean;
20
+ handleSwitchOTP: (bool: boolean) => void;
21
+ handleSwitchEmail: (bool: boolean) => void;
9
22
  clientId: string | undefined;
10
23
  defaultInfo: LoginInfo;
11
24
  openLogin: boolean;
@@ -13,6 +26,10 @@ declare const useLogin: (homeAcademyUrl: string, homeUrl: string) => {
13
26
  isShowPassword: boolean;
14
27
  setIsShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
15
28
  infoUser: any;
29
+ handleSubmit: (values: {
30
+ email?: string;
31
+ otp?: number;
32
+ }) => Promise<void>;
16
33
  setInfoUser: import("react").Dispatch<any>;
17
34
  };
18
35
  export default useLogin;
@@ -0,0 +1,10 @@
1
+ import { Role } from "../../../utils/constants";
2
+ declare type Props = {
3
+ history: any;
4
+ homeAcademyUrl: string;
5
+ homeUrl: string;
6
+ registerUrl?: string;
7
+ role: Role;
8
+ };
9
+ declare const useLoginWithEmail: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }: Props) => {};
10
+ export default useLoginWithEmail;
@@ -2,7 +2,7 @@ import { FC } from "react";
2
2
  import { INavigateProps } from "../../../utils/types";
3
3
  import { Role } from "../../../utils/constants";
4
4
  interface Props {
5
- role?: Role;
5
+ role: Role;
6
6
  homeAcademyUrl: string;
7
7
  homeUrl: string;
8
8
  registerUrl?: string;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Role } from '../../../utils/constants';
3
+ declare type Props = {
4
+ history: any;
5
+ homeAcademyUrl: string;
6
+ homeUrl: string;
7
+ registerUrl?: string;
8
+ role: Role;
9
+ };
10
+ declare const LoginWithEmail: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }: Props) => React.JSX.Element;
11
+ export default LoginWithEmail;
@@ -2,12 +2,26 @@ import { FC } from "react";
2
2
  import { Role } from "../../../../utils/constants";
3
3
  import { INavigateProps } from "../../../../utils/types";
4
4
  interface Props {
5
- defaultInfo?: any;
5
+ isOTP: boolean;
6
+ isEmail: boolean;
7
+ tokenReCaptcha: string;
8
+ refreshReCaptcha: boolean;
9
+ onVerify: (token: string) => void;
10
+ handleSwitchEmail: (bool: boolean) => void;
11
+ handleSwitchOTP: (bool: boolean) => void;
12
+ defaultInfo: {
13
+ email: string;
14
+ otp: number | string;
15
+ };
6
16
  role?: Role;
7
17
  homeAcademyUrl: string;
8
18
  homeUrl: string;
9
19
  registerUrl?: string;
10
20
  clientId: string;
21
+ onSubmit: (values: {
22
+ email: string;
23
+ otp: number;
24
+ }) => void;
11
25
  }
12
26
  declare const BlockLogin: FC<Props & INavigateProps>;
13
27
  export default BlockLogin;
package/dist/index.css CHANGED
@@ -959,6 +959,12 @@
959
959
  color: #3ACB46; }
960
960
  ._eDBpS ._2K_sx ._1qkxy {
961
961
  color: #5D5D5B; }
962
+ ._eDBpS ._2K_sx ._1AeGu {
963
+ color: #DB4D4D; }
964
+ ._eDBpS ._2K_sx ._1xTB0 {
965
+ color: #FEAF06; }
966
+ ._eDBpS ._2K_sx ._3Yu_5 {
967
+ color: #3ACB46; }
962
968
  ._eDBpS ._2K_sx ._2jIeT {
963
969
  font-weight: 500;
964
970
  font-size: 12px;
package/dist/index.d.ts CHANGED
@@ -77,4 +77,5 @@ import LoadingComponent from "./components/Loading/LoadingComponent";
77
77
  import { checkSuperUrl } from "./utils/types/checkSuperUrl";
78
78
  import PrintExamResultView from "./containers/ExamResult/views/PrintExamResultView";
79
79
  import PrintExamView2 from "./components/Print/PrintExamView2";
80
- export { diffFromNow, formatTime, utcToLocalTime, setLoading, setReadyRegisterPusher, BASE_URL, SUPER_ADMIN_BASE_URL, ACCESS_TOKEN, Login, store, setAlert, setUser, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, CustomPagination, useGoogleSignOut, RecentUserAction, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, PrintExamView2, TheAcademyDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, ACADEMY_DOMAIN, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, CustomSelectOption, LoginWithPassword, getRecentUserActionListApi, getAccessToken, ChatContainer, getOrdinalSuffix, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, ConversationResponse, usePusherConversation, ExamResultV2, ToastContainer, toast, Role, useLanguage, useSwitchAcademy, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup, getAcademyDomain, useSubjectSelect, useLogin, useAutoAcademyDomain, createRecentUserActionListApi, LoginAccessTokenRequest, LoginRequest, setReFetchUserAcademies, ChatTypes, AcademyHeaders, Types, Enums, CoreHooks, Language, ArticleGroupView, AnswerCountSelector, QuestionCountSelector, ScoreSelector, ArticleCategorySelector, SubjectSelector, useCategorySelect, InputText, Textbook, TextbookDetail, TextbookList, timeUtils, Header, DEFAULT_PAGING_RESPONSE, PagingResponse, AcademyList, getErrorMessage, DefaultErrorMessage, useCountDownTimer, useLoadMore, useVirtualizeList, PassCodeCheck, PassCodeCheckProps, LoadingComponent, PrintExamResultView, checkSuperUrl };
80
+ import LoginWithEmail from "./containers/Login/views/LoginWithEmail";
81
+ export { diffFromNow, formatTime, utcToLocalTime, setLoading, setReadyRegisterPusher, BASE_URL, SUPER_ADMIN_BASE_URL, ACCESS_TOKEN, Login, store, setAlert, setUser, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, LoginWithEmail, CustomPagination, useGoogleSignOut, RecentUserAction, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, PrintExamView2, TheAcademyDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, ACADEMY_DOMAIN, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, CustomSelectOption, LoginWithPassword, getRecentUserActionListApi, getAccessToken, ChatContainer, getOrdinalSuffix, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, ConversationResponse, usePusherConversation, ExamResultV2, ToastContainer, toast, Role, useLanguage, useSwitchAcademy, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup, getAcademyDomain, useSubjectSelect, useLogin, useAutoAcademyDomain, createRecentUserActionListApi, LoginAccessTokenRequest, LoginRequest, setReFetchUserAcademies, ChatTypes, AcademyHeaders, Types, Enums, CoreHooks, Language, ArticleGroupView, AnswerCountSelector, QuestionCountSelector, ScoreSelector, ArticleCategorySelector, SubjectSelector, useCategorySelect, InputText, Textbook, TextbookDetail, TextbookList, timeUtils, Header, DEFAULT_PAGING_RESPONSE, PagingResponse, AcademyList, getErrorMessage, DefaultErrorMessage, useCountDownTimer, useLoadMore, useVirtualizeList, PassCodeCheck, PassCodeCheckProps, LoadingComponent, PrintExamResultView, checkSuperUrl };