{"version":3,"sources":["states/app-setting/app-setting.models.ts","states/global-value/global-value.models.ts","states/app-setting/app-setting.reducer.ts","states/global-value/global-value.reducer.ts","app.store.ts","states/account/account.reducer.ts","states/account/account.models.ts","modules/core/empty.tsx","shared/constants/api-endpoint.ts","states/account/account.api.ts","shared/plugins/http-service.ts","shared/constants/message.ts","states/account/account.action.ts","states/global-value/global-value.action.ts","states/order/order.api.ts","modules/account/login-page.tsx","shared/layout/aside.tsx","shared/layout/layout-app.tsx","shared/components/auth/auth-management.tsx","shared/plugins/history.ts","shared/components/loading/loading.tsx","shared/plugins/string-helper.ts","states/app-setting/app-setting.action.ts","modules/profile/profile.tsx","shared/components/toast/toast.tsx","shared/components/modal/modal-confirm.tsx","states/order/order.models.ts","states/customer-address/customer-address.api.ts","modules/address/address.tsx","states/address/address.api.ts","modules/address/address-add-update.tsx","modules/order/order-status.tsx","modules/order/order.tsx","modules/order/payment-status.tsx","modules/order/order-detail.tsx","app.tsx","serviceWorker.ts","init-firebase.tsx","index.tsx"],"names":["LanguageType","CurrencyType","ToastType","initialState","currencyType","VND","language","English","logoUrl","activatedMenu","isLoading","activeMenu","toast","duration","confirm","onClose","onYes","isModal","message","rootReducer","combineReducers","appSetting","state","action","type","USD","activeValue","globalValue","payload","status","isShowToast","account","currentUser","isAuthentication","EmptyPage","props","useEffect","document","title","CUSTOMER_ADDRESS_API","API_V1_URI","signIn","idToken","a","postHttp","process","loginResponse","data","createCustomerInfo","signUp","model","logout","getProfile","getHttp","profileResponse","updateProfile","putHttp","verifyPhone","url","config","axios","get","post","put","interceptors","response","use","error","originalRequest","endsWith","refreshToken","getRefreshToken","token","res","setRefreshToken","setToken","accessToken","removeToken","removeRefreshToken","location","href","Promise","reject","request","getToken","headers","localStorage","getItem","removeItem","setItem","DefaultErrorMessage","setLoginUser","user","setLogoutUser","undefined","globalValueSetLoading","globalValueSetToast","globalValueShowConfirmModal","confirmModal","getOrderListApi","CUSTOMER_ORDER_API","getOrderApi","id","mergedCartApi","SHOPPING_WEBSITE_CART_API","initialValues","name","email","LoginPage","isLogin","useSelector","shallowEqual","isSubmitting","useState","tokenTemp","setTokenTemp","isUpdateData","setUpdateData","dispatch","useDispatch","getCallbackUrl","search","window","URLSearchParams","onLoginSubmit","_handleMergedShoppingCart","callbackUrl","shoppingCart","JSON","parse","onCreatedSubmit","values","uiConfig","signInOptions","provider","firebase","auth","PhoneAuthProvider","PROVIDER_ID","requireDisplayName","recaptchaParameters","size","badge","defaultCountry","whitelistedCountries","callbacks","signInSuccessWithAuthResult","authResult","redirectUrl","getIdToken","then","signInFlow","languageCode","firebaseui","AuthUI","getInstance","start","initFirebaseUI","to","className","validate","errors","test","onSubmit","actions","setSubmitting","htmlFor","placeholder","component","disabled","AsideComponent","activedMenu","key","_","isEmpty","charAt","onClick","LayoutApp","children","unAuthPath","AuthManagement","useLocation","history","useHistory","isUnAuthPath","filter","m","pathname","startsWith","length","userProfile","catch","push","createBrowserHistory","Loading","clsx","formatMoney","n","c","d","t","f","j","Math","abs","s","i","parseInt","toFixed","substr","replace","slice","setActiveSidebar","Profile","phone","userModel","setUserModel","_handleUpdateProfile","success","phoneNumber","Fragment","value","onChange","e","target","ToastComponent","toastState","warn","info","dark","_onToast","autoClose","customStyles","content","top","left","right","bottom","transform","overlay","backgroundColor","zIndex","Modal","setAppElement","OrderStatus","PaymentStatus","ModalComponent","style","isOpen","createCustomerAddressApi","customerAddressModel","getAllCustomerAddressApi","getCustomerAddressApi","updateCustomerAddressApi","removeCustomerAddressApi","deleteHttp","delete","Address","customerAddressList","setCustomerAddressList","_handleGetCustomerAddress","result","_handleRemove","ev","preventDefault","map","address","wardName","districtName","provinceName","getProvinceListApi","ADDRESS_API","getDistrictListApi","provinceId","getWardListApi","districtId","AddressAddUpdate","customerAddress","setCustomerAddress","provinces","setProvinces","districts","setDistricts","wards","setWards","params","useParams","isUpdate","setIsUpdate","_handleGetAddress","_handleGetDistricts","_handleGetWards","_handleGetProvince","_handleSubmit","reload","indexOf","Number","wardId","province","district","ward","OrderStatusComponent","orderStatus","Cancel","Processing","Shipping","Completed","renderStatus","Order","pagedResults","setPagedResults","page","pageSize","filterModel","handleSearch","callback","gotoPage","useDebouncedCallback","results","orderNumber","moment","creationTime","format","totalAmount","PaymentStatusComponent","paymentStatus","Unpaid","Paid","OrderDetail","setModel","getOrder","orderId","shipName","shipPhoneNumber","textAlign","orderItems","src","skuImage","width","alt","skuName","price","quantity","colSpan","subTotalAmount","shippingFee","discountAmount","store","createStore","composeWithDevTools","App","path","exact","Boolean","hostname","match","initializeApp","apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId","ReactDOM","render","StrictMode","getElementById","navigator","serviceWorker","ready","registration","unregister","console"],"mappings":"mOAOYA,EAKAC,E,kEALAD,O,qBAAAA,I,4BAAAA,M,cAKAC,O,aAAAA,I,cAAAA,M,KAKL,ICHKC,ECLNC,EAAgC,CACpCC,aAAcH,EAAaI,IAC3BC,SAAUN,EAAaO,QACvBC,QAAS,2BACTC,cAAe,K,SDCLP,O,qBAAAA,I,eAAAA,I,eAAAA,I,iBAAAA,I,qBAAAA,I,gBAAAA,M,KAeL,IEfDC,EAAiC,CACrCO,WAAW,EACXC,WAAY,GACZC,MAAO,CACLC,SAAU,KAEZC,QAAS,CACPC,QAAS,aACTC,MAAO,aACPC,SAAS,EACTC,QAAS,KCnBN,IAAMC,EAAcC,0BAAgB,CACzCC,WFUK,WAGa,IAFlBC,EAEiB,uDAFTnB,EACRoB,EACiB,uCACjB,OAAQA,EAAOC,MACb,IFJ+B,sBEK7B,OAAO,2BACFF,GADL,IAEElB,aAAcH,EAAawB,MAE/B,IFJ8B,qBEK5B,OAAO,2BACFH,GADL,IAEEb,cAAec,EAAOG,cAE1B,QACE,OAAOJ,IEzBXK,YDqBK,WAGc,IAFnBL,EAEkB,uDAFVnB,EACRoB,EACkB,uCAClB,OAAQA,EAAOC,MACb,IFJkC,yBEKhC,OAAO,2BACFF,GADL,IAEEZ,UAAWa,EAAOK,UAEt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A,kBAACtI,GAAD,SChCY+J,QACW,cAA7BvO,OAAO3C,SAASmR,UAEe,UAA7BxO,OAAO3C,SAASmR,UAEhBxO,OAAO3C,SAASmR,SAASC,MACvB,2DChBF5N,IAAS6N,cAAc,CACnBC,OAAQ,0CACRC,WAAY,mCACZC,UAAW,mBACXC,cAAe,+BACfC,kBAAmB,eACnBC,MAAO,4CACPC,cAAe,iBCHvBC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,GAAD,OAEFzU,SAAS0U,eAAe,SFiIpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB5N,MAAK,SAAA6N,GACJA,EAAaC,gBAEdrL,OAAM,SAAA5H,GACLkT,QAAQlT,MAAMA,EAAMjD,a","file":"static/js/main.98f7542f.chunk.js","sourcesContent":["export interface AppSettingState {\r\n language: LanguageType;\r\n currencyType: CurrencyType;\r\n logoUrl: string;\r\n activatedMenu: string;\r\n}\r\n\r\nexport enum LanguageType {\r\n English,\r\n VietNamese,\r\n}\r\n\r\nexport enum CurrencyType {\r\n USD,\r\n VND,\r\n}\r\n\r\nexport const SET_DEFAULT_SETTING = \"SET_DEFAULT_SETTING\";\r\ninterface SetDefaultSetting {\r\n type: typeof SET_DEFAULT_SETTING;\r\n}\r\n\r\nexport const SET_ACTIVE_SIDEBAR = \"SET_ACTIVE_SIDEBAR\";\r\ninterface SetActiveSidebar {\r\n type: typeof SET_ACTIVE_SIDEBAR;\r\n activeValue: string;\r\n}\r\n\r\nexport type AppSettingActionType = SetDefaultSetting | SetActiveSidebar;\r\n","export interface GlobalValueState {\r\n isLoading: boolean;\r\n toast: ToastModel;\r\n confirm: ConfirmModel;\r\n activeMenu: string;\r\n}\r\n\r\nexport interface ToastModel {\r\n isShowToast: boolean;\r\n status: string;\r\n message: string;\r\n duration: number;\r\n type:ToastType\r\n}\r\nexport enum ToastType{\r\n success,\r\n warn,\r\n info,\r\n error,\r\n default,\r\n dark\r\n}\r\nexport interface ConfirmModel {\r\n onClose?: any;\r\n onYes?: any;\r\n isModal?: boolean;\r\n message?: string;\r\n}\r\n\r\nexport const GlobalValue_SetLoading = \"GlobalValue_SetLoading\";\r\ninterface GlobalValueSetLoading {\r\n type: typeof GlobalValue_SetLoading;\r\n payload: boolean;\r\n}\r\n\r\nexport const GlobalValue_SetToast = \"GlobalValue_SetToast\";\r\ninterface GlobalValueSetToast {\r\n type: typeof GlobalValue_SetToast;\r\n payload: ToastModel;\r\n}\r\n\r\nexport const GlobalValue_ShowSuccess = \"GlobalValue_ShowSuccess\";\r\ninterface GlobalValueShowSuccess {\r\n type: typeof GlobalValue_ShowSuccess;\r\n payload: string;\r\n}\r\n\r\nexport const GlobalValue_ShowError = \"GlobalValue_ShowError\";\r\ninterface GlobalValueShowError {\r\n type: typeof GlobalValue_ShowError;\r\n payload: string;\r\n}\r\n\r\nexport const GlobalValue_ShowWarning = \"GlobalValue_ShowWarning\";\r\ninterface GlobalValueShowWarning {\r\n type: typeof GlobalValue_ShowWarning;\r\n payload: string;\r\n}\r\n\r\nexport const GlobalValue_ShowInfo = \"GlobalValue_ShowInfo\";\r\ninterface GlobalValueShowInfo {\r\n type: typeof GlobalValue_ShowInfo;\r\n payload: string;\r\n}\r\n\r\nexport const GlobalValue_ShowConfirmModal = \"GlobalValue_ShowConfirmModal\";\r\ninterface GlobalValueShowConfirmModal {\r\n type: typeof GlobalValue_ShowConfirmModal;\r\n payload: ConfirmModel;\r\n}\r\n\r\nexport const GlobalValue_CloseConfirmModal = \"GlobalValue_CloseConfirmModal\";\r\ninterface GlobalValueCloseConfirmModal {\r\n type: typeof GlobalValue_CloseConfirmModal;\r\n}\r\n\r\nexport const GlobalValue_SetPageTitle = \"GlobalValue_SetPageTitle\";\r\ninterface GlobalValueSetPageTitle {\r\n type: typeof GlobalValue_SetPageTitle;\r\n payload: string;\r\n}\r\n\r\n\r\nexport type GlobalValueActionType =\r\n | GlobalValueSetLoading\r\n | GlobalValueSetToast\r\n | GlobalValueShowSuccess\r\n | GlobalValueShowError\r\n | GlobalValueShowWarning\r\n | GlobalValueShowInfo\r\n | GlobalValueShowConfirmModal\r\n | GlobalValueCloseConfirmModal\r\n | GlobalValueSetPageTitle;\r\n","import {\r\n AppSettingState,\r\n CurrencyType,\r\n LanguageType,\r\n AppSettingActionType,\r\n SET_DEFAULT_SETTING,\r\n SET_ACTIVE_SIDEBAR,\r\n} from \"./app-setting.models\";\r\n\r\nconst initialState: AppSettingState = {\r\n currencyType: CurrencyType.VND,\r\n language: LanguageType.English,\r\n logoUrl: \"/cms-app/images/logo.png\",\r\n activatedMenu: \"\",\r\n};\r\n\r\nexport function appSettingReducer(\r\n state = initialState,\r\n action: AppSettingActionType\r\n): AppSettingState {\r\n switch (action.type) {\r\n case SET_DEFAULT_SETTING:\r\n return {\r\n ...state,\r\n currencyType: CurrencyType.USD,\r\n };\r\n case SET_ACTIVE_SIDEBAR:\r\n return {\r\n ...state,\r\n activatedMenu: action.activeValue,\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n","import {\r\n GlobalValueState,\r\n GlobalValueActionType,\r\n GlobalValue_SetLoading,\r\n ToastModel,\r\n GlobalValue_SetToast,\r\n GlobalValue_ShowWarning,\r\n GlobalValue_ShowSuccess,\r\n GlobalValue_ShowError,\r\n GlobalValue_ShowInfo,\r\n ConfirmModel,\r\n GlobalValue_ShowConfirmModal,\r\n} from \"./global-value.models\";\r\n\r\nconst initialState: GlobalValueState = {\r\n isLoading: false,\r\n activeMenu: \"\",\r\n toast: {\r\n duration: 3000,\r\n } as ToastModel,\r\n confirm: {\r\n onClose: () =>{},\r\n onYes: () =>{},\r\n isModal: false,\r\n message: \"\"\r\n } as ConfirmModel,\r\n};\r\n\r\nexport function globalValueReducer(\r\n state = initialState,\r\n action: GlobalValueActionType\r\n): GlobalValueState {\r\n switch (action.type) {\r\n case GlobalValue_SetLoading:\r\n return {\r\n ...state,\r\n isLoading: action.payload,\r\n };\r\n case GlobalValue_SetToast:\r\n return {\r\n ...state,\r\n toast: action.payload,\r\n };\r\n case GlobalValue_ShowSuccess:\r\n return {\r\n ...state,\r\n toast: {\r\n ...state.toast,\r\n message: action.payload,\r\n status: \"success\",\r\n isShowToast: true,\r\n },\r\n };\r\n case GlobalValue_ShowError:\r\n return {\r\n ...state,\r\n toast: {\r\n ...state.toast,\r\n message: action.payload,\r\n status: \"error\",\r\n isShowToast: true,\r\n },\r\n };\r\n case GlobalValue_ShowWarning:\r\n return {\r\n ...state,\r\n toast: {\r\n ...state.toast,\r\n message: action.payload,\r\n status: \"warning\",\r\n isShowToast: true,\r\n },\r\n };\r\n case GlobalValue_ShowInfo:\r\n return {\r\n ...state,\r\n toast: {\r\n ...state.toast,\r\n message: action.payload,\r\n status: \"info\",\r\n isShowToast: true,\r\n },\r\n };\r\n case GlobalValue_ShowConfirmModal:\r\n return {\r\n ...state,\r\n confirm: {\r\n ...state.confirm,\r\n onClose: action.payload.onClose,\r\n onYes: action.payload.onYes,\r\n isModal: action.payload.isModal,\r\n message: action.payload.message,\r\n } as ConfirmModel,\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { combineReducers } from \"redux\";\r\nimport { appSettingReducer } from \"./states/app-setting/app-setting.reducer\";\r\nimport { globalValueReducer } from \"./states/global-value/global-value.reducer\";\r\nimport { accountReducer } from \"states/account/account.reducer\";\r\n\r\nexport const rootReducer = combineReducers({\r\n appSetting: appSettingReducer,\r\n globalValue: globalValueReducer,\r\n account: accountReducer,\r\n});\r\nexport type RootState = ReturnType;\r\n","import {\r\n AccountState,\r\n AccountActionType,\r\n Account_SetLoginUser,\r\n Account_LogoutUser,\r\n} from \"./account.models\";\r\n\r\nexport function accountReducer(\r\n state = {} as AccountState,\r\n action: AccountActionType\r\n): AccountState {\r\n switch (action.type) {\r\n case Account_SetLoginUser:\r\n return {\r\n ...state,\r\n currentUser: action.payload,\r\n isAuthentication: !!action.payload,\r\n };\r\n case Account_LogoutUser:\r\n return {\r\n ...state,\r\n currentUser: action.payload,\r\n isAuthentication: false,\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n","export interface ChangePasswordModel {\r\n currentPassword: string;\r\n newPassword: string;\r\n confirmPassword: string;\r\n}\r\n\r\nexport interface ForgotPasswordModel {\r\n email: string;\r\n}\r\nexport interface ResetPasswordModel {\r\n userId: string;\r\n token: string;\r\n newPassword: string;\r\n confirmPassword: string;\r\n}\r\n\r\nexport interface AccountState {\r\n currentUser?: CurrentUser;\r\n isAuthentication?: boolean;\r\n}\r\n\r\nexport interface LoginResponse {\r\n accessToken?: string;\r\n refreshToken?: string;\r\n}\r\n\r\nexport interface CurrentUser {\r\n lockoutEnd?: string;\r\n phoneNumberConfirmed?: boolean;\r\n phoneNumber?: string;\r\n emailConfirmed?: false;\r\n normalizedEmail?: string;\r\n email?: string;\r\n normalizedUserName?: string;\r\n userName?: string;\r\n id: string;\r\n accessFailedCount?: number;\r\n firstName?: string;\r\n lastName?: string;\r\n name?: string;\r\n}\r\nexport interface UpdateCurrentUser{\r\n name: string;\r\n email: string;\r\n}\r\nexport interface LoginUserModel {\r\n userName: string;\r\n password: string;\r\n}\r\nexport interface CreatedAccountModel{\r\n name: string;\r\n email: string;\r\n idToken: string;\r\n}\r\nexport const Account_SetLoginUser = \"Account_SetLoginUser\";\r\ninterface AccountSetLoginUser {\r\n type: typeof Account_SetLoginUser;\r\n payload: CurrentUser;\r\n}\r\n\r\nexport const Account_LogoutUser = \"Account_LogoutUser\";\r\ninterface AccountLogOutUser {\r\n type: typeof Account_LogoutUser;\r\n payload: undefined;\r\n}\r\n\r\nexport type AccountActionType = AccountSetLoginUser | AccountLogOutUser;\r\n","import React,{ FC, useEffect } from \"react\";\r\n\r\nconst EmptyPage: FC = (props) => {\r\n useEffect(() => {\r\n document.title = \"Empty\";\r\n },[])\r\n return null;\r\n};\r\n\r\nexport default EmptyPage;\r\n","export const API_V1_URI = \"/api/v1\";\r\nexport const ACCOUNT_API_LOGIN = API_V1_URI + \"/accounts/login\";\r\nexport const ACCOUNT_API_PROFILE = API_V1_URI + \"/accounts/profile\";\r\nexport const ACCOUNT_API_PASSWORD = API_V1_URI + \"/accounts/update-password\";\r\nexport const ACCOUNT_API_UPDATE = API_V1_URI + \"/accounts/update-profile\";\r\nexport const ACCOUNT_API_FORGOT_PASSWORD =\r\n API_V1_URI + \"/accounts/forgot-password\";\r\nexport const ACCOUNT_API_RESET_PASSWORD =\r\n API_V1_URI + \"/accounts/reset-password\";\r\nexport const ACCOUNT_API_VERIFY_PHONE = API_V1_URI + \"/accounts/verify-phone\";\r\nexport const ACCOUNT_API_REFRESH_TOKEN = API_V1_URI + \"/accounts/refresh-token\";\r\nexport const ACCOUNT_API_SIGN_UP_PHONE =\r\n API_V1_URI + \"/website/accounts/sign-up-phone\";\r\nexport const ACCOUNT_API_SIGN_IN_PHONE =\r\n API_V1_URI + \"/website/accounts/sign-in-phone\";\r\nexport const CLIENT_CUSTOMER_API = API_V1_URI + \"/client/customers\";\r\nexport const ACCOUNT_API_LOGOUT = API_V1_URI + \"/website/accounts/logout\";\r\nexport const CUSTOMER_ADDRESS_API = API_V1_URI + \"/client/customer_addresses\";\r\nexport const ADDRESS_API = API_V1_URI + \"/addresses\";\r\nexport const PROVINCE_API = ADDRESS_API + \"/provinces\";\r\nexport const DISTRICT_API = ADDRESS_API + \"/districts\";\r\nexport const WARD_API = ADDRESS_API + \"/wards\";\r\nexport const CUSTOMER_ORDER_API = API_V1_URI + \"/client/customer_orders\";\r\nexport const CUSTOMER_ORDER_API_SEARCH = CUSTOMER_ORDER_API + \"/search\";\r\nexport const SHOPPING_CART_ADD_ITEMS_API =\r\n API_V1_URI + \"/client/shopping-cart/create-items\";\r\nexport const SHOPPING_WEBSITE_CART_API = API_V1_URI + \"/website/shopping-cart\";\r\nexport const SHOPPING_WEBSITE_MERGED_CART_API = SHOPPING_WEBSITE_CART_API + \"/merged-cart\";","import { getHttp, postHttp, putHttp } from \"shared/plugins/http-service\";\r\nimport {\r\n ACCOUNT_API_PASSWORD,\r\n ACCOUNT_API_FORGOT_PASSWORD,\r\n ACCOUNT_API_RESET_PASSWORD,\r\n ACCOUNT_API_PROFILE,\r\n ACCOUNT_API_LOGIN,\r\n ACCOUNT_API_VERIFY_PHONE,\r\n ACCOUNT_API_SIGN_IN_PHONE,\r\n ACCOUNT_API_SIGN_UP_PHONE,\r\n ACCOUNT_API_UPDATE,\r\n ACCOUNT_API_LOGOUT,\r\n CLIENT_CUSTOMER_API,\r\n} from \"shared/constants/api-endpoint\";\r\nimport {\r\n ChangePasswordModel,\r\n CreatedAccountModel,\r\n CurrentUser,\r\n ForgotPasswordModel,\r\n LoginResponse,\r\n LoginUserModel,\r\n ResetPasswordModel,\r\n UpdateCurrentUser,\r\n} from \"./account.models\";\r\n\r\nexport const changePasswordApi = async (\r\n changePasswordModel: ChangePasswordModel\r\n) => {\r\n const response = await putHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_PASSWORD}`,\r\n changePasswordModel\r\n );\r\n return response;\r\n};\r\nexport const forgotPasswordApi = async (\r\n forgotPasswordModel: ForgotPasswordModel\r\n) => {\r\n const response = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_FORGOT_PASSWORD}`,\r\n forgotPasswordModel\r\n );\r\n return response;\r\n};\r\nexport const resetPasswordApi = async (\r\n resetPasswordModel: ResetPasswordModel\r\n) => {\r\n const response = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_RESET_PASSWORD}`,\r\n resetPasswordModel\r\n );\r\n return response;\r\n};\r\n\r\nexport const login = async (loginModel: LoginUserModel) => {\r\n const loginResponse = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_LOGIN}`,\r\n loginModel\r\n );\r\n return loginResponse.data;\r\n};\r\n\r\nexport const signIn = async (idToken: string) => {\r\n const loginResponse = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_SIGN_IN_PHONE}`,\r\n { idToken: idToken }\r\n );\r\n return loginResponse.data;\r\n};\r\n\r\nexport const createCustomerInfo = async () => {\r\n return await postHttp(\r\n `${process.env.REACT_APP_API_URI}${CLIENT_CUSTOMER_API}`\r\n );\r\n};\r\n\r\nexport const signUp = async (model: CreatedAccountModel) => {\r\n const loginResponse = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_SIGN_UP_PHONE}`,\r\n model\r\n );\r\n return loginResponse.data;\r\n};\r\nexport const logout = async () => {\r\n return await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_LOGOUT}`\r\n );\r\n};\r\n\r\nexport const getProfile = async () => {\r\n const profileResponse = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_PROFILE}`\r\n );\r\n return profileResponse.data;\r\n};\r\n\r\nexport const updateProfile = async (model: UpdateCurrentUser) => {\r\n const profileResponse = await putHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_UPDATE}`,\r\n model\r\n );\r\n return profileResponse.data;\r\n};\r\n\r\nexport const verifyPhone = async (idToken: string) => {\r\n const profileResponse = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${ACCOUNT_API_VERIFY_PHONE}`,\r\n { idToken: idToken }\r\n );\r\n return profileResponse.data;\r\n};\r\n","import { AxiosRequestConfig, AxiosResponse } from \"axios\";\r\nimport axios from \"axios\";\r\nimport { ACCOUNT_API_REFRESH_TOKEN } from \"shared/constants/api-endpoint\";\r\nimport { logout } from \"states/account/account.api\";\r\n\r\nconst accessTokenName = \"AccessToken\";\r\nconst refreshTokenName = \"RefreshToken\";\r\nconst shoppingCart = \"ShoppingCart\";\r\n\r\naxios.interceptors.response.use(\r\n (response) => {\r\n return response;\r\n },\r\n async function (error) {\r\n const originalRequest = error.config;\r\n if (\r\n error.response &&\r\n error.response.status === 401 &&\r\n !originalRequest.url.endsWith(ACCOUNT_API_REFRESH_TOKEN)\r\n ) {\r\n const refreshToken = getRefreshToken();\r\n if (refreshToken) {\r\n try {\r\n const res = await axios.post(\r\n process.env.REACT_APP_API_URI + ACCOUNT_API_REFRESH_TOKEN,\r\n {\r\n token: refreshToken,\r\n }\r\n );\r\n setRefreshToken(res.data.refreshToken);\r\n setToken(res.data.accessToken);\r\n return axios(originalRequest);\r\n } catch (e) {\r\n removeToken();\r\n removeRefreshToken();\r\n logout();\r\n document.location.href = \"/login\";\r\n return Promise.reject(error);\r\n }\r\n }\r\n logout();\r\n document.location.href = \"/login\";\r\n return Promise.reject(error);\r\n }\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\naxios.interceptors.request.use(\r\n (config) => {\r\n const token = getToken();\r\n if (token) {\r\n config.headers[\"Authorization\"] = \"Bearer \" + token;\r\n }\r\n return config;\r\n },\r\n (error) => {\r\n Promise.reject(error);\r\n }\r\n);\r\n\r\nexport function getHttp>(\r\n url: string,\r\n config?: AxiosRequestConfig\r\n): Promise {\r\n return axios.get(url, config);\r\n}\r\n\r\nexport function postHttp>(\r\n url: string,\r\n data?: any,\r\n config?: AxiosRequestConfig\r\n): Promise {\r\n return axios.post(url, data, config);\r\n}\r\n\r\nexport function deleteHttp>(\r\n url: string,\r\n config?: AxiosRequestConfig\r\n): Promise {\r\n return axios.delete(url, config);\r\n}\r\n\r\nexport function putHttp>(\r\n url: string,\r\n data?: any,\r\n config?: AxiosRequestConfig\r\n): Promise {\r\n return axios.put(url, data, config);\r\n}\r\n\r\nexport const getToken = () => localStorage.getItem(accessTokenName);\r\nexport const removeToken = () => localStorage.removeItem(accessTokenName);\r\nexport const setToken = (token?: string) =>\r\n localStorage.setItem(accessTokenName, token ?? \"\");\r\nexport const getRefreshToken = () => localStorage.getItem(refreshTokenName);\r\nexport const removeRefreshToken = () =>\r\n localStorage.removeItem(refreshTokenName);\r\nexport const setRefreshToken = (token?: string) =>\r\n localStorage.setItem(refreshTokenName, token ?? \"\");\r\nexport const getShoppingCartLocal = () => localStorage.getItem(shoppingCart);\r\nexport const removeShoppingCartLocal = () => localStorage.removeItem(shoppingCart);\r\n","export const DefaultErrorMessage = \"Sự cố kỹ thuật, vui lòng thử lại sau\";\r\nexport const UpdateDataSuccessfully = \"Cập nhật dữ liệu thành công\";\r\nexport const QuestionRemove = \"Bạn có chắc chắn muốn xóa không?\";","import { removeRefreshToken, removeToken } from \"shared/plugins/http-service\";\r\nimport {\r\n Account_SetLoginUser,\r\n CurrentUser,\r\n Account_LogoutUser,\r\n} from \"./account.models\";\r\n\r\nexport const setLoginUser = (user: CurrentUser) => {\r\n return {\r\n type: Account_SetLoginUser,\r\n payload: user,\r\n };\r\n};\r\n\r\nexport const setLogoutUser = () => {\r\n removeToken();\r\n removeRefreshToken();\r\n return {\r\n type: Account_LogoutUser,\r\n payload: undefined,\r\n };\r\n};\r\n","import {\r\n GlobalValueActionType,\r\n GlobalValue_SetLoading,\r\n GlobalValue_SetToast,\r\n ToastModel,\r\n GlobalValue_ShowSuccess,\r\n GlobalValue_ShowError,\r\n GlobalValue_ShowWarning,\r\n GlobalValue_ShowInfo,\r\n GlobalValue_ShowConfirmModal,\r\n ConfirmModel,\r\n GlobalValue_CloseConfirmModal,\r\n GlobalValue_SetPageTitle,\r\n} from \"./global-value.models\";\r\n\r\nexport const globalValueSetLoading = (\r\n isLoading: boolean\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_SetLoading,\r\n payload: isLoading,\r\n };\r\n};\r\n\r\nexport const globalValueSetToast = (\r\n toast: ToastModel\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_SetToast,\r\n payload: toast,\r\n };\r\n};\r\n\r\nexport const globalValueShowSuccessToast = (\r\n message: string\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_ShowSuccess,\r\n payload: message,\r\n };\r\n};\r\n\r\nexport const globalValueShowErrorToast = (\r\n message: string\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_ShowError,\r\n payload: message,\r\n };\r\n};\r\n\r\nexport const globalValueShowWarningToast = (\r\n message: string\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_ShowWarning,\r\n payload: message,\r\n };\r\n};\r\n\r\nexport const globalValueShowInfoToast = (\r\n message: string\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_ShowInfo,\r\n payload: message,\r\n };\r\n};\r\n\r\nexport const globalValueShowConfirmModal = (\r\n confirmModal: ConfirmModel\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_ShowConfirmModal,\r\n payload: confirmModal,\r\n };\r\n};\r\n\r\nexport const globalValueCloseConfirmModal = (): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_CloseConfirmModal,\r\n };\r\n};\r\n\r\nexport const globalValueSetPageTitle = (\r\n title: string\r\n): GlobalValueActionType => {\r\n return {\r\n type: GlobalValue_SetPageTitle,\r\n payload: title,\r\n };\r\n};\r\n\r\n","import { AddItemsModel, OrderModel, SearchOrderRequestModel } from './order.models';\r\nimport { getHttp, getShoppingCartLocal, postHttp } from \"shared/plugins/http-service\";\r\nimport {\r\n CUSTOMER_ORDER_API, CUSTOMER_ORDER_API_SEARCH, SHOPPING_CART_ADD_ITEMS_API, SHOPPING_WEBSITE_MERGED_CART_API\r\n} from \"shared/constants/api-endpoint\";\r\nimport { PagedResult } from \"../paged-result-model\";\r\nexport const getOrderListApi = async (model: SearchOrderRequestModel) => {\r\n const response = await postHttp>(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ORDER_API_SEARCH}`,model\r\n );\r\n return response;\r\n};\r\n\r\nexport const getOrderApi = async (id: number | string) => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ORDER_API}/${id}`\r\n );\r\n return response;\r\n};\r\nexport const addItemsApi = async (model : AddItemsModel) => {\r\n const response = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${SHOPPING_CART_ADD_ITEMS_API}`,model\r\n );\r\n return response;\r\n};\r\n\r\nexport const mergedCartApi = async (model: OrderModel) => {\r\n const response = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${SHOPPING_WEBSITE_MERGED_CART_API}`,model\r\n );\r\n return response;\r\n};\r\n\r\n","import * as React from \"react\";\r\nimport { FC, useEffect, useState } from \"react\";\r\nimport { useSelector, shallowEqual, useDispatch } from \"react-redux\";\r\nimport \"./login-page.less\";\r\nimport {\r\n getShoppingCartLocal,\r\n removeShoppingCartLocal,\r\n setRefreshToken,\r\n setToken,\r\n} from \"shared/plugins/http-service\";\r\nimport { RootState } from \"app.store\";\r\nimport { Link, Redirect } from \"react-router-dom\";\r\nimport { DefaultErrorMessage } from \"shared/constants/message\";\r\nimport firebase from \"firebase/app\";\r\nimport * as firebaseui from \"firebaseui\";\r\nimport \"firebaseui/dist/npm__vi\";\r\nimport \"firebaseui/dist/firebaseui.css\";\r\nimport \"./login-page.less\";\r\nimport { setLoginUser } from \"states/account/account.action\";\r\nimport {\r\n createCustomerInfo,\r\n getProfile,\r\n login,\r\n signIn,\r\n signUp,\r\n verifyPhone,\r\n} from \"states/account/account.api\";\r\nimport {\r\n Formik,\r\n FormikProps,\r\n Form,\r\n Field,\r\n ErrorMessage,\r\n FormikErrors,\r\n} from \"formik\";\r\nimport { CreatedAccountModel } from \"states/account/account.models\";\r\nimport {\r\n globalValueSetLoading,\r\n globalValueSetToast,\r\n} from \"states/global-value/global-value.action\";\r\nimport { ToastModel, ToastType } from \"states/global-value/global-value.models\";\r\nimport { addItemsApi, mergedCartApi } from \"states/order/order.api\";\r\nimport { AddItemsModel } from \"states/order/order.models\";\r\n\r\ntype LoginPageProps = FormikProps &\r\n FormikErrors;\r\n\r\nconst initialValues: CreatedAccountModel = {\r\n name: \"\",\r\n email: \"\",\r\n idToken: \"\",\r\n};\r\nconst LoginPage: FC = (props) => {\r\n const isLogin = useSelector(\r\n (state: RootState) => state.account.isAuthentication,\r\n shallowEqual\r\n );\r\n const { isSubmitting } = props;\r\n const [tokenTemp, setTokenTemp] = useState(\"\");\r\n const [isUpdateData, setUpdateData] = useState(false);\r\n const dispatch = useDispatch();\r\n\r\n const getCallbackUrl = () => {\r\n const search = window.location.search;\r\n const params = new URLSearchParams(search);\r\n return params.get(\"callback\");\r\n };\r\n const onLoginSubmit = async (idToken: string) => {\r\n dispatch(globalValueSetLoading(true));\r\n try {\r\n const loginResponse = await signIn(idToken);\r\n setRefreshToken(loginResponse.refreshToken);\r\n setToken(loginResponse.accessToken);\r\n await _handleMergedShoppingCart();\r\n const callbackUrl = getCallbackUrl();\r\n if (callbackUrl !== null && callbackUrl !== \"\") {\r\n window.location.href = callbackUrl;\r\n } \r\n else {\r\n dispatch(setLoginUser(await getProfile()));\r\n dispatch(globalValueSetLoading(false));\r\n }\r\n } catch (error) {\r\n dispatch(globalValueSetLoading(false));\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message ?? DefaultErrorMessage,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const _handleMergedShoppingCart = async () => {\r\n try {\r\n let shoppingCart = getShoppingCartLocal();\r\n if (shoppingCart !== null && shoppingCart !== \"\") {\r\n await mergedCartApi(JSON.parse(shoppingCart));\r\n removeShoppingCartLocal();\r\n }\r\n } catch (error) {\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message ?? DefaultErrorMessage,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const onCreatedSubmit = async (values: CreatedAccountModel) => {\r\n dispatch(globalValueSetLoading(true));\r\n try {\r\n const loginResponse = await signUp(values);\r\n setRefreshToken(loginResponse.refreshToken);\r\n setToken(loginResponse.accessToken);\r\n await _handleMergedShoppingCart();\r\n await createCustomerInfo();\r\n const callbackUrl = getCallbackUrl();\r\n if (callbackUrl) {\r\n window.location.href = callbackUrl;\r\n } else {\r\n dispatch(setLoginUser(await getProfile()));\r\n dispatch(globalValueSetLoading(false));\r\n }\r\n } catch (error) {\r\n dispatch(globalValueSetLoading(false));\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message ?? DefaultErrorMessage,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const uiConfig = {\r\n signInOptions: [\r\n {\r\n provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,\r\n requireDisplayName: false,\r\n recaptchaParameters: {\r\n type: \"image\", // 'audio'\r\n size: \"normal\", // 'invisible' or 'compact'\r\n badge: \"bottomleft\", //' bottomright' or 'inline' applies to invisible.\r\n },\r\n defaultCountry: \"VN\",\r\n whitelistedCountries: [\"VN\", \"+84\"],\r\n },\r\n ],\r\n callbacks: {\r\n signInSuccessWithAuthResult: (authResult: any, redirectUrl: any) => {\r\n firebase\r\n .auth()\r\n .currentUser?.getIdToken(true)\r\n .then(async (idToken) => {\r\n let response = await verifyPhone(idToken);\r\n if (response) {\r\n await onLoginSubmit(idToken);\r\n } else {\r\n setUpdateData(true);\r\n setTokenTemp(idToken);\r\n }\r\n });\r\n return true;\r\n },\r\n },\r\n signInFlow: \"popup\",\r\n };\r\n const initFirebaseUI = () => {\r\n let firebaseAuth = firebase.auth();\r\n firebaseAuth.languageCode = \"vi\";\r\n if (firebaseui.auth.AuthUI.getInstance()) {\r\n firebaseui.auth.AuthUI.getInstance()?.start(\r\n \"#firebaseui-auth-container\",\r\n uiConfig\r\n );\r\n } else {\r\n let ui = new firebaseui.auth.AuthUI(firebase.auth());\r\n ui.start(\"#firebaseui-auth-container\", uiConfig);\r\n }\r\n // let ui = new firebaseui.auth.AuthUI(firebaseAuth);\r\n // ui.reset();\r\n // ui.start(\"#firebaseui-auth-container\", uiConfig);\r\n };\r\n useEffect(() => {\r\n initFirebaseUI();\r\n document.title = \"Đăng nhập\";\r\n }, []);\r\n return isLogin ? (\r\n \r\n ) : (\r\n
\r\n {!isUpdateData ? (\r\n \r\n
\r\n
\r\n \r\n ) : (\r\n
\r\n
\r\n {\r\n let errors: FormikErrors = {};\r\n if (!values.name) {\r\n errors.name = \"* Họ và tên bắt buộc\";\r\n }\r\n if (\r\n values.email &&\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i.test(values.email)\r\n ) {\r\n errors.email = \"* email không hợp lệ\";\r\n }\r\n return errors;\r\n }}\r\n onSubmit={async (values, actions) => {\r\n actions.setSubmitting(false);\r\n values.idToken = tokenTemp;\r\n await onCreatedSubmit(values);\r\n actions.setSubmitting(false);\r\n }}\r\n >\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n Hoàn thành đăng kí\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default LoginPage;\r\n","import React, { FC } from \"react\";\r\nimport \"./layout-app.less\";\r\nimport { ReactComponent as WorkOutlined } from \"themes/icons/work-o.svg\";\r\nimport { ReactComponent as BookShelf } from \"themes/icons/bookshelf.svg\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { shallowEqual, useDispatch, useSelector } from \"react-redux\";\r\nimport { RootState } from \"app.store\";\r\nimport _ from \"lodash\";\r\nimport { CurrentUser } from \"states/account/account.models\";\r\nimport { setLogoutUser } from \"states/account/account.action\";\r\nimport { logout } from \"states/account/account.api\";\r\ntype AsideComponentProps = {\r\n currentUser: CurrentUser | any;\r\n};\r\n\r\nconst AsideComponent: FC = (props) => {\r\n const { currentUser } = props;\r\n const dispatch = useDispatch();\r\n const activeMenu = useSelector(\r\n (state: RootState) => state.appSetting.activatedMenu,\r\n shallowEqual\r\n );\r\n const activedMenu = (key: string) => {\r\n return activeMenu === key ? `active` : \"\";\r\n };\r\n\r\n return !_.isEmpty(currentUser) ? (\r\n \r\n ) : null;\r\n};\r\n\r\nexport default AsideComponent;\r\n","import React, { FC } from \"react\";\r\nimport \"./layout-app.less\";\r\nimport \"./main.css\";\r\nimport { shallowEqual, useSelector } from \"react-redux\";\r\nimport { RootState } from \"app.store\";\r\nimport AsideComponent from \"./aside\";\r\ntype LayoutAppProps = any;\r\n\r\nconst LayoutApp: FC = (props) => {\r\n const isLogin = useSelector(\r\n (state: RootState) => state.account.isAuthentication,\r\n shallowEqual\r\n );\r\n const currentUser = useSelector(\r\n (state: RootState) => state.account.currentUser,\r\n shallowEqual\r\n );\r\n return isLogin ? (\r\n
\r\n
\r\n \r\n
\r\n {props.children}\r\n
\r\n
\r\n
\r\n ) : null;\r\n};\r\n\r\nexport default LayoutApp;\r\n","import { RootState } from \"app.store\";\r\nimport { useEffect } from \"react\";\r\nimport { shallowEqual, useDispatch, useSelector } from \"react-redux\";\r\nimport { useHistory, useLocation } from \"react-router-dom\";\r\nimport { getRefreshToken } from \"shared/plugins/http-service\";\r\nimport { setLoginUser, setLogoutUser } from \"states/account/account.action\";\r\nimport { getProfile, logout } from \"states/account/account.api\";\r\n\r\nconst unAuthPath = [\"/account/login\", \"/forgot-password\"];\r\n\r\nconst AuthManagement = () => {\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n const history = useHistory();\r\n const isLogin = useSelector(\r\n (state: RootState) => state.account.isAuthentication,\r\n shallowEqual\r\n );\r\n\r\n useEffect(() => {\r\n const isUnAuthPath =\r\n unAuthPath.filter((m) => location.pathname.startsWith(m)).length > 0;\r\n if (!isLogin) {\r\n if (getRefreshToken()) {\r\n getProfile()\r\n .then((userProfile) => {\r\n dispatch(setLoginUser(userProfile));\r\n })\r\n .catch(() => {\r\n logout();\r\n dispatch(setLogoutUser());\r\n });\r\n } else if (!isUnAuthPath) {\r\n logout();\r\n history.push(`/account/login?callback=${location.pathname}`);\r\n }\r\n }\r\n }, [isLogin]);\r\n\r\n return null;\r\n};\r\n\r\nexport default AuthManagement;\r\n","import { createBrowserHistory } from \"history\";\r\nexport default createBrowserHistory();\r\n","import { RootState } from \"app.store\";\r\nimport * as React from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport \"./loading.less\";\r\nimport clsx from 'clsx';\r\nexport function Loading(props: any) {\r\n const isLoading = useSelector(\r\n (state: RootState) => state.globalValue.isLoading\r\n );\r\n return (\r\n
\r\n
{props.children}
\r\n
\r\n );\r\n}\r\n","export const IsDuplicateObject = (arr: [], name: string) => {\r\n let valueArr = arr.map(function (item: any) {\r\n return item[name];\r\n });\r\n let isDuplicate = valueArr.some(function (item: any, index: number) {\r\n return valueArr.indexOf(item) != index;\r\n });\r\n return isDuplicate;\r\n};\r\nexport const makeId = (length: number) => {\r\n let result = \"\";\r\n let characters =\r\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n let charactersLength = characters.length;\r\n for (var i = 0; i < length; i++) {\r\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\r\n }\r\n return result;\r\n};\r\nexport const limitStringLength = (\r\n str: string,\r\n length: number,\r\n lengthLimit: number\r\n) => {\r\n if (lengthLimit <= 0) lengthLimit = 100;\r\n if (str.length > lengthLimit) {\r\n str = str.substring(0, length) + \"...\";\r\n }\r\n return str;\r\n};\r\nexport const priceWithCommas = (price: string) => {\r\n return \"$\" + price.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n};\r\n/** Chuyển thành dạng URL string*/\r\nexport const cleanUnicode = (str: string) => {\r\n var str = str.toLowerCase();\r\n str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, \"a\");\r\n str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, \"e\");\r\n str = str.replace(/ì|í|ị|ỉ|ĩ/g, \"i\");\r\n str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, \"o\");\r\n str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, \"u\");\r\n str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, \"y\");\r\n str = str.replace(/đ/g, \"d\");\r\n str = str.replace(\r\n /!|@@|\\$|%|\\^|\\*|\\(|\\)|\\+|\\=|\\<|\\>|\\?|\\/|,|\\.|\\:|\\'| |\\\"|\\&|\\#|\\[|\\]|\\;|\\||\\{|\\}|\\~|\\“|\\”|\\™|\\–|\\-/g,\r\n \"-\"\r\n );\r\n str = str.replace(/^\\-+|\\-+$/g, \"\");\r\n str = str.replace(/\\\\/g, \"\");\r\n str = str.replace(/-+-/g, \"-\");\r\n return str;\r\n};\r\n\r\n/**Kiểm tra 1 chuỗi có phải email hay không */\r\nexport const isEmail = (email: string) => {\r\n var str = email.toLowerCase();\r\n var pattern = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return pattern.test(str);\r\n};\r\n\r\n/**Tạo random string bất kì */\r\nexport const randomString = () => {\r\n return (\r\n Math.random().toString(36).substring(2, 15) +\r\n Math.random().toString(36).substring(2, 15)\r\n );\r\n};\r\nexport const formatPhone = (phone: string) =>{\r\n if(phone === \"\" || phone === null) return \"\";\r\n return `${phone.slice(0, 3)}-${phone.slice(\r\n 3,\r\n 6\r\n )}-${phone.slice(6)}`\r\n}\r\n/**Format kiểu tiền tệ\r\n * @param {Number} c - Con số làm tròn mặc là 0\r\n * @param {String} d - Ký tự phân cách thập phân\r\n * @param {String} t - Ký tự phân cách hàng nghìn\r\n * @param {String} f - Ký tự đơn vị tiền tệ\r\n */\r\nexport const formatMoney = (\r\n n: any,\r\n c: number = 0,\r\n d: string = \",\",\r\n t: string = \".\",\r\n f: string = \"₫\"\r\n) => {\r\n let j = 0;\r\n c = Math.abs(c);\r\n let s = n < 0 ? \"-\" : \"\";\r\n let i: any = parseInt((n = Math.abs(+n || 0).toFixed(c))) + \"\";\r\n j = (j = i.length) > 3 ? j % 3 : 0;\r\n return (\r\n s +\r\n (f !== \"₫\" ? f : \"\") +\r\n (j ? i.substr(0, j) + t : \"\") +\r\n i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + t) +\r\n (c\r\n ? d +\r\n Math.abs(n - i)\r\n .toFixed(c)\r\n .slice(2)\r\n : \"\") +\r\n (f === \"₫\" ? \"\" + f : \"\")\r\n );\r\n};\r\n\r\nexport function vnMoneyToNumber(money: any) {\r\n return money.replace(/\\D/g, \"\");\r\n}\r\n\r\nexport function redirectFileUrl(fileId: string) {\r\n return `${process.env.REACT_APP_API_URI}/api/v1/files/directs/${fileId}`;\r\n}\r\n\r\nexport function redirectFileLocalUrl(filePath: string) {\r\n return `${process.env.REACT_APP_API_URI}/${filePath}`;\r\n}\r\n","import {\r\n SET_DEFAULT_SETTING,\r\n AppSettingActionType,\r\n SET_ACTIVE_SIDEBAR,\r\n} from \"./app-setting.models\";\r\n\r\nexport function setDefaultAppSetting(): AppSettingActionType {\r\n return {\r\n type: SET_DEFAULT_SETTING,\r\n };\r\n}\r\n\r\nexport function setActiveSidebar(activeValue: string): AppSettingActionType {\r\n return {\r\n type: SET_ACTIVE_SIDEBAR,\r\n activeValue,\r\n };\r\n}\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { RootState } from \"../../app.store\";\r\nimport { CSSTransition } from \"react-transition-group\";\r\nimport \"./profile.less\";\r\n\r\nimport { setLoginUser, setLogoutUser } from \"states/account/account.action\";\r\nimport { formatPhone } from \"../../shared/plugins/string-helper\";\r\nimport { CurrentUser, UpdateCurrentUser } from \"states/account/account.models\";\r\nimport { setActiveSidebar } from \"states/app-setting/app-setting.action\";\r\nimport { globalValueSetLoading, globalValueSetToast } from \"states/global-value/global-value.action\";\r\nimport { ToastModel, ToastType } from \"states/global-value/global-value.models\";\r\nimport { UpdateDataSuccessfully } from \"shared/constants/message\";\r\nimport { updateProfile } from \"states/account/account.api\";\r\nconst Profile = () => {\r\n const dispatch = useDispatch();\r\n const currentUser = useSelector(\r\n (state: RootState) => state.account.currentUser\r\n );\r\n const [userModel, setUserModel] = useState({} as CurrentUser);\r\n \r\n const _handleUpdateProfile = async () => {\r\n dispatch(globalValueSetLoading(true));\r\n try {\r\n let payload = {\r\n name: userModel?.name,\r\n email: userModel?.email,\r\n } as UpdateCurrentUser;\r\n await updateProfile(payload);\r\n dispatch(\r\n setLoginUser({\r\n ...currentUser,\r\n name: userModel?.name,\r\n email: userModel?.email,\r\n } as CurrentUser)\r\n );\r\n dispatch(\r\n globalValueSetToast({\r\n message: UpdateDataSuccessfully,\r\n type: ToastType.success,\r\n } as ToastModel)\r\n );\r\n dispatch(globalValueSetLoading(false));\r\n } catch (error) {\r\n dispatch(globalValueSetLoading(false));\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n useEffect(() => {\r\n dispatch(setActiveSidebar(\"profile\"));\r\n document.title = \"Thông tin tài khoản\";\r\n },[])\r\n useEffect(() => {\r\n setUserModel({\r\n ...currentUser,\r\n name: currentUser?.name,\r\n phoneNumber: currentUser?.phoneNumber,\r\n email: currentUser?.email,\r\n } as CurrentUser);\r\n }, [currentUser]);\r\n return (\r\n \r\n
Thông tin tài khoản
\r\n
\r\n
\r\n \r\n {\r\n setUserModel({ ...userModel, name: e.target.value });\r\n }}\r\n />\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n {\r\n setUserModel({ ...userModel, email: e.target.value });\r\n }}\r\n />\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\nexport default Profile;\r\n","import { useEffect, FC } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { ToastContainer, toast } from \"react-toastify\";\r\nimport \"react-toastify/dist/ReactToastify.css\";\r\nimport React from \"react\";\r\nimport { RootState } from \"../../../app.store\";\r\nimport { ToastType } from \"states/global-value/global-value.models\";\r\ninterface ToastProps {}\r\nexport const ToastComponent: FC = (props) => {\r\n const toastState = useSelector((state: RootState) => state.globalValue.toast);\r\n const _onToast = () => {\r\n switch (toastState?.type) {\r\n case ToastType.success:\r\n toast.success(toastState?.message);\r\n break;\r\n case ToastType.error:\r\n toast.error(toastState?.message);\r\n break;\r\n case ToastType.warn:\r\n toast.warn(toastState?.message);\r\n break;\r\n case ToastType.info:\r\n toast.info(toastState?.message);\r\n break;\r\n case ToastType.dark:\r\n toast.dark(toastState?.message);\r\n break;\r\n default: \r\n toast.success(toastState?.message);\r\n break;\r\n }\r\n };\r\n useEffect(() => {\r\n _onToast();\r\n }, [toastState]);\r\n return ;\r\n};\r\n","import { FC } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport Modal from \"react-modal\";\r\nimport React from \"react\";\r\nimport \"./modal.less\";\r\nimport { RootState } from \"../../../app.store\";\r\ninterface ModalProps {}\r\nconst customStyles = {\r\n content: {\r\n top: \"50%\",\r\n left: \"50%\",\r\n right: \"auto\",\r\n bottom: \"auto\",\r\n transform: \"translate(-50%, -50%)\",\r\n },\r\n overlay: {\r\n backgroundColor: \"rgb(21 20 20 / 75%)\",\r\n zIndex: 99,\r\n },\r\n};\r\nModal.setAppElement(\"#root\");\r\nexport const ModalComponent: FC = (props) => {\r\n const confirmModal = useSelector(\r\n (state: RootState) => state.globalValue.confirm\r\n );\r\n return (\r\n \r\n \r\n
\r\n

Xác nhận

\r\n
\r\n

{confirmModal?.message}

\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n","export interface OrderModel {\r\n id: string | number;\r\n orderNumber: string;\r\n totalAmount: number;\r\n shippingFee: number;\r\n orderStatus: OrderStatus;\r\n paymentStatus: PaymentStatus;\r\n couponCode: string;\r\n discountAmount: number;\r\n phoneNumber: string;\r\n email: string;\r\n shipName: string;\r\n shipPhoneNumber: string;\r\n name: string;\r\n address: string;\r\n districtId: number | string;\r\n districtName: string;\r\n provinceId: number | string;\r\n provinceName: string;\r\n wardId?: number | string;\r\n wardName?: string;\r\n subTotalAmount: number;\r\n kiotVietId: number;\r\n customerId: number;\r\n customerName: string;\r\n orderItems: OrderItem[];\r\n creationTime: Date;\r\n lastModificationTime: Date;\r\n}\r\nexport enum OrderStatus{\r\n Processing,\r\n Shipping,\r\n Completed,\r\n Cancel\r\n}\r\nexport enum PaymentStatus{\r\n Unpaid,\r\n Paid,\r\n}\r\nexport interface OrderItem{\r\n skuId: number | string;\r\n orderId: number | string;\r\n price: number;\r\n quantity: number;\r\n skuName: string;\r\n skuImage: string;\r\n}\r\nexport interface SearchOrderRequestModel{\r\n page:number;\r\n pageSize: number;\r\n}\r\nexport interface AddItemsModel{\r\n items:AddItemModel[]\r\n}\r\nexport interface AddItemModel{\r\n skuId: number | string;\r\n quantity: number;\r\n}\r\n","import { deleteHttp, getHttp, postHttp, putHttp } from \"shared/plugins/http-service\";\r\nimport {\r\n CUSTOMER_ADDRESS_API\r\n} from \"shared/constants/api-endpoint\";\r\nimport { CustomerAddressModel } from \"./customer-address.models\";\r\n\r\nexport const createCustomerAddressApi = async (\r\n customerAddressModel: CustomerAddressModel\r\n) => {\r\n const response = await postHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ADDRESS_API}`,\r\n customerAddressModel\r\n );\r\n return response;\r\n};\r\nexport const getAllCustomerAddressApi = async () => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ADDRESS_API}`\r\n );\r\n return response;\r\n};\r\nexport const getCustomerAddressApi = async (id: string | number) => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ADDRESS_API}/${id}`\r\n );\r\n return response;\r\n};\r\nexport const updateCustomerAddressApi = async (customerAddressModel: CustomerAddressModel) => {\r\n const response = await putHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ADDRESS_API}`,\r\n customerAddressModel\r\n );\r\n return response;\r\n};\r\nexport const removeCustomerAddressApi = async (id: string | number) => {\r\n const response = await deleteHttp(\r\n `${process.env.REACT_APP_API_URI}${CUSTOMER_ADDRESS_API}/${id}`);\r\n return response;\r\n};\r\n\r\n","import React, { useCallback, useEffect, useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { setActiveSidebar } from \"states/app-setting/app-setting.action\";\r\nimport { getAllCustomerAddressApi, removeCustomerAddressApi } from \"states/customer-address/customer-address.api\";\r\nimport { CustomerAddressModel } from \"states/customer-address/customer-address.models\";\r\nimport { globalValueSetToast, globalValueShowConfirmModal } from \"states/global-value/global-value.action\";\r\nimport { ConfirmModel, ToastModel, ToastType } from \"states/global-value/global-value.models\";\r\nimport \"./address.less\";\r\n\r\ninterface AddressProps {}\r\nconst Address = (props: AddressProps) => {\r\n const dispatch = useDispatch();\r\n const [customerAddressList,setCustomerAddressList] = useState([]);\r\n document.title = \"Danh sách địa chỉ\";\r\n \r\n const _handleGetCustomerAddress = async () =>{\r\n try{\r\n let result = await getAllCustomerAddressApi();\r\n setCustomerAddressList(result.data);\r\n }\r\n catch(error){\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n }\r\n const _handleRemove = async (id: number | string) =>{\r\n try{\r\n dispatch(\r\n globalValueShowConfirmModal({\r\n isModal: true,\r\n message: \"Bạn có muốn xóa dữ liệu không?\",\r\n onYes: async (ev: any) => {\r\n ev.preventDefault();\r\n await removeCustomerAddressApi(id);\r\n dispatch(globalValueShowConfirmModal({isModal: false}));\r\n await _handleGetCustomerAddress();\r\n },\r\n onClose: async (ev: any) => {\r\n ev.preventDefault();\r\n dispatch(globalValueShowConfirmModal({isModal: false}));\r\n },\r\n } as ConfirmModel)\r\n );\r\n }\r\n catch(error){\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n }\r\n useEffect(() => {\r\n _handleGetCustomerAddress();\r\n dispatch(setActiveSidebar(\"address\"));\r\n }, []);\r\n return (\r\n \r\n
Danh sách địa chỉ
\r\n \r\n Thêm địa chỉ mới\r\n \r\n
\r\n {customerAddressList && customerAddressList.map((address) => (\r\n
\r\n
\r\n
\r\n Họ và tên: {\" \"}\r\n {address?.name}\r\n
\r\n
\r\n Số điện thoại: {\" \"}\r\n {address?.phoneNumber}\r\n
\r\n
\r\n Địa chỉ: {\" \"}\r\n {`${address?.address}, ${address?.wardName}, ${address?.districtName}, ${address?.provinceName}`}\r\n
\r\n
\r\n
\r\n Chỉnh sửa\r\n \r\n
\r\n
\r\n )) }\r\n
\r\n
\r\n );\r\n};\r\nexport default Address;\r\n","import { getHttp } from \"shared/plugins/http-service\";\r\nimport {\r\n DISTRICT_API, PROVINCE_API, WARD_API\r\n} from \"shared/constants/api-endpoint\";\r\nimport { DistrictModel, ProvinceModel, WardModel } from \"./address.models\";\r\n\r\nexport const getProvinceListApi = async () => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${PROVINCE_API}`\r\n );\r\n return response;\r\n};\r\n\r\nexport const getDistrictListApi = async (provinceId: number | string) => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${DISTRICT_API}?provinceId=${provinceId}`\r\n );\r\n return response;\r\n};\r\nexport const getWardListApi = async (districtId : number | string) => {\r\n const response = await getHttp(\r\n `${process.env.REACT_APP_API_URI}${WARD_API}?districtId=${districtId}`\r\n );\r\n return response;\r\n};\r\n\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport \"./address-add-update.less\";\r\nimport {\r\n getDistrictListApi,\r\n getProvinceListApi,\r\n getWardListApi,\r\n} from \"states/address/address.api\";\r\nimport {\r\n DistrictModel,\r\n ProvinceModel,\r\n WardModel,\r\n} from \"states/address/address.models\";\r\nimport { setActiveSidebar } from \"states/app-setting/app-setting.action\";\r\nimport {\r\n createCustomerAddressApi,\r\n getCustomerAddressApi,\r\n updateCustomerAddressApi,\r\n} from \"states/customer-address/customer-address.api\";\r\nimport { CustomerAddressModel } from \"states/customer-address/customer-address.models\";\r\nimport {\r\n globalValueSetLoading,\r\n globalValueSetToast,\r\n} from \"states/global-value/global-value.action\";\r\nimport {\r\n ToastModel,\r\n ToastType,\r\n} from \"states/global-value/global-value.models\";\r\nimport \"./address.less\";\r\nimport { DefaultErrorMessage, UpdateDataSuccessfully } from \"shared/constants/message\";\r\n\r\ninterface AddressAddUpdateProps {}\r\ninterface ParamsRoute {\r\n id: string;\r\n}\r\n\r\nconst AddressAddUpdate = (props: AddressAddUpdateProps) => {\r\n const dispatch = useDispatch();\r\n const [customerAddress, setCustomerAddress] = useState(\r\n {} as CustomerAddressModel\r\n );\r\n const [provinces, setProvinces] = useState([]);\r\n const [districts, setDistricts] = useState([]);\r\n const [wards, setWards] = useState([]);\r\n document.title = \"Danh sách địa chỉ\";\r\n const params = useParams();\r\n const [isUpdate, setIsUpdate] = useState(true);\r\n const _handleGetAddress = async () => {\r\n try {\r\n let result = await getCustomerAddressApi(params?.id);\r\n setCustomerAddress(result.data);\r\n _handleGetDistricts(result.data.provinceId);\r\n _handleGetWards(result.data.districtId);\r\n } catch (error) {\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response.data,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const _handleGetProvince = async () => {\r\n try {\r\n let result = await getProvinceListApi();\r\n setProvinces(result.data);\r\n } catch (error) {\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response.data,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const _handleGetDistricts = async (id: string | number) => {\r\n try {\r\n let result = await getDistrictListApi(id);\r\n setDistricts(result.data);\r\n } catch (error) {\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response.data,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const _handleGetWards = async (id: string | number) => {\r\n try {\r\n let result = await getWardListApi(id);\r\n setWards(result.data);\r\n } catch (error) {\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response.data,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n const _handleSubmit = async () => {\r\n dispatch(globalValueSetLoading(true));\r\n try {\r\n if(isUpdate){\r\n await updateCustomerAddressApi(customerAddress)\r\n }else{\r\n await createCustomerAddressApi(customerAddress);\r\n window.location.reload();\r\n }\r\n dispatch(globalValueSetLoading(false));\r\n dispatch(\r\n globalValueSetToast({\r\n message: UpdateDataSuccessfully,\r\n type: ToastType.success,\r\n } as ToastModel)\r\n );\r\n } catch (error) {\r\n dispatch(globalValueSetLoading(false));\r\n dispatch(\r\n globalValueSetToast({\r\n message: error?.response?.data?.error?.message ?? DefaultErrorMessage,\r\n type: ToastType.error,\r\n } as ToastModel)\r\n );\r\n }\r\n };\r\n useEffect(() => {\r\n if (document.location.href.indexOf(\"account/addresses/add\") > 0) {\r\n setIsUpdate(false);\r\n } else {\r\n _handleGetAddress();\r\n }\r\n dispatch(setActiveSidebar(\"address\"));\r\n _handleGetProvince();\r\n }, []);\r\n return (\r\n \r\n
{isUpdate ? `Cập nhật` : `Thêm`} địa chỉ
\r\n
\r\n
\r\n \r\n {\r\n setCustomerAddress({\r\n ...customerAddress,\r\n name: ev.target.value,\r\n });\r\n }}\r\n className=\"form-control\"\r\n placeholder=\"Họ và tên\"\r\n />\r\n
\r\n
\r\n \r\n {\r\n setCustomerAddress({\r\n ...customerAddress,\r\n phoneNumber: ev.target.value,\r\n });\r\n }}\r\n className=\"form-control\"\r\n placeholder=\"Số điện thoại\"\r\n />\r\n
\r\n
\r\n \r\n {\r\n if (ev.target.value === null || ev.target.value === \"\") {\r\n setDistricts([]);\r\n setWards([]);\r\n return false;\r\n }\r\n setCustomerAddress({\r\n ...customerAddress,\r\n provinceId: Number(ev.target.value),\r\n districtId: 0,\r\n wardId: 0\r\n });\r\n _handleGetDistricts(ev.target.value);\r\n }}\r\n >\r\n \r\n {provinces &&\r\n provinces.map((province) => (\r\n \r\n ))}\r\n \r\n
\r\n
\r\n \r\n {\r\n if (ev.target.value === null || ev.target.value === \"\") {\r\n setWards([]);\r\n return false;\r\n }\r\n setCustomerAddress({\r\n ...customerAddress,\r\n districtId: Number(ev.target.value),\r\n });\r\n _handleGetWards(ev.target.value);\r\n }}\r\n className=\"form-control\"\r\n >\r\n \r\n {districts &&\r\n districts.map((district) => (\r\n \r\n ))}\r\n \r\n
\r\n
\r\n \r\n {\r\n if (ev.target.value === null || ev.target.value === \"\") {\r\n return false;\r\n }\r\n setCustomerAddress({\r\n ...customerAddress,\r\n wardId: Number(ev.target.value),\r\n });\r\n }}\r\n className=\"form-control\"\r\n >\r\n \r\n {wards &&\r\n wards.map((ward) => (\r\n \r\n ))}\r\n \r\n
\r\n
\r\n \r\n {\r\n setCustomerAddress({\r\n ...customerAddress,\r\n address: ev.target.value,\r\n });\r\n }}\r\n className=\"form-control\"\r\n placeholder=\"Địa chỉ\"\r\n />\r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\nexport default AddressAddUpdate;\r\n","import React from \"react\";\r\nimport { OrderStatus } from \"states/order/order.models\";\r\n\r\ninterface IOrderStatusProps {\r\n orderStatus: OrderStatus;\r\n}\r\nexport const OrderStatusComponent = (props: IOrderStatusProps) => {\r\n const {orderStatus} = props;\r\n const renderStatus = ()=>{\r\n switch (orderStatus){\r\n case OrderStatus.Cancel:\r\n return Hủy đơn hàng;\r\n case OrderStatus.Processing:\r\n return Đợi duyệt;\r\n case OrderStatus.Shipping:\r\n return Đang giao hàng; \r\n case OrderStatus.Completed:\r\n return Hoàn thành; \r\n default:\r\n return \r\n }\r\n }\r\n return (renderStatus());\r\n};\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport \"./order.less\";\r\nimport moment from \"moment\";\r\nimport { setActiveSidebar } from \"states/app-setting/app-setting.action\";\r\nimport { globalValueSetLoading } from \"states/global-value/global-value.action\";\r\nimport { OrderModel, SearchOrderRequestModel } from \"states/order/order.models\";\r\nimport { PagedResult } from \"states/paged-result-model\";\r\nimport { getOrderListApi } from \"states/order/order.api\";\r\nimport { useDebouncedCallback } from \"use-debounce/lib\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { formatMoney } from \"shared/plugins/string-helper\";\r\nimport { OrderStatusComponent } from \"./order-status\";\r\nconst Order = () => {\r\n const dispatch = useDispatch();\r\n const [pagedResults, setPagedResults] = useState(\r\n {} as PagedResult\r\n );\r\n const [filterModel, setFilterModel] = useState({\r\n page: 1,\r\n pageSize: 20,\r\n });\r\n useEffect(() => {\r\n dispatch(setActiveSidebar(\"order\"));\r\n }, []);\r\n useEffect(() => {\r\n handleSearch.callback();\r\n }, [filterModel]);\r\n const gotoPage = async (page: number) => {\r\n dispatch(globalValueSetLoading(true));\r\n const result = await getOrderListApi({ ...filterModel, page });\r\n setPagedResults(result.data);\r\n dispatch(globalValueSetLoading(false));\r\n };\r\n const handleSearch = useDebouncedCallback(() => {\r\n gotoPage(1);\r\n }, 500);\r\n return (\r\n \r\n
Danh sách đơn hàng
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {pagedResults?.results?.map((model) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n
Mã đơn hàngNgày tạoTổng đơn hàngTrạng thái đơn hàng
\r\n {`#${model.orderNumber}`}\r\n \r\n {moment(model?.creationTime).format(\"YYYY/MM/DD hh:mm:ss A\")}\r\n {formatMoney(model?.totalAmount)}\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\nexport default Order;\r\n","import React from \"react\";\r\nimport { PaymentStatus } from \"states/order/order.models\";\r\n\r\ninterface IPaymentStatusProps {\r\n paymentStatus: PaymentStatus;\r\n}\r\nexport const PaymentStatusComponent = (props: IPaymentStatusProps) => {\r\n const { paymentStatus } = props;\r\n const renderStatus = ()=>{\r\n switch (paymentStatus){\r\n case PaymentStatus.Unpaid:\r\n return Chưa thanh toán;\r\n case PaymentStatus.Paid:\r\n return Đã thanh toán;\r\n default:\r\n return \r\n }\r\n }\r\n return (renderStatus());\r\n};\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport \"./order.less\";\r\nimport { setActiveSidebar } from \"states/app-setting/app-setting.action\";\r\nimport { globalValueSetLoading } from \"states/global-value/global-value.action\";\r\nimport { OrderModel } from \"states/order/order.models\";\r\nimport { getOrderApi } from \"states/order/order.api\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport { formatMoney, vnMoneyToNumber } from \"shared/plugins/string-helper\";\r\nimport { OrderStatusComponent } from \"./order-status\";\r\nimport { PaymentStatusComponent } from \"./payment-status\";\r\ninterface RouteProps {\r\n orderId: string;\r\n}\r\nconst OrderDetail = () => {\r\n const dispatch = useDispatch();\r\n const params = useParams();\r\n const [model, setModel] = useState({} as OrderModel);\r\n const getOrder = async () => {\r\n dispatch(globalValueSetLoading(true));\r\n const result = await getOrderApi(params.orderId);\r\n setModel(result.data);\r\n dispatch(globalValueSetLoading(false));\r\n };\r\n useEffect(() => {\r\n dispatch(setActiveSidebar(\"order\"));\r\n getOrder();\r\n }, []);\r\n return (\r\n model ? (\r\n \r\n
\r\n Thông tin đơn hàng - {`#${model.orderNumber}`}{\" \"}\r\n \r\n
\r\n
\r\n
\r\n
\r\n
Thông tin giao hàng
\r\n
\r\n
{model.shipName}
\r\n
\r\n {`${model.address}${`, ${model.wardName}`}, ${\r\n model.districtName\r\n }, ${model?.provinceName}`}\r\n
\r\n
Số điện thoại : {model.shipPhoneNumber}
\r\n
Họ và tên người mua : {model.name}
\r\n
Số điện thoại người mua : {model.phoneNumber}
\r\n
Địa chỉ email: {model.email}
\r\n
\r\n
\r\n
\r\n
Trạng thái đơn hàng
\r\n
\r\n

\r\n Trạng thái thanh toán: {\" \"}\r\n \r\n

\r\n

\r\n Trạng thái đơn hàng: {\" \"}\r\n \r\n

\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {model?.orderItems?.map((model) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Sản phẩmĐơn giáSố lượngTạm tính
\r\n
\r\n
\r\n \"\"\r\n
\r\n
\r\n {model.skuName}\r\n
\r\n
\r\n
\r\n \r\n {formatMoney(model.price / model.quantity)}\r\n \r\n {model.quantity}\r\n \r\n {formatMoney(model.price)}\r\n \r\n
Tạm tính{formatMoney(model.subTotalAmount)}
Phí ship{formatMoney(model.shippingFee)}
Giảm giá{formatMoney(model.discountAmount)}
Thành tiền\r\n \r\n {formatMoney(model.totalAmount)}\r\n \r\n
\r\n
\r\n
\r\n {model?.orderItems?.map((model) => (\r\n
\r\n
\r\n
\r\n \"\"\r\n
\r\n
\r\n \r\n {model.skuName} x {model.quantity}\r\n \r\n
\r\n
\r\n {formatMoney(model.price * model.quantity)}\r\n
\r\n
\r\n
\r\n
\r\n ))}\r\n
\r\n
\r\n
Tạm tính
\r\n
\r\n {formatMoney(model.subTotalAmount)}\r\n
\r\n
\r\n
\r\n
Phí ship
\r\n
\r\n {formatMoney(model.shippingFee)}\r\n
\r\n
\r\n
\r\n
Giảm giá
\r\n
\r\n {formatMoney(model.discountAmount)}\r\n
\r\n
\r\n
\r\n
Thành tiền
\r\n
\r\n \r\n {formatMoney(model.totalAmount)}\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n ): null\r\n );\r\n};\r\nexport default OrderDetail;\r\n","import React from \"react\";\r\nimport { createStore } from \"redux\";\r\nimport { rootReducer } from \"./app.store\";\r\nimport { Provider } from \"react-redux\";\r\nimport { Route, Redirect, Router } from \"react-router-dom\";\r\nimport { composeWithDevTools } from \"redux-devtools-extension\";\r\nimport EmptyPage from \"./modules/core/empty\";\r\nimport LoginPage from \"./modules/account/login-page\";\r\n\r\nimport LayoutApp from \"./shared/layout/layout-app\";\r\nimport AuthManagement from \"shared/components/auth/auth-management\";\r\nimport history from \"shared/plugins/history\";\r\n\r\nimport { Loading } from \"shared/components/loading/loading\";\r\nimport Profile from \"modules/profile/profile\";\r\nimport { ToastComponent } from \"shared/components/toast/toast\";\r\nimport { ModalComponent } from \"shared/components/modal/modal-confirm\";\r\nimport Address from \"modules/address/address\";\r\nimport AddressAddUpdate from \"modules/address/address-add-update\";\r\nimport Order from \"modules/order/order\";\r\nimport OrderDetail from \"modules/order/order-detail\";\r\n\r\nconst store = createStore(rootReducer, composeWithDevTools());\r\n\r\nfunction App() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default App;\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(\r\n process.env.PUBLIC_URL,\r\n window.location.href\r\n );\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' }\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import firebase from \"firebase\";\r\nexport const initializeFirebase = () => {\r\n firebase.initializeApp({\r\n apiKey: \"AIzaSyCusR7JshQoQAt8YQbI2y8YK_xXGOIc0NI\",\r\n authDomain: \"dnaproject-4ba7e.firebaseapp.com\",\r\n projectId: \"dnaproject-4ba7e\",\r\n storageBucket: \"dnaproject-4ba7e.appspot.com\",\r\n messagingSenderId: \"875159793242\",\r\n appId: \"1:875159793242:web:878bb63656f057af1c7263\",\r\n measurementId: \"G-VZ0XFKQK7J\"\r\n });\r\n}","import { initializeFirebase } from \"init-firebase\";\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./app\";\r\nimport * as serviceWorker from \"./serviceWorker\";\r\ninitializeFirebase();\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}