From d4d7d60285e94ba3dab0b61c1f2c28dbfbd10f76 Mon Sep 17 00:00:00 2001 From: QuocAnh189 Date: Mon, 23 Dec 2024 17:46:14 +0700 Subject: [PATCH] update translation --- src/App.tsx | 24 +- src/components/CalendarSelector.tsx | 5 +- src/components/ColumnExpense.tsx | 21 +- src/components/CouponCard.tsx | 20 +- src/components/FormToChat.tsx | 28 +- src/components/NotData.tsx | 22 - src/components/OrderCollapseItem.tsx | 118 +- src/components/ReportItem.tsx | 2 +- src/components/Review.tsx | 16 +- src/components/TicketGridItem.tsx | 59 + src/components/TotalBalance.tsx | 2 +- src/components/TransactionCollapseItem.tsx | 87 + src/components/events/CardMyEvent.tsx | 2 +- src/components/events/EventCard.tsx | 16 + src/components/events/EventExpenseItem.tsx | 16 +- src/components/events/EventFavouriteItem.tsx | 6 +- src/components/events/EventInformation.tsx | 21 +- .../events/create/TicketEventCreate.tsx | 8 +- src/components/message/ConversationHeader.tsx | 20 +- src/components/message/ConversationItem.tsx | 2 +- src/components/message/MessageInput.tsx | 13 +- src/components/message/MessageItem.tsx | 2 +- src/components/message/NewMessageInput.tsx | 19 +- src/components/payment/ModalCheckout.tsx | 91 + src/constants/columnDefs.tsx | 222 +- src/constants/enum.constant.ts | 13 +- src/constants/options.constant.ts | 4 +- src/constants/routes.constant.tsx | 14 +- src/contexts/socket.context.tsx | 11 +- src/db/orders.ts | 276 +- src/db/transactions.ts | 216 +- src/dtos/event.dto.ts | 2 +- src/i18n/i18n.ts | 9 +- src/i18n/locales/china.ts | 24 +- src/i18n/locales/english.ts | 20 +- src/i18n/locales/france.ts | 102 +- src/i18n/locales/germany.ts | 24 +- src/i18n/locales/italia.ts | 24 +- src/i18n/locales/japan.ts | 24 +- src/i18n/locales/korea.ts | 24 +- src/i18n/locales/russia.ts | 24 +- src/i18n/locales/spain.ts | 24 +- src/i18n/locales/vietnam.ts | 20 +- src/interfaces/contents/category.interface.ts | 2 +- .../contents/conversation.interface.ts | 41 - src/interfaces/contents/creator.interface.ts | 12 - src/interfaces/contents/email.interface.ts | 25 +- src/interfaces/contents/event.interface.ts | 1 + src/interfaces/contents/index.ts | 5 +- src/interfaces/contents/location.interface.ts | 6 - src/interfaces/contents/payment.interface.ts | 33 + src/interfaces/contents/ticket.interface.ts | 21 + src/interfaces/systems/function.interface.ts | 11 - src/interfaces/systems/index.ts | 4 +- .../systems/permission.interface.ts | 18 - src/interfaces/systems/user.interface.ts | 6 +- .../websockets/conversation.interface.ts | 47 +- src/interfaces/websockets/index.interface.ts | 1 - .../websockets/message.interface.ts | 45 - src/layouts/chat.tsx | 17 +- src/layouts/components/ModalMessage.tsx | 19 +- src/layouts/components/appbar/AppBar.tsx | 9 +- .../components/navbar/InvitationItem.tsx | 6 +- .../components/navbar/InvitationPanel.tsx | 2 +- .../components/navbar/NotificationItem.tsx | 6 +- .../components/navbar/NotificationsPanel.tsx | 2 +- src/pages/common/Modify-Create-Event.tsx | 4 +- src/pages/common/UserInfo.tsx | 6 +- src/pages/coupon/Coupon.tsx | 9 +- src/pages/coupon/CouponEvent.tsx | 12 - src/pages/coupon/components/ModalCreate.tsx | 31 +- src/pages/coupon/components/ModalUpdate.tsx | 34 +- src/pages/dashboard/Event-Analysis-Detail.tsx | 16 +- src/pages/dashboard/Overview-Detail.tsx | 6 +- src/pages/dashboard/Payment.tsx | 15 - .../index.tsx => dashboard/Transaction.tsx} | 11 +- src/pages/events/Event-Detail.tsx | 17 +- src/pages/events/My-Expense-Detail.tsx | 21 +- src/pages/events/My-Expense.tsx | 12 +- src/pages/events/Trash-Event.tsx | 4 +- src/pages/events/components/EventRelate.tsx | 9 +- .../events/components/ItemTicketPayment.tsx | 14 +- .../events/components/ModalApplyCoupon.tsx | 16 +- .../events/components/ModalChooseDiscount.tsx | 17 +- src/pages/events/components/Payment.tsx | 25 +- src/pages/explore/Explore.tsx | 4 +- src/pages/home/Home.tsx | 9 + src/pages/home/components/AboutUs.tsx | 6 +- src/pages/home/components/BestEvents.tsx | 14 +- src/pages/home/components/SearchHome.tsx | 18 +- src/pages/home/components/UpComingEvents.tsx | 2 +- src/pages/landing/components/AutomaticRun.tsx | 30 +- src/pages/landing/components/Contact.tsx | 21 +- src/pages/landing/components/Feedback.tsx | 12 +- src/pages/landing/components/Intro.tsx | 19 +- src/pages/landing/components/Manage.tsx | 9 +- src/pages/landing/components/Navbar.tsx | 27 +- src/pages/order/Order.tsx | 47 +- src/pages/order/components/Orders.tsx | 87 +- src/pages/review/Review.tsx | 1 - src/pages/setting/Follower.tsx | 21 +- src/pages/setting/Following.tsx | 24 +- src/pages/setting/components/UserItem.tsx | 8 +- src/pages/ticket/MyTicket.tsx | 12 +- src/redux/apis/payment.api.ts | 24 +- src/redux/apis/ticket.api.ts | 23 +- src/redux/slices/conversation.slice.ts | 2 +- src/redux/slices/event.slice.ts | 18 +- src/translate/china/auth/signin.json | 31 +- src/translate/china/auth/signup.json | 24 +- src/translate/china/calendar.json | 6 +- src/translate/china/common.json | 134 +- src/translate/china/coupon.json | 23 + src/translate/china/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../china/dashboard/event-analysis.json | 11 +- .../china/dashboard/overview-detail.json | 31 +- src/translate/china/dashboard/overview.json | 33 +- .../china/dashboard/transaction.json | 8 + src/translate/china/events/create-event.json | 76 +- src/translate/china/events/event-detail.json | 56 +- src/translate/china/events/my-event.json | 21 +- .../china/events/my-expense-detail.json | 9 + src/translate/china/events/my-expense.json | 8 + src/translate/china/events/my-favourite.json | 37 +- src/translate/china/events/trash-event.json | 9 +- src/translate/china/explore.json | 46 +- src/translate/china/home.json | 50 +- src/translate/china/landing.json | 39 +- src/translate/china/order.json | 38 +- src/translate/china/review.json | 22 +- src/translate/china/setting/follower.json | 10 + src/translate/china/setting/following.json | 11 + src/translate/china/setting/profile.json | 36 + src/translate/china/ticket.json | 14 + .../{dashboard/payment.json => userinfo.json} | 0 src/translate/english/common.json | 115 +- src/translate/english/coupon.json | 23 + .../dashboard/event-analysis-detail.json | 6 +- .../english/dashboard/event-analysis.json | 2 +- .../english/dashboard/overview-detail.json | 22 +- src/translate/english/dashboard/overview.json | 12 +- src/translate/english/dashboard/payment.json | 26 - .../english/dashboard/transaction.json | 8 + .../english/events/create-event.json | 6 + .../english/events/event-detail.json | 56 +- src/translate/english/events/my-event.json | 18 +- .../english/events/my-expense-detail.json | 9 + src/translate/english/events/my-expense.json | 8 + .../english/events/my-favourite.json | 28 +- src/translate/english/events/trash-event.json | 9 +- src/translate/english/explore.json | 40 +- src/translate/english/home.json | 32 +- src/translate/english/landing.json | 39 +- src/translate/english/order.json | 2 + src/translate/english/review.json | 1 + src/translate/english/setting/follower.json | 10 + src/translate/english/setting/following.json | 11 + .../english/{ => setting}/profile.json | 2 +- src/translate/english/ticket.json | 14 + src/translate/english/userinfo.json | 21 + src/translate/france/calendar.json | 6 +- src/translate/france/common.json | 151 +- src/translate/france/coupon.json | 23 + src/translate/france/dashboard/customer.json | 44 +- .../dashboard/event-analysis-detail.json | 30 +- .../france/dashboard/event-analysis.json | 8 +- .../france/dashboard/overview-detail.json | 46 +- src/translate/france/dashboard/overview.json | 46 +- src/translate/france/dashboard/payment.json | 26 - .../france/dashboard/transaction.json | 8 + src/translate/france/events/create-event.json | 103 +- src/translate/france/events/event-detail.json | 56 +- src/translate/france/events/my-event.json | 32 +- .../france/events/my-expense-detail.json | 9 + src/translate/france/events/my-expense.json | 8 + src/translate/france/events/my-favourite.json | 37 +- src/translate/france/events/trash-event.json | 9 +- src/translate/france/explore.json | 66 +- src/translate/france/home.json | 40 +- src/translate/france/landing.json | 39 +- src/translate/france/order.json | 34 +- src/translate/france/profile.json | 35 - src/translate/france/review.json | 17 +- src/translate/france/setting/follower.json | 10 + src/translate/france/setting/following.json | 11 + src/translate/france/setting/profile.json | 36 + src/translate/france/ticket.json | 14 + .../profile.json => france/userinfo.json} | 0 src/translate/germany/auth/signin.json | 31 +- src/translate/germany/auth/signup.json | 24 +- src/translate/germany/calendar.json | 6 +- src/translate/germany/common.json | 147 +- src/translate/germany/coupon.json | 23 + src/translate/germany/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../germany/dashboard/event-analysis.json | 11 +- .../germany/dashboard/overview-detail.json | 31 +- src/translate/germany/dashboard/overview.json | 33 +- .../germany/dashboard/transaction.json | 8 + .../germany/events/create-event.json | 83 +- .../germany/events/event-detail.json | 56 +- src/translate/germany/events/my-event.json | 21 +- .../germany/events/my-expense-detail.json | 9 + src/translate/germany/events/my-expense.json | 8 + .../germany/events/my-favourite.json | 37 +- src/translate/germany/events/trash-event.json | 9 +- src/translate/germany/explore.json | 46 +- src/translate/germany/home.json | 44 +- src/translate/germany/landing.json | 39 +- src/translate/germany/order.json | 38 +- src/translate/germany/review.json | 22 +- src/translate/germany/setting/follower.json | 10 + src/translate/germany/setting/following.json | 11 + src/translate/germany/setting/profile.json | 36 + src/translate/germany/ticket.json | 14 + .../{dashboard/payment.json => userinfo.json} | 0 src/translate/italia/auth/signin.json | 31 +- src/translate/italia/auth/signup.json | 24 +- src/translate/italia/calendar.json | 6 +- src/translate/italia/common.json | 155 +- src/translate/italia/coupon.json | 23 + src/translate/italia/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../italia/dashboard/event-analysis.json | 11 +- .../italia/dashboard/overview-detail.json | 31 +- src/translate/italia/dashboard/overview.json | 33 +- .../italia/dashboard/transaction.json | 8 + src/translate/italia/events/create-event.json | 76 +- src/translate/italia/events/event-detail.json | 56 +- src/translate/italia/events/my-event.json | 21 +- .../italia/events/my-expense-detail.json | 9 + src/translate/italia/events/my-expense.json | 8 + src/translate/italia/events/my-favourite.json | 37 +- src/translate/italia/events/trash-event.json | 9 +- src/translate/italia/explore.json | 46 +- src/translate/italia/home.json | 40 +- src/translate/italia/landing.json | 39 +- src/translate/italia/order.json | 38 +- src/translate/italia/review.json | 22 +- src/translate/italia/setting/follower.json | 10 + src/translate/italia/setting/following.json | 11 + src/translate/italia/setting/profile.json | 36 + src/translate/italia/ticket.json | 14 + .../my-ticket.json => italia/userinfo.json} | 0 src/translate/japan/auth/signin.json | 31 +- src/translate/japan/auth/signup.json | 24 +- src/translate/japan/calendar.json | 6 +- src/translate/japan/common.json | 138 +- src/translate/japan/coupon.json | 23 + src/translate/japan/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../japan/dashboard/event-analysis.json | 11 +- .../japan/dashboard/overview-detail.json | 31 +- src/translate/japan/dashboard/overview.json | 33 +- .../japan/dashboard/transaction.json | 8 + src/translate/japan/events/create-event.json | 76 +- src/translate/japan/events/event-detail.json | 56 +- src/translate/japan/events/my-event.json | 21 +- .../japan/events/my-expense-detail.json | 9 + src/translate/japan/events/my-expense.json | 8 + src/translate/japan/events/my-favourite.json | 37 +- src/translate/japan/events/trash-event.json | 9 +- src/translate/japan/explore.json | 46 +- src/translate/japan/home.json | 46 +- src/translate/japan/landing.json | 39 +- src/translate/japan/order.json | 38 +- src/translate/japan/profile.json | 1 - src/translate/japan/review.json | 22 +- src/translate/japan/setting/follower.json | 10 + src/translate/japan/setting/following.json | 11 + src/translate/japan/setting/profile.json | 36 + src/translate/japan/ticket.json | 14 + .../profile.json => japan/userinfo.json} | 0 src/translate/korea/auth/signin.json | 31 +- src/translate/korea/auth/signup.json | 24 +- src/translate/korea/calendar.json | 6 +- src/translate/korea/common.json | 143 +- src/translate/korea/coupon.json | 23 + src/translate/korea/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../korea/dashboard/event-analysis.json | 11 +- .../korea/dashboard/overview-detail.json | 31 +- src/translate/korea/dashboard/overview.json | 33 +- src/translate/korea/dashboard/payment.json | 1 - .../korea/dashboard/transaction.json | 8 + src/translate/korea/events/create-event.json | 76 +- src/translate/korea/events/event-detail.json | 56 +- src/translate/korea/events/my-event.json | 21 +- .../korea/events/my-expense-detail.json | 9 + src/translate/korea/events/my-expense.json | 8 + src/translate/korea/events/my-favourite.json | 37 +- src/translate/korea/events/trash-event.json | 9 +- src/translate/korea/explore.json | 46 +- src/translate/korea/home.json | 44 +- src/translate/korea/landing.json | 39 +- src/translate/korea/order.json | 38 +- src/translate/korea/profile.json | 1 - src/translate/korea/review.json | 22 +- src/translate/korea/setting/follower.json | 10 + src/translate/korea/setting/following.json | 11 + src/translate/korea/setting/profile.json | 36 + src/translate/korea/ticket.json | 14 + .../payment.json => korea/userinfo.json} | 0 src/translate/russia/auth/signin.json | 31 +- src/translate/russia/auth/signup.json | 24 +- src/translate/russia/calendar.json | 6 +- src/translate/russia/common.json | 199 +- src/translate/russia/coupon.json | 23 + src/translate/russia/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../russia/dashboard/event-analysis.json | 11 +- .../russia/dashboard/overview-detail.json | 31 +- src/translate/russia/dashboard/overview.json | 33 +- src/translate/russia/dashboard/payment.json | 1 - .../russia/dashboard/transaction.json | 8 + src/translate/russia/events/create-event.json | 80 +- src/translate/russia/events/event-detail.json | 56 +- src/translate/russia/events/my-event.json | 37 +- .../russia/events/my-expense-detail.json | 9 + src/translate/russia/events/my-expense.json | 8 + src/translate/russia/events/my-favourite.json | 37 +- src/translate/russia/events/trash-event.json | 9 +- src/translate/russia/explore.json | 46 +- src/translate/russia/home.json | 44 +- src/translate/russia/landing.json | 39 +- src/translate/russia/order.json | 38 +- src/translate/russia/profile.json | 1 - src/translate/russia/review.json | 22 +- src/translate/russia/setting/follower.json | 10 + src/translate/russia/setting/following.json | 11 + src/translate/russia/setting/profile.json | 36 + src/translate/russia/ticket.json | 14 + .../profile.json => russia/userinfo.json} | 0 src/translate/spain/auth/signin.json | 31 +- src/translate/spain/auth/signup.json | 24 +- src/translate/spain/calendar.json | 6 +- src/translate/spain/common.json | 167 +- src/translate/spain/coupon.json | 23 + src/translate/spain/dashboard/customer.json | 34 +- .../dashboard/event-analysis-detail.json | 25 +- .../spain/dashboard/event-analysis.json | 11 +- .../spain/dashboard/overview-detail.json | 31 +- src/translate/spain/dashboard/overview.json | 33 +- src/translate/spain/dashboard/payment.json | 1 - .../spain/dashboard/transaction.json | 8 + src/translate/spain/events/create-event.json | 70 +- src/translate/spain/events/event-detail.json | 56 +- src/translate/spain/events/my-event.json | 37 +- .../spain/events/my-expense-detail.json | 9 + src/translate/spain/events/my-expense.json | 8 + src/translate/spain/events/my-favourite.json | 37 +- src/translate/spain/events/trash-event.json | 9 +- src/translate/spain/explore.json | 46 +- src/translate/spain/home.json | 38 +- src/translate/spain/landing.json | 39 +- src/translate/spain/order.json | 38 +- src/translate/spain/profile.json | 1 - src/translate/spain/review.json | 22 +- src/translate/spain/setting/follower.json | 10 + src/translate/spain/setting/following.json | 11 + src/translate/spain/setting/profile.json | 36 + src/translate/spain/ticket.json | 14 + .../payment.json => spain/userinfo.json} | 0 src/translate/vietnam/common.json | 132 +- src/translate/vietnam/coupon.json | 23 + src/translate/vietnam/dashboard/customer.json | 7 +- .../dashboard/event-analysis-detail.json | 6 +- .../vietnam/dashboard/event-analysis.json | 2 +- .../vietnam/dashboard/overview-detail.json | 22 +- src/translate/vietnam/dashboard/overview.json | 16 +- src/translate/vietnam/dashboard/payment.json | 24 - .../vietnam/dashboard/transaction.json | 8 + .../vietnam/events/create-event.json | 11 +- .../vietnam/events/event-detail.json | 56 +- src/translate/vietnam/events/my-event.json | 18 +- .../vietnam/events/my-expense-detail.json | 9 + src/translate/vietnam/events/my-expense.json | 8 + .../vietnam/events/my-favourite.json | 26 + src/translate/vietnam/events/trash-event.json | 9 +- src/translate/vietnam/explore.json | 42 +- src/translate/vietnam/home.json | 32 +- src/translate/vietnam/landing.json | 39 +- src/translate/vietnam/order.json | 2 + src/translate/vietnam/review.json | 5 +- src/translate/vietnam/setting/follower.json | 10 + src/translate/vietnam/setting/following.json | 11 + .../vietnam/{ => setting}/profile.json | 5 +- src/translate/vietnam/ticket.json | 14 + src/translate/vietnam/userinfo.json | 21 + src/utils/helpers.ts | 10 +- src/widgets/ConversionRateWithChart.tsx | 8 +- src/widgets/CouponsGrid.tsx | 11 +- src/widgets/EventFavouriteGrid.tsx | 4 +- src/widgets/EventManagementTable/index.tsx | 21 +- src/widgets/EventManagementTrash/index.tsx | 8 +- src/widgets/LatestAcceptedReviews.tsx | 9 +- src/widgets/MainOverviewInfo.tsx | 18 +- src/widgets/OrdersTable/index.tsx | 56 +- src/widgets/OrdersTable/styles.ts | 2 + src/widgets/TicketsGrid.tsx | 73 + src/widgets/TotalReport.tsx | 6 +- src/widgets/TransactionsTable/index.tsx | 113 + src/widgets/TransactionsTable/styles.ts | 51 + src/widgets/UserInformationCard.tsx | 2 +- src/widgets/UserInformationDetails.tsx | 24 +- src/widgets/UserProfileDetails.tsx | 44 +- stats.html | 4842 +++++++++++++++++ 408 files changed, 13156 insertions(+), 2960 deletions(-) delete mode 100644 src/components/NotData.tsx create mode 100644 src/components/TicketGridItem.tsx create mode 100644 src/components/TransactionCollapseItem.tsx create mode 100644 src/components/payment/ModalCheckout.tsx delete mode 100644 src/interfaces/contents/conversation.interface.ts delete mode 100644 src/interfaces/contents/creator.interface.ts delete mode 100644 src/interfaces/contents/location.interface.ts create mode 100644 src/interfaces/contents/ticket.interface.ts delete mode 100644 src/interfaces/systems/function.interface.ts delete mode 100644 src/interfaces/systems/permission.interface.ts delete mode 100644 src/interfaces/websockets/message.interface.ts delete mode 100644 src/pages/coupon/CouponEvent.tsx delete mode 100644 src/pages/dashboard/Payment.tsx rename src/pages/{order/index.tsx => dashboard/Transaction.tsx} (57%) create mode 100644 src/translate/china/coupon.json create mode 100644 src/translate/china/dashboard/transaction.json create mode 100644 src/translate/china/events/my-expense-detail.json create mode 100644 src/translate/china/events/my-expense.json create mode 100644 src/translate/china/setting/follower.json create mode 100644 src/translate/china/setting/following.json create mode 100644 src/translate/china/setting/profile.json create mode 100644 src/translate/china/ticket.json rename src/translate/china/{dashboard/payment.json => userinfo.json} (100%) create mode 100644 src/translate/english/coupon.json delete mode 100644 src/translate/english/dashboard/payment.json create mode 100644 src/translate/english/dashboard/transaction.json create mode 100644 src/translate/english/events/my-expense-detail.json create mode 100644 src/translate/english/events/my-expense.json create mode 100644 src/translate/english/setting/follower.json create mode 100644 src/translate/english/setting/following.json rename src/translate/english/{ => setting}/profile.json (97%) create mode 100644 src/translate/english/ticket.json create mode 100644 src/translate/english/userinfo.json create mode 100644 src/translate/france/coupon.json delete mode 100644 src/translate/france/dashboard/payment.json create mode 100644 src/translate/france/dashboard/transaction.json create mode 100644 src/translate/france/events/my-expense-detail.json create mode 100644 src/translate/france/events/my-expense.json delete mode 100644 src/translate/france/profile.json create mode 100644 src/translate/france/setting/follower.json create mode 100644 src/translate/france/setting/following.json create mode 100644 src/translate/france/setting/profile.json create mode 100644 src/translate/france/ticket.json rename src/translate/{china/profile.json => france/userinfo.json} (100%) create mode 100644 src/translate/germany/coupon.json create mode 100644 src/translate/germany/dashboard/transaction.json create mode 100644 src/translate/germany/events/my-expense-detail.json create mode 100644 src/translate/germany/events/my-expense.json create mode 100644 src/translate/germany/setting/follower.json create mode 100644 src/translate/germany/setting/following.json create mode 100644 src/translate/germany/setting/profile.json create mode 100644 src/translate/germany/ticket.json rename src/translate/germany/{dashboard/payment.json => userinfo.json} (100%) create mode 100644 src/translate/italia/coupon.json create mode 100644 src/translate/italia/dashboard/transaction.json create mode 100644 src/translate/italia/events/my-expense-detail.json create mode 100644 src/translate/italia/events/my-expense.json create mode 100644 src/translate/italia/setting/follower.json create mode 100644 src/translate/italia/setting/following.json create mode 100644 src/translate/italia/setting/profile.json create mode 100644 src/translate/italia/ticket.json rename src/translate/{germany/events/my-ticket.json => italia/userinfo.json} (100%) create mode 100644 src/translate/japan/coupon.json create mode 100644 src/translate/japan/dashboard/transaction.json create mode 100644 src/translate/japan/events/my-expense-detail.json create mode 100644 src/translate/japan/events/my-expense.json delete mode 100644 src/translate/japan/profile.json create mode 100644 src/translate/japan/setting/follower.json create mode 100644 src/translate/japan/setting/following.json create mode 100644 src/translate/japan/setting/profile.json create mode 100644 src/translate/japan/ticket.json rename src/translate/{germany/profile.json => japan/userinfo.json} (100%) create mode 100644 src/translate/korea/coupon.json delete mode 100644 src/translate/korea/dashboard/payment.json create mode 100644 src/translate/korea/dashboard/transaction.json create mode 100644 src/translate/korea/events/my-expense-detail.json create mode 100644 src/translate/korea/events/my-expense.json delete mode 100644 src/translate/korea/profile.json create mode 100644 src/translate/korea/setting/follower.json create mode 100644 src/translate/korea/setting/following.json create mode 100644 src/translate/korea/setting/profile.json create mode 100644 src/translate/korea/ticket.json rename src/translate/{italia/dashboard/payment.json => korea/userinfo.json} (100%) create mode 100644 src/translate/russia/coupon.json delete mode 100644 src/translate/russia/dashboard/payment.json create mode 100644 src/translate/russia/dashboard/transaction.json create mode 100644 src/translate/russia/events/my-expense-detail.json create mode 100644 src/translate/russia/events/my-expense.json delete mode 100644 src/translate/russia/profile.json create mode 100644 src/translate/russia/setting/follower.json create mode 100644 src/translate/russia/setting/following.json create mode 100644 src/translate/russia/setting/profile.json create mode 100644 src/translate/russia/ticket.json rename src/translate/{italia/profile.json => russia/userinfo.json} (100%) create mode 100644 src/translate/spain/coupon.json delete mode 100644 src/translate/spain/dashboard/payment.json create mode 100644 src/translate/spain/dashboard/transaction.json create mode 100644 src/translate/spain/events/my-expense-detail.json create mode 100644 src/translate/spain/events/my-expense.json delete mode 100644 src/translate/spain/profile.json create mode 100644 src/translate/spain/setting/follower.json create mode 100644 src/translate/spain/setting/following.json create mode 100644 src/translate/spain/setting/profile.json create mode 100644 src/translate/spain/ticket.json rename src/translate/{japan/dashboard/payment.json => spain/userinfo.json} (100%) create mode 100644 src/translate/vietnam/coupon.json delete mode 100644 src/translate/vietnam/dashboard/payment.json create mode 100644 src/translate/vietnam/dashboard/transaction.json create mode 100644 src/translate/vietnam/events/my-expense-detail.json create mode 100644 src/translate/vietnam/events/my-expense.json create mode 100644 src/translate/vietnam/setting/follower.json create mode 100644 src/translate/vietnam/setting/following.json rename src/translate/vietnam/{ => setting}/profile.json (90%) create mode 100644 src/translate/vietnam/ticket.json create mode 100644 src/translate/vietnam/userinfo.json create mode 100644 src/widgets/TicketsGrid.tsx create mode 100644 src/widgets/TransactionsTable/index.tsx create mode 100644 src/widgets/TransactionsTable/styles.ts create mode 100644 stats.html diff --git a/src/App.tsx b/src/App.tsx index 9145421..e76ce05 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -37,31 +37,30 @@ const Landing = lazy(() => import('@pages/landing/Landing')) const SignIn = lazy(() => import('@pages/auth/Signin')) const SignUp = lazy(() => import('@pages/auth/Signup')) const Home = lazy(() => import('@pages/home/Home')) +const Explore = lazy(() => import('@pages/explore/Explore')) +const EventDetail = lazy(() => import('@pages/events/Event-Detail')) const Overview = lazy(() => import('@pages/dashboard/Overview')) const OverviewDetail = lazy(() => import('@pages/dashboard/Overview-Detail')) const EventAnalysis = lazy(() => import('@pages/dashboard/Event-Analysis')) const EventAnalysisDetail = lazy(() => import('@pages/dashboard/Event-Analysis-Detail')) const Customer = lazy(() => import('@pages/dashboard/Customer')) -const Payment = lazy(() => import('@pages/dashboard/Payment')) -const EventDetail = lazy(() => import('@pages/events/Event-Detail')) -const Profile = lazy(() => import('@pages/setting/Profile')) -const UserInformation = lazy(() => import('@pages/common/UserInfo')) -const Follower = lazy(() => import('@pages/setting/Follower')) -const Following = lazy(() => import('@pages/setting/Following')) -const Explore = lazy(() => import('@pages/explore/Explore')) -const CreateEvent = lazy(() => import('@pages/events/Create-Event')) -const UpdateEvent = lazy(() => import('@pages/events/Update-Event')) +const Transaction = lazy(() => import('@pages/dashboard/Transaction')) const MyFavourite = lazy(() => import('@pages/events/My-Favourite')) const MyEvent = lazy(() => import('@pages/events/My-Event')) const TrashEvent = lazy(() => import('@pages/events/Trash-Event')) +const CreateEvent = lazy(() => import('@pages/events/Create-Event')) +const UpdateEvent = lazy(() => import('@pages/events/Update-Event')) const MyExpense = lazy(() => import('@pages/events/My-Expense')) const MyExpenseDetail = lazy(() => import('@pages/events/My-Expense-Detail')) const Coupon = lazy(() => import('@pages/coupon/Coupon')) -const CouponEvent = lazy(() => import('@pages/coupon/CouponEvent')) const MyTicket = lazy(() => import('@pages/ticket/MyTicket')) const Calendar = lazy(() => import('@pages/calendar/Calendar')) -const Order = lazy(() => import('@pages/order/index')) +const Order = lazy(() => import('@pages/order/Order')) const Review = lazy(() => import('@pages/review/Review')) +const Profile = lazy(() => import('@pages/setting/Profile')) +const UserInformation = lazy(() => import('@pages/common/UserInfo')) +const Follower = lazy(() => import('@pages/setting/Follower')) +const Following = lazy(() => import('@pages/setting/Following')) const NotFound = lazy(() => import('@pages/errors/NotFound')) function App() { @@ -94,7 +93,7 @@ function App() { } /> } /> } /> - } /> + } /> } /> } /> } /> @@ -105,7 +104,6 @@ function App() { } /> } /> } /> - } /> } /> } /> } /> diff --git a/src/components/CalendarSelector.tsx b/src/components/CalendarSelector.tsx index d7f8911..1b5d79e 100644 --- a/src/components/CalendarSelector.tsx +++ b/src/components/CalendarSelector.tsx @@ -5,17 +5,18 @@ interface Props { wrapperClass: string label?: string id: string + onChange?: any } const CalendarSelector = (props: Props) => { - const { wrapperClass, label = 'Sales period', id } = props + const { wrapperClass, label = 'Period', id, onChange } = props return (
- +
) } diff --git a/src/components/ColumnExpense.tsx b/src/components/ColumnExpense.tsx index 15fb29b..6b2edc7 100644 --- a/src/components/ColumnExpense.tsx +++ b/src/components/ColumnExpense.tsx @@ -25,12 +25,16 @@ import { IExpense, ISubExpense } from '@interfaces/contents/expense.interface' import { useCreateSubExpenseMutation, useDeleteExpenseMutation } from '@redux/apis/expense.api' import { ICreatedSubExpensePayload } from '@dtos/expense.dto' +//i18n +import { withTranslation } from 'react-i18next' + interface IProps { + t: any index: number expense: IExpense } const ColumnExpense = (props: IProps) => { - const { index, expense } = props + const { t, index, expense } = props const [name, setName] = useState('') const [price, setPrice] = useState(0) @@ -42,9 +46,6 @@ const ColumnExpense = (props: IProps) => { const [DeleteExpense, { isLoading: loadingDelete }] = useDeleteExpenseMutation() const [CreateExpense, { isLoading: loadingCreate }] = useCreateSubExpenseMutation() - console.log('render') - console.log(expense.subExpenses) - const handleDeleteExpense = async () => { try { const result = await DeleteExpense(expense.id).unwrap() @@ -77,11 +78,7 @@ const ColumnExpense = (props: IProps) => { } return ( - +
{expense.title}
@@ -117,7 +114,7 @@ const ColumnExpense = (props: IProps) => { onClick={toggleOpenNewCardForm} > - Add new Sub Expense + {t('add_new_sub_expense')}
) : ( @@ -127,7 +124,7 @@ const ColumnExpense = (props: IProps) => { id='name' value={name} onChange={(e) => setName(e.target.value)} - placeholder='Enter name' + placeholder={t('sub_expense_placeholder')} /> { ) } -export default ColumnExpense +export default withTranslation('my_expense_detail')(ColumnExpense) diff --git a/src/components/CouponCard.tsx b/src/components/CouponCard.tsx index 2c1ad70..033fc48 100644 --- a/src/components/CouponCard.tsx +++ b/src/components/CouponCard.tsx @@ -6,20 +6,24 @@ import useMeasure from 'react-use-measure' import Spring from './Spring' import { TruncatedText } from '@layouts/components/navbar/TruncatedText' import ModalUpdateCoupon from '@pages/coupon/components/ModalUpdate' +import ConfirmDialog from './Dialog' //interface import { ICoupon } from '@interfaces/contents/coupon.interface' -import ConfirmDialog from './Dialog' -interface Props { +//i18n +import { withTranslation } from 'react-i18next' + +interface IProps { + t: any coupon: ICoupon index: number onDelete: (id: string) => void isDeleteLoading: boolean } -const CouponCard = (props: Props) => { - const { coupon, index, onDelete, isDeleteLoading } = props +const CouponCard = (props: IProps) => { + const { t, coupon, index, onDelete, isDeleteLoading } = props const [openDialog, setOpenDialog] = useState(false) const [modalOpen, setModalOpen] = useState(false) @@ -41,7 +45,7 @@ const CouponCard = (props: Props) => {
-
+

{coupon.percentageValue}%

@@ -50,10 +54,10 @@ const CouponCard = (props: Props) => {

@@ -78,4 +82,4 @@ const CouponCard = (props: Props) => { ) } -export default CouponCard +export default withTranslation('coupon')(CouponCard) diff --git a/src/components/FormToChat.tsx b/src/components/FormToChat.tsx index 3065d41..743b3bd 100644 --- a/src/components/FormToChat.tsx +++ b/src/components/FormToChat.tsx @@ -7,7 +7,11 @@ import { AppSocketContext } from '@contexts/socket.context' //util import classNames from 'classnames' -interface Props { +//i18n +import { withTranslation } from 'react-i18next' + +interface IProps { + t: any userId: string eventId: string hostId: string @@ -16,25 +20,25 @@ interface Props { userFullName: string } -const FormToChat = (props: Props) => { - const { userId, eventId, hostId, eventName, userEmail, userFullName } = props +const FormToChat = (props: IProps) => { + const { t, userId, eventId, hostId, eventName, userEmail, userFullName } = props const { handleJoinChatRoom } = useContext(AppSocketContext) return (
-

Conversation

-

- If you have any questions or problems related to this event. +

{t('conversation.title')}

+

+ {t('conversation.description_one')}
- Do not hesitate to contact me. + {t('conversation.description_two')}

{
{
@@ -68,11 +72,11 @@ const FormToChat = (props: Props) => { onClick={() => handleJoinChatRoom && handleJoinChatRoom({ eventId, hostId, userId })} className='btn btn-primary w-40 hover:bg-primary-500' > - Start Chat + {t('conversation.start_chat')}
) } -export default FormToChat +export default withTranslation('event_detail')(FormToChat) diff --git a/src/components/NotData.tsx b/src/components/NotData.tsx deleted file mode 100644 index 1985bef..0000000 --- a/src/components/NotData.tsx +++ /dev/null @@ -1,22 +0,0 @@ -//assets -import dataImg from '@assets/images/common/no_data.png' - -//i18n -import { withTranslation } from 'react-i18next' - -interface Props { - t: any - color?: string -} - -const NotData = (props: Props) => { - const { t } = props - return ( -
- -

{t('not_data.text')}

-
- ) -} - -export default withTranslation('common')(NotData) diff --git a/src/components/OrderCollapseItem.tsx b/src/components/OrderCollapseItem.tsx index 474e32a..bb821b3 100644 --- a/src/components/OrderCollapseItem.tsx +++ b/src/components/OrderCollapseItem.tsx @@ -1,121 +1,77 @@ -//hooks -import { useWindowSize } from 'react-use' - //components import Collapse from '@mui/material/Collapse' -import RatingStars from '@ui/RatingStars' -import SubmenuTrigger from '@ui/SubmenuTrigger' -import { NavLink } from 'react-router-dom' //utils import { getStatusColor } from '@utils/helpers' -interface Props { +//util +import dayjs from 'dayjs' + +interface IProps { order?: any activeCollapse?: any handleCollapse?: any } -const OrderCollapseItem = (props: Props) => { +const OrderCollapseItem = (props: IProps) => { const { order, activeCollapse, handleCollapse } = props - const isExtraSmall = useWindowSize().width < 375 - - const status = - order.payment.amount === order.payment.received - ? 'Fully paid' - : order.payment.amount > order.payment.received && order.payment.received !== 0 - ? 'Partially paid' - : 'Unpaid' - return (
- #{order.orderNumber} -
+
+
+ anhquoc +
+ My Event +
+
+

{dayjs(order.timestamp).format('DD.MM.YY, hh:mm')}

- - - -
- + - + + - + - - + + - - + + - - + + - - - - - - + +
ProductAuthor Name{order.event.creator.userName}
-
-
- {order.product.name} -
-
-
{order.product.name}
-
-

Regular price: ${order.product.regular_price}

- {order.product.sale_price &&

Sale price: ${order.product.sale_price}

} -
-
-
+
Status + + {order.status} +
SKU{order.sku}Quantity{order.ticketQuantity}
Category{order.category}Total Price{order.totalPrice}
Payment -
- - {status !== 'Fully paid' && `$${order.payment.received} / from `}${order.payment.amount} - - {status} -
-
Discount{order.discountPrice}
Status - {isExtraSmall ? ( - order.status - ) : ( - - {order.status} - - )} -
Rate - {isExtraSmall ? ( - order.rating - ) : ( -
- -
- )} -
Final Price{order.finalPrice}
diff --git a/src/components/ReportItem.tsx b/src/components/ReportItem.tsx index cf7e741..9e1b504 100644 --- a/src/components/ReportItem.tsx +++ b/src/components/ReportItem.tsx @@ -24,7 +24,7 @@ const ReportItem = (props: Props) => { alt={data.title} />
-
{t(`total-report.${data.dataKey}`)}
+
{t(`total_report.${data.dataKey}`)}
${commaFormatter(data.amount)} diff --git a/src/components/Review.tsx b/src/components/Review.tsx index 2116549..08600b6 100644 --- a/src/components/Review.tsx +++ b/src/components/Review.tsx @@ -13,6 +13,7 @@ import RatingStars from '@ui/RatingStars' import Timestamp from '@ui/Timestamp' import ModalBase from '@ui/ModalBase' import ConfirmDialog from './Dialog' +import { toast } from 'react-toastify' //interfaces import { IReview } from 'interfaces/contents/review.interface' @@ -28,7 +29,9 @@ import userDefault from '@assets/images/common/user_default.png' //redux import { useDeleteReviewMutation } from '@redux/apis/review.api' -import { toast } from 'react-toastify' + +//i18n +import { withTranslation } from 'react-i18next' interface UserProps { userName: string @@ -88,12 +91,13 @@ const EventModal = (props: IEventProps) => { } interface IProps { + t: any review: IReview index: number } const Review = (props: IProps) => { - const { index, review } = props + const { t, index, review } = props const { theme } = useTheme() const { width } = useWindowSize() @@ -186,15 +190,15 @@ const Review = (props: IProps) => {

- Date: + {t('modal.date')}: {dayjs(review.createdAt).format('DD/MM/YYYY, hh:mm A')}

- UserName: + {t('modal.username')}: {review.user.userName}

- Rate: + {t('modal.rate')}:

{ ) } -export default Review +export default withTranslation('review')(Review) diff --git a/src/components/TicketGridItem.tsx b/src/components/TicketGridItem.tsx new file mode 100644 index 0000000..0f877ee --- /dev/null +++ b/src/components/TicketGridItem.tsx @@ -0,0 +1,59 @@ +// components +import Spring from '@components/Spring' +import { ITicket } from '@interfaces/contents/ticket.interface' +import { NavLink } from 'react-router-dom' + +//i18n +import { withTranslation } from 'react-i18next' + +interface IProps { + t: any + ticket: ITicket + index: number + isSlide?: boolean +} + +const TicketGridItem = (props: IProps) => { + const { t, ticket, index, isSlide } = props + + const Wrapper = isSlide ? 'div' : Spring + const wrapperProps = isSlide ? {} : { type: 'slideUp', index } + + return ( + +

+
+ {ticket.event.name} +
+
+ + {ticket.event.name} + +
+

+ {t('card.ticket_no')}: {ticket.ticketNo} +

+

+ {t('card.name')}: {ticket.customerName} +

+

+ {t('card.email')}: {ticket.customerEmail} +

+

+ {t('card.phone')}: {ticket.customerPhone} +

+

+ {t('card.ticket_type')} : {ticket.ticketType.name} +

+

{t('card.status')} : Active

+
+ + ) +} + +export default withTranslation('my_ticket')(TicketGridItem) diff --git a/src/components/TotalBalance.tsx b/src/components/TotalBalance.tsx index 63846ec..4444fee 100644 --- a/src/components/TotalBalance.tsx +++ b/src/components/TotalBalance.tsx @@ -35,7 +35,7 @@ const TotalBalance = (props: Props) => { />
$476,3k - {t('total-balance')} + {t('total_balance')}
diff --git a/src/components/TransactionCollapseItem.tsx b/src/components/TransactionCollapseItem.tsx new file mode 100644 index 0000000..30b7f36 --- /dev/null +++ b/src/components/TransactionCollapseItem.tsx @@ -0,0 +1,87 @@ +// components +import Collapse from '@mui/material/Collapse' + +// utils +import PropTypes from 'prop-types' +import dayjs from 'dayjs' +import { getStatusColor } from '@utils/helpers' + +interface IProps { + transaction: any + activeCollapse: any + handleCollapse: any +} +const TransactionCollapseItem = (props: IProps) => { + const { transaction, activeCollapse, handleCollapse } = props + + return ( +
+
+
+
+ anhquoc +
+ My Event +
+
+

{dayjs(transaction.timestamp).format('DD.MM.YY, hh:mm')}

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customer{transaction.customerName}
Status + + {transaction.status} + +
Quantity{transaction.ticketQuantity}
Total Price{transaction.totalPrice}
Discount{transaction.discountPrice}
Final Price{transaction.finalPrice}
+
+
+ ) +} + +TransactionCollapseItem.propTypes = { + transaction: PropTypes.object.isRequired, + activeCollapse: PropTypes.string.isRequired, + handleCollapse: PropTypes.func.isRequired +} + +export default TransactionCollapseItem diff --git a/src/components/events/CardMyEvent.tsx b/src/components/events/CardMyEvent.tsx index e3a0993..0d29ce4 100644 --- a/src/components/events/CardMyEvent.tsx +++ b/src/components/events/CardMyEvent.tsx @@ -89,7 +89,7 @@ const CardMyEvent = (props: Props) => { setModalCoupons(true) }} > - Apply Coupon + {t('management.apply_coupons')} )}
diff --git a/src/components/events/EventCard.tsx b/src/components/events/EventCard.tsx index 5342b05..d71dfd1 100644 --- a/src/components/events/EventCard.tsx +++ b/src/components/events/EventCard.tsx @@ -50,6 +50,22 @@ const EventCard = (props: Props) => {

{event.name}

+
+ No image +
{event.categories[0].name}
+
{dayjs(event.startTime).format('DD/MM/YYYY dddd hh:mm A').toString()} diff --git a/src/components/events/EventExpenseItem.tsx b/src/components/events/EventExpenseItem.tsx index 89e573d..84f8983 100644 --- a/src/components/events/EventExpenseItem.tsx +++ b/src/components/events/EventExpenseItem.tsx @@ -6,13 +6,17 @@ import Spring from '@components/Spring' //interface import { IMyEventAnalysis } from '@interfaces/contents/event.interface' +//i18n +import { withTranslation } from 'react-i18next' + interface Props { + t: any event: IMyEventAnalysis index: number } const EventExpenseItem = (props: Props) => { - const { event, index } = props + const { t, event, index } = props return ( @@ -27,16 +31,12 @@ const EventExpenseItem = (props: Props) => {
-

- Total SubExpense : {event.totalSale || 0} -

-

- Total Expense : {event.totalFavourite || 0} -

+

{t('total_sub_expense')} : 3

+

{t('total_expense')} : 500

) } -export default EventExpenseItem +export default withTranslation('my_expense')(EventExpenseItem) diff --git a/src/components/events/EventFavouriteItem.tsx b/src/components/events/EventFavouriteItem.tsx index 26dc6c6..a058bba 100644 --- a/src/components/events/EventFavouriteItem.tsx +++ b/src/components/events/EventFavouriteItem.tsx @@ -38,7 +38,7 @@ const EventFavouriteItem = (props: Props) => {

- {t('item.category')}: {event.categories[0].name} + {t('item.category')}: {t(`category.${event.categories[0].name}`)}

{t('item.date')}: {dayjs(event.startTime).format('DD/MM/YYYY')} @@ -46,10 +46,10 @@ const EventFavouriteItem = (props: Props) => {

- View + {t('action.view')}
diff --git a/src/components/events/EventInformation.tsx b/src/components/events/EventInformation.tsx index f948db1..80935f7 100644 --- a/src/components/events/EventInformation.tsx +++ b/src/components/events/EventInformation.tsx @@ -32,11 +32,12 @@ import { useFollowUserMutation, useUnFollowUserMutation, useCheckFollowerQuery } import { withTranslation } from 'react-i18next' interface IProps { + t: any event: IEvent } const EventInformation = (props: IProps) => { - const { event } = props + const { t, event } = props const navigate = useNavigate() @@ -79,32 +80,32 @@ const EventInformation = (props: IProps) => {
-

Time

+

{t('information.time')}

{dayjs(event?.startTime).format('dddd, DD/MM/YYYY hh:mm A').toString()}

-

Location

+

{t('information.location')}

{event?.location}

-

Happen

+

{t('information.happen')}

9 day

-

Participant

+

{t('information.participant')}

{totalQuantity || 200}

-
Organization By
+
{t('information.organization_by')}
{ ) : (
{isFollow ? : } -

{isFollow ? 'Unfollow' : 'Follow'}

+

{isFollow ? t('information.follow') : t('information.unfollow')}

)} @@ -128,9 +129,9 @@ const EventInformation = (props: IProps) => {
-
Description
+
{t('information.description')}

{event?.description}

-
3 Reasons to attend the event:
+
3 {t('information.reasons_to_attend_the_event')}:
{event?.reasons?.map((reason: IReason, index: number) => (

@@ -169,4 +170,4 @@ const EventInformation = (props: IProps) => { ) } -export default withTranslation('event')(EventInformation) +export default withTranslation('event_detail')(EventInformation) diff --git a/src/components/events/create/TicketEventCreate.tsx b/src/components/events/create/TicketEventCreate.tsx index 8624eb6..e300df1 100644 --- a/src/components/events/create/TicketEventCreate.tsx +++ b/src/components/events/create/TicketEventCreate.tsx @@ -79,10 +79,10 @@ const TicketEventCreate = (props: Props) => {

{t('ticket.title')}

-
+
setValue('eventPaymentType', EEventPaymentTicket.Paid)} - className={`border-[2px] border-solid ${ + className={`card border-[2px] border-solid ${ eventTicketType === EEventPaymentTicket.Paid ? 'border-primary' : 'border-textGray' } rounded-lg py-4 px-12 flex flex-col items-center justify-center hover:cursor-pointer`} > @@ -103,7 +103,7 @@ const TicketEventCreate = (props: Props) => { setValue('eventPaymentType', EEventPaymentTicket.Free) // setValue('ticketTypes', [] as any) }} - className={`border-[2px] border-solid ${ + className={`card border-[2px] border-solid ${ eventTicketType === EEventPaymentTicket.Free ? 'border-primary' : 'border-textGray' } rounded-lg py-4 px-12 flex flex-col items-center justify-center hover:cursor-pointer`} > @@ -161,7 +161,6 @@ const TicketEventCreate = (props: Props) => { className={classNames('field-input', { 'field-input--error': false })} id='ticket_quantity' defaultValue={0} - placeholder='Enter the name of the ticket' {...register(`ticketTypeItems.${index}.quantity`)} />
@@ -176,7 +175,6 @@ const TicketEventCreate = (props: Props) => { className={classNames('field-input', { 'field-input--error': false })} id='ticket_price' defaultValue={0} - placeholder='Enter the name of the ticket' {...register(`ticketTypeItems.${index}.price`)} />
diff --git a/src/components/message/ConversationHeader.tsx b/src/components/message/ConversationHeader.tsx index 6660f78..85a6b32 100644 --- a/src/components/message/ConversationHeader.tsx +++ b/src/components/message/ConversationHeader.tsx @@ -1,26 +1,38 @@ //components import Avatar from './Avatar' +//i18n +import { withTranslation } from 'react-i18next' + interface IProps { + t: any imageUrl: string title: string organizerFullName?: string userFullName?: string } const ConversationHeader = (props: IProps) => { - const { imageUrl, title, organizerFullName, userFullName } = props + const { t, imageUrl, title, organizerFullName, userFullName } = props return (

{title}

- {organizerFullName &&

Organizer: {organizerFullName}

} - {userFullName &&

User: {userFullName}

} + {organizerFullName && ( +

+ {t('box_message.right.organizer')}: {organizerFullName} +

+ )} + {userFullName && ( +

+ {t('box_message.right.user')}: {userFullName} +

+ )}
) } -export default ConversationHeader +export default withTranslation('common')(ConversationHeader) diff --git a/src/components/message/ConversationItem.tsx b/src/components/message/ConversationItem.tsx index 9be6269..b0e0ea3 100644 --- a/src/components/message/ConversationItem.tsx +++ b/src/components/message/ConversationItem.tsx @@ -5,7 +5,7 @@ import Avatar from './Avatar' import dayjs from 'dayjs' //interface -import { IConversation } from '@interfaces/contents/conversation.interface' +import { IConversation } from '@interfaces/websockets/conversation.interface' //redux import { useAppDispatch } from '@hooks/useRedux' diff --git a/src/components/message/MessageInput.tsx b/src/components/message/MessageInput.tsx index b42805f..c88a023 100644 --- a/src/components/message/MessageInput.tsx +++ b/src/components/message/MessageInput.tsx @@ -22,7 +22,10 @@ import EmojiPicker from 'emoji-picker-react' //util import { isAudio, isImage } from '@utils/helpers' -const MessageInput = ({ conversation = null }: any) => { +//i18n +import { withTranslation } from 'react-i18next' + +const MessageInput = ({ conversation = null, t }: any) => { const [newMessage, setNewMessage] = useState('') const [inputErrorMessage, setInputErrorMessage] = useState('') const [messageSending, setMessageSending] = useState(false) @@ -30,7 +33,7 @@ const MessageInput = ({ conversation = null }: any) => { const [uploadProgress, setUploadProgress] = useState(0) const onFileChange = () => { - console.log(conversation) + console.log(conversation, messageSending) setInputErrorMessage('') setMessageSending(false) setUploadProgress(0) @@ -69,14 +72,14 @@ const MessageInput = ({ conversation = null }: any) => {
setNewMessage(e.target.value)} />
{!!uploadProgress && ( @@ -127,4 +130,4 @@ const MessageInput = ({ conversation = null }: any) => { ) } -export default MessageInput +export default withTranslation('common')(MessageInput) diff --git a/src/components/message/MessageItem.tsx b/src/components/message/MessageItem.tsx index ae91f1c..1dbefc1 100644 --- a/src/components/message/MessageItem.tsx +++ b/src/components/message/MessageItem.tsx @@ -8,7 +8,7 @@ import MessageAttachments from './MessageAttachments' import MessageOptionsDropdown from './MessageOptionsDropdown' //interface -import { IMessage } from '@interfaces/contents/conversation.interface' +import { IMessage } from '@interfaces/websockets/conversation.interface' //redux import { useAppSelector } from '@hooks/useRedux' diff --git a/src/components/message/NewMessageInput.tsx b/src/components/message/NewMessageInput.tsx index 246537f..717aac5 100644 --- a/src/components/message/NewMessageInput.tsx +++ b/src/components/message/NewMessageInput.tsx @@ -1,6 +1,16 @@ +//hook import { useRef, useEffect } from 'react' -const NewMessageInput = ({ value, onChange, onSend }: any) => { +//i18n +interface IProps { + placeholder: string + value: string + onChange: (e: any) => void + onSend: () => void +} + +const NewMessageInput = (props: IProps) => { + const { placeholder, value, onChange, onSend } = props const input: any = useRef(null) const onInputKeyDown = (ev: any) => { @@ -32,14 +42,11 @@ const NewMessageInput = ({ value, onChange, onSend }: any) => { onChangeEvent(ev)} className='input w-full resize-r-none resize-none overflow-y-auto max-h-40 focus:outline-none' - name='' - id='' - > + /> ) } diff --git a/src/components/payment/ModalCheckout.tsx b/src/components/payment/ModalCheckout.tsx new file mode 100644 index 0000000..7de0250 --- /dev/null +++ b/src/components/payment/ModalCheckout.tsx @@ -0,0 +1,91 @@ +//component +import ModalBase from '@ui/ModalBase' + +//utils +import classNames from 'classnames' + +//i18n +import { withTranslation } from 'react-i18next' + +interface IProps { + t: any + modalOpen: boolean + setModalOpen: (value: boolean) => void +} + +const ModalCheckout = (props: IProps) => { + const { t, modalOpen, setModalOpen } = props + + return ( + setModalOpen(false)}> +
+ +
{t('checkout.title')}
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+ ) +} + +export default withTranslation('event_detail')(ModalCheckout) diff --git a/src/constants/columnDefs.tsx b/src/constants/columnDefs.tsx index 0a3531d..ebd202b 100644 --- a/src/constants/columnDefs.tsx +++ b/src/constants/columnDefs.tsx @@ -1,102 +1,190 @@ // components -import RatingStars from '@ui/RatingStars' -import SubmenuTrigger from '@ui/SubmenuTrigger' -import { NavLink } from 'react-router-dom' +import Timestamp from '@ui/Timestamp' // utils -import { getCategory, getStatusColor } from '@utils/helpers' +import { getStatusColor } from '@utils/helpers' export const ORDERS_COLUMN_DEFS: any = [ { - title: '# order', - dataIndex: 'orderNumber', - width: '100px', - render: (text: any) => #{text} + title: 'Date & Time', + dataIndex: 'created_at', + render: (timestamp: any) => ( +
+ +
+ ) }, { - title: 'Product', - dataIndex: 'product', + title: 'Event', + dataIndex: 'event', className: 'product-cell', - render: (product: any) => ( -
-
- {product.name} + render: (_: any, record: any) => { + return ( +
+ {record.event ? ( +
+
+ {record.event.name} +
+ {record.event.name} +
+ ) : ( + 'N/A' + )}
-
-
{product.name}
-
-

Regular price: ${product.regular_price}

- {product.sale_price &&

Sale price: ${product.sale_price}

} -
+ ) + }, + + responsive: ['xl'] + }, + { + title: 'Author', + dataIndex: 'user', + className: 'product-cell', + render: (_: any, record: any) => { + return ( +
+ {record.event ? ( +
+
+
+ {record.event.creator.userName} +
+ {record.event.creator.userName} +
+
+ ) : ( + 'N/A' + )}
+ ) + }, + + responsive: ['xl'] + }, + + { + title: 'Order Status', + dataIndex: 'status', + render: (status: string) => ( +
+ + {status} +
- ), - responsive: ['lg'] + ) }, { - title: 'SKU', - dataIndex: 'sku' + title: 'Quantity', + dataIndex: 'ticketQuantity', + responsive: ['xl'] }, { - title: 'Category', - dataIndex: 'category', - render: (category: any) => ( -
-
- -
- {getCategory(category)!.label} -
- ), - responsive: ['lg'] + title: 'Total Price', + dataIndex: 'totalPrice', + render: (totalPrice: number) => { + return

${totalPrice}

+ } + }, + { + title: 'Discount', + dataIndex: 'discountPrice', + render: (discountPrice: number) => { + return

${discountPrice}

+ } }, { - title: 'Payment', - dataIndex: 'payment', - render: (payment: any) => { - const status = - payment.amount === payment.received - ? 'Fully paid' - : payment.amount > payment.received && payment.received !== 0 - ? 'Partially paid' - : 'Unpaid' + title: 'Final Price', + dataIndex: 'finalPrice', + render: (_: any, record: any) => { + const total = record.totalPrice - record.discountPrice + return

${total}

+ } + } +] + +export const TRANSACTIONS_COLUMN_DEFS: any = [ + { + title: 'Date & Time', + dataIndex: 'created_at', + render: (timestamp: any) => ( +
+ +
+ ) + }, + { + title: 'Event', + dataIndex: 'event', + render: (_: any, record: any) => { return ( -
- - {status !== 'Fully paid' && `$${payment.received} / from `}${payment.amount} - - {status} +
+ {record.event ? ( +
+
+ {record.event.name} +
+ {record.event.name} +
+ ) : ( + 'N/A' + )}
) } }, { - title: 'Order Status', + title: 'Customer', + dataIndex: 'customerName', + render: (type: any) => {type} + }, + { + title: 'Method', + dataIndex: 'method', + responsive: ['xxl'] + }, + { + title: 'Status', dataIndex: 'status', render: (status: any) => ( - - {status} - +
+ + {status} + +
) }, { - title: 'Rate', - dataIndex: 'rating', - render: (rating: any) => , + title: 'Quantity', + dataIndex: 'ticketQuantity', responsive: ['xl'] }, { - title: 'Actions', - dataIndex: 'actions', - width: '70px', - render: () => ( -
- - - - -
- ) + title: 'Total Price', + dataIndex: 'totalPrice', + render: (totalPrice: number) => { + return

${totalPrice}

+ } + }, + { + title: 'Discount', + dataIndex: 'discountPrice', + render: (discountPrice: number) => { + return

${discountPrice}

+ } + }, + { + title: 'Final Price', + dataIndex: 'finalPrice', + render: (_: any, record: any) => { + const total = record.totalPrice - record.discountPrice + + return

${total}

+ } } ] diff --git a/src/constants/enum.constant.ts b/src/constants/enum.constant.ts index 1491a0d..055bfc4 100644 --- a/src/constants/enum.constant.ts +++ b/src/constants/enum.constant.ts @@ -45,10 +45,10 @@ export enum EPaymentMethod { } export enum EPaymentStatus { - PAID = 'PAID', - PENDING = 'PENDING', - FAILED = 'FAILED', - REJECTED = 'REJECTED' + Pending = 'Pending', + Failed = 'Failed', + Reject = 'Reject', + Success = 'Success' } export enum ETicketStatus { @@ -56,3 +56,8 @@ export enum ETicketStatus { CHECKEDIN = 'CHECKEDIN', INACTIVE = 'INACTIVE' } + +export enum EStatusTicket { + Active = 'Active', + Inactive = 'Inactive' +} diff --git a/src/constants/options.constant.ts b/src/constants/options.constant.ts index 4f29e3a..215b04f 100644 --- a/src/constants/options.constant.ts +++ b/src/constants/options.constant.ts @@ -139,6 +139,7 @@ export const REVIEW_SORT_OPTIONS: IOptionSelect[] = [ export const LOCALES: IOptionSelect[] = [ { value: 'en', label: 'English', icon: english }, + { value: 'vn', label: 'Vietnam', icon: vietnam }, { value: 'cn', label: 'China', icon: china }, { value: 'jp', label: 'Japan', icon: japan }, { value: 'kr', label: 'Korea', icon: korea }, @@ -146,8 +147,7 @@ export const LOCALES: IOptionSelect[] = [ { value: 'it', label: 'Italia', icon: italia }, { value: 'ru', label: 'Russia', icon: russia }, { value: 'sp', label: 'Spain', icon: spain }, - { value: 'fr', label: 'France', icon: france }, - { value: 'vn', label: 'Vietnam', icon: vietnam } + { value: 'fr', label: 'France', icon: france } ] export const APPS_OPTIONS: IOptionSelect[] = [ diff --git a/src/constants/routes.constant.tsx b/src/constants/routes.constant.tsx index b109800..29a8030 100644 --- a/src/constants/routes.constant.tsx +++ b/src/constants/routes.constant.tsx @@ -22,22 +22,22 @@ const ROUTES: Route[] = [ links: [ { name: 'overview', path: '/organization/dashboard/overview' }, { - name: 'event analysis', + name: 'event_analysis', path: '/organization/dashboard/event-analysis' }, { name: 'customer', path: '/organization/dashboard/customer' }, - { name: 'payment', path: '/organization/dashboard/payment' } + { name: 'transaction', path: '/organization/dashboard/transaction' } ] }, { name: 'event', icon: , links: [ - { name: 'my favourite', path: '/organization/my-favourite' }, - { name: 'my events', path: '/organization/my-event' }, - { name: 'trash events', path: '/organization/trash-event' }, - { name: 'create event', path: '/organization/create-event' }, - { name: 'my expense', path: '/organization/my-expense' } + { name: 'my_favourite', path: '/organization/my-favourite' }, + { name: 'my_events', path: '/organization/my-event' }, + { name: 'trash_events', path: '/organization/trash-event' }, + { name: 'create_event', path: '/organization/create-event' }, + { name: 'my_expense', path: '/organization/my-expense' } ] }, { diff --git a/src/contexts/socket.context.tsx b/src/contexts/socket.context.tsx index c2794da..d1a8811 100644 --- a/src/contexts/socket.context.tsx +++ b/src/contexts/socket.context.tsx @@ -11,9 +11,6 @@ import { setSocket } from '@redux/slices/socket.slice' //socket import { HttpTransportType, HubConnection, HubConnectionBuilder, LogLevel } from '@microsoft/signalr' -//interface and types -import { JoinChatRoomParams, SendMessageParams } from '@interfaces/websockets/message.interface' - const AppSocketProvider = ({ children }: PropsWithChildren) => { const dispatch = useAppDispatch() const user = useAppSelector((state) => state.persistedReducer.user.user) @@ -62,7 +59,7 @@ const AppSocketProvider = ({ children }: PropsWithChildren) => { } }, [user, dispatch]) - const handleJoinChatRoom = async ({ eventId, hostId, userId }: JoinChatRoomParams) => { + const handleJoinChatRoom = async ({ eventId, hostId, userId }: any) => { try { await connection?.invoke('JoinChatRoom', { eventId, hostId, userId }) } catch (error: any) { @@ -81,7 +78,7 @@ const AppSocketProvider = ({ children }: PropsWithChildren) => { videoUrl, audioId, audioUrl - }: SendMessageParams) => { + }: any) => { try { await connection?.invoke('SendMessage', { userId, @@ -115,8 +112,8 @@ const AppSocketProvider = ({ children }: PropsWithChildren) => { } export interface AppSocketContextProps { - handleJoinChatRoom: (params: JoinChatRoomParams) => Promise - handleSendMessage: (params: SendMessageParams) => Promise + handleJoinChatRoom: (params: any) => Promise + handleSendMessage: (params: any) => Promise connection: HubConnection } diff --git a/src/db/orders.ts b/src/db/orders.ts index 8c42c61..c3e6bec 100644 --- a/src/db/orders.ts +++ b/src/db/orders.ts @@ -1,168 +1,196 @@ +import { faker } from '@faker-js/faker' + const orders = [ { - orderNumber: 123456, - ticket: '123456FR', - status: 'completed', - rating: 3.5, - category: 'electronics', - payment: { - amount: 600, - received: 600 + created_at: faker.date.past(), + status: 'waiting', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Albo E-Store', + coverImageUrl: '' + }, + user: { + userName: 'Anh Quoc', + avatarUrl: '' + } + }, + { + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Ecom', + coverImageUrl: '' + }, + user: { + userName: 'Anh Quoc', + avatarUrl: '' + } + }, + { + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Albo E-Store', + coverImageUrl: '' }, - product: { - name: 'Oculus Quest 2 VR Headset 64 GB', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 600, - sale_price: 559 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 154844, - ticket: '598741FR', - status: 'confirmed', - rating: 4.5, - category: 'fashion', - payment: { - amount: 4000, - received: 180 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Ecom', + coverImageUrl: '' }, - product: { - name: 'Levis Standard Issue Backpack Black', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 100 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 202587, - ticket: '485912TY', + created_at: faker.date.past(), status: 'cancelled', - rating: 4.5, - category: 'electronics', - payment: { - amount: 200, - received: 0 + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Delight', + coverImageUrl: '' }, - product: { - name: 'Xiaomi WiFI Repeater Pro', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 200, - sale_price: 180 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 300411, - ticket: '365487RT', - status: 'confirmed', - rating: 4.5, - category: 'services', - payment: { - amount: 9.99, - received: 9.99 + created_at: faker.date.past(), + status: 'rejected', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Delight', + coverImageUrl: '' }, - product: { - name: 'UPS Express Shipping', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 9.99 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 785241, - ticket: '002315ES', - status: 'confirmed', - rating: 4.5, - category: 'fashion', - payment: { - amount: 40, - received: 40 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Whale', + coverImageUrl: '' }, - product: { - name: 'Parfois Woman Flower Backpack', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 20, - sale_price: 15.99 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 458745, - ticket: '541125FR', - status: 'completed', - rating: 0, - category: 'food', - payment: { - amount: 129.54, - received: 129.54 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Academy', + coverImageUrl: '' }, - product: { - name: 'Goodwill Sanctuary Sanca Olive Oil 5L', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 129.54 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 105488, - ticket: '252596FR', - status: 'confirmed', - rating: 5, - category: 'food', - payment: { - amount: 78.99, - received: 52.18 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Academy', + coverImageUrl: '' }, - product: { - name: 'Guylian Seashells Belgian Chocolate 1kg', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 78.99, - sale_price: 69.99 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 900541, - ticket: '002315BN', + created_at: faker.date.past(), status: 'cancelled', - rating: 0, - category: 'fashion', - payment: { - amount: 118.99, - received: 0 + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Oakley Store', + coverImageUrl: '' }, - product: { - name: 'Puma Crossbody Bag Black Unisex', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 118.99, - sale_price: 99.99 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 121844, - ticket: '814315LP', - status: 'refunded', - rating: 0, - category: 'services', - payment: { - amount: 9.99, - received: 0 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Oakley Store', + coverImageUrl: '' }, - product: { - name: 'Sustainable packaging services for 1 item', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 9.99 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } }, { - orderNumber: 240412, - ticket: '361087RT', - status: 'completed', - rating: 4.5, - category: 'electronics', - payment: { - amount: 200, - received: 200 + created_at: faker.date.past(), + status: 'approved', + ticketQuantity: 2, + totalPrice: 100, + discountPrice: '20', + finalPrice: 80, + event: { + name: 'Albo E-Store', + coverImageUrl: '' }, - product: { - name: 'SteamDeck Gaming Console 64 GB', - image: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', - regular_price: 200, - sale_price: 180 + user: { + userName: 'Anh Quoc', + avatarUrl: '' } } ] diff --git a/src/db/transactions.ts b/src/db/transactions.ts index 5b31efa..dd3dac5 100644 --- a/src/db/transactions.ts +++ b/src/db/transactions.ts @@ -2,183 +2,159 @@ import { faker } from '@faker-js/faker' const transactions = [ { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Visa', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'waiting', - country: 'USA', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Albo E-Store', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Visa', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'USA', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Ecom', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Maestro', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'Australia', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Albo E-Store', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'PayPal', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'Israel', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Ecom', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Switch', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'cancelled', - country: 'Italy', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Delight', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Visa', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'rejected', - country: 'USA', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Delight', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Mastercard', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'France', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Whale', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'PayPal', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'France', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Academy', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Visa', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'Latvia', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Academy', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'PayPal', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'cancelled', - country: 'Poland', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Oakley Store', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Maestro', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'Canada', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Oakley Store', - logo: '' + coverImageUrl: '' } }, { - sku: faker.finance.accountNumber(5), - timestamp: faker.date.past(), - method: 'Mastercard', - type: faker.finance.transactionType(), + created_at: faker.date.past(), + customerName: 'Anh Quoc', status: 'approved', - country: 'Sweden', - currency: faker.finance.currencyCode(), - fee: faker.finance.amount(1, 10000, 2), - tax: faker.finance.amount(0, 1, 1), - seller: { + quantity: 2, + totalPrice: 100, + discount: '20', + finalPrice: 80, + event: { name: 'Albo E-Store', - logo: '' + coverImageUrl: '' } } ] diff --git a/src/dtos/event.dto.ts b/src/dtos/event.dto.ts index 262316c..147771d 100644 --- a/src/dtos/event.dto.ts +++ b/src/dtos/event.dto.ts @@ -44,7 +44,7 @@ export const InitCreateEventPayload = { isPrivate: false, categoryIds: [], ticketTypeItems: [], - reasonItems: ['aaa'] + reasonItems: [] } as ICreateEventPayload export interface IFavoriteEventPayload { diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 49e6074..e91d497 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -48,15 +48,22 @@ i18n 'event_analysis', 'event_analysis_detail', 'customer', - 'payment', + 'transaction', 'my_favourite', 'my_event', 'trash_event', 'create_event', + 'my_expense', + 'my_expense_detail', + 'coupon', + 'my_ticket', 'calendar', 'order', 'review', 'profile', + 'userinfo', + 'follower', + 'following', 'common' ], fallbackLng: 'en', diff --git a/src/i18n/locales/china.ts b/src/i18n/locales/china.ts index d2281f8..59a2b7c 100644 --- a/src/i18n/locales/china.ts +++ b/src/i18n/locales/china.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_CN from '@translate/china/dashboard/overview-detail.json' import EVENT_ANALYSIS_CN from '@translate/china/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_CN from '@translate/china/dashboard/event-analysis-detail.json' import CUSTOMER_CN from '@translate/china/dashboard/customer.json' -import PAYMENT_CN from '@translate/china/dashboard/payment.json' +import TRANSACTION_CN from '@translate/china/dashboard/transaction.json' import MY_FAVOURITE_CN from '@translate/china/events/my-favourite.json' import MY_EVENT_CN from '@translate/china/events/my-event.json' import TRASH_EVENT_CN from '@translate/china/events/trash-event.json' import CREATE_EVENT_CN from '@translate/china/events/create-event.json' +import MY_EXPENSE_CN from '@translate/china/events/my-expense.json' +import MY_EXPENSE_DETAILS_CN from '@translate/china/events/my-expense-detail.json' +import COUPON_CN from '@translate/china/coupon.json' +import MY_TICKET_CN from '@translate/china/ticket.json' import CALENDAR_CN from '@translate/china/calendar.json' import ORDER_CN from '@translate/china/order.json' import REVIEW_CN from '@translate/china/review.json' -import PROFILE_CN from '@translate/china/profile.json' +import PROFILE_CN from '@translate/china/setting/profile.json' +import USERINFO_CN from '@translate/china/userinfo.json' +import FOLLOWER_CN from '@translate/china/setting/follower.json' +import FOLLOWING_CN from '@translate/china/setting/following.json' import COMMON_CN from '@translate/china/common.json' -const locale_china = { +const locale_cn = { landing: LANDING_CN, signin: SIGNIN_CN, signup: SIGNUP_CN, @@ -32,16 +39,23 @@ const locale_china = { event_analysis: EVENT_ANALYSIS_CN, event_analysis_detail: EVENT_ANALYSIS_DETAILS_CN, customer: CUSTOMER_CN, - payment: PAYMENT_CN, + transaction: TRANSACTION_CN, my_favourite: MY_FAVOURITE_CN, my_event: MY_EVENT_CN, trash_event: TRASH_EVENT_CN, create_event: CREATE_EVENT_CN, + my_expense: MY_EXPENSE_CN, + my_expense_detail: MY_EXPENSE_DETAILS_CN, + coupon: COUPON_CN, + my_ticket: MY_TICKET_CN, calendar: CALENDAR_CN, order: ORDER_CN, review: REVIEW_CN, profile: PROFILE_CN, + userinfo: USERINFO_CN, + follower: FOLLOWER_CN, + following: FOLLOWING_CN, common: COMMON_CN } -export default locale_china +export default locale_cn diff --git a/src/i18n/locales/english.ts b/src/i18n/locales/english.ts index c376017..9262c62 100644 --- a/src/i18n/locales/english.ts +++ b/src/i18n/locales/english.ts @@ -9,15 +9,22 @@ import OVERVIEW_DETAIL_EN from '@translate/english/dashboard/overview-detail.jso import EVENT_ANALYSIS_EN from '@translate/english/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_EN from '@translate/english/dashboard/event-analysis-detail.json' import CUSTOMER_EN from '@translate/english/dashboard/customer.json' -import PAYMENT_EN from '@translate/english/dashboard/payment.json' +import TRANSACTION_EN from '@translate/english/dashboard/transaction.json' import MY_FAVOURITE_EN from '@translate/english/events/my-favourite.json' import MY_EVENT_EN from '@translate/english/events/my-event.json' import TRASH_EVENT_EN from '@translate/english/events/trash-event.json' import CREATE_EVENT_EN from '@translate/english/events/create-event.json' +import MY_EXPENSE_EN from '@translate/english/events/my-expense.json' +import MY_EXPENSE_DETAILS_EN from '@translate/english/events/my-expense-detail.json' +import COUPON_EN from '@translate/english/coupon.json' +import MY_TICKET_EN from '@translate/english/ticket.json' import CALENDAR_EN from '@translate/english/calendar.json' import ORDER_EN from '@translate/english/order.json' import REVIEW_EN from '@translate/english/review.json' -import PROFILE_EN from '@translate/english/profile.json' +import PROFILE_EN from '@translate/english/setting/profile.json' +import USERINFO_EN from '@translate/english/userinfo.json' +import FOLLOWER_EN from '@translate/english/setting/follower.json' +import FOLLOWING_EN from '@translate/english/setting/following.json' import COMMON_EN from '@translate/english/common.json' const locale_en = { @@ -32,15 +39,22 @@ const locale_en = { event_analysis: EVENT_ANALYSIS_EN, event_analysis_detail: EVENT_ANALYSIS_DETAILS_EN, customer: CUSTOMER_EN, - payment: PAYMENT_EN, + transaction: TRANSACTION_EN, my_favourite: MY_FAVOURITE_EN, my_event: MY_EVENT_EN, trash_event: TRASH_EVENT_EN, create_event: CREATE_EVENT_EN, + my_expense: MY_EXPENSE_EN, + my_expense_detail: MY_EXPENSE_DETAILS_EN, + coupon: COUPON_EN, + my_ticket: MY_TICKET_EN, calendar: CALENDAR_EN, order: ORDER_EN, review: REVIEW_EN, profile: PROFILE_EN, + userinfo: USERINFO_EN, + follower: FOLLOWER_EN, + following: FOLLOWING_EN, common: COMMON_EN } diff --git a/src/i18n/locales/france.ts b/src/i18n/locales/france.ts index c2ac204..baadebb 100644 --- a/src/i18n/locales/france.ts +++ b/src/i18n/locales/france.ts @@ -1,47 +1,61 @@ -import LANDING_CN from '@translate/france/landing.json' -import SIGNIN_CN from '@translate/france/auth/signin.json' -import SIGNUP_CN from '@translate/france/auth/signup.json' -import HOME_CN from '@translate/france/home.json' -import EXPLORE_CN from '@translate/france/explore.json' -import EVENT_DETAIL_CN from '@translate/france/events/event-detail.json' -import OVERVIEW_CN from '@translate/france/dashboard/overview.json' -import OVERVIEW_DETAIL_CN from '@translate/france/dashboard/overview-detail.json' -import EVENT_ANALYSIS_CN from '@translate/france/dashboard/event-analysis.json' -import EVENT_ANALYSIS_DETAILS_CN from '@translate/france/dashboard/event-analysis-detail.json' -import CUSTOMER_CN from '@translate/france/dashboard/customer.json' -import PAYMENT_CN from '@translate/france/dashboard/payment.json' -import MY_FAVOURITE_CN from '@translate/france/events/my-favourite.json' -import MY_EVENT_CN from '@translate/france/events/my-event.json' -import TRASH_EVENT_CN from '@translate/france/events/trash-event.json' -import CREATE_EVENT_CN from '@translate/france/events/create-event.json' -import CALENDAR_CN from '@translate/france/calendar.json' -import ORDER_CN from '@translate/france/order.json' -import REVIEW_CN from '@translate/france/review.json' -import PROFILE_CN from '@translate/france/profile.json' -import COMMON_CN from '@translate/france/common.json' +import LANDING_FR from '@translate/france/landing.json' +import SIGNIN_FR from '@translate/france/auth/signin.json' +import SIGNUP_FR from '@translate/france/auth/signup.json' +import HOME_FR from '@translate/france/home.json' +import EXPLORE_FR from '@translate/france/explore.json' +import EVENT_DETAIL_FR from '@translate/france/events/event-detail.json' +import OVERVIEW_FR from '@translate/france/dashboard/overview.json' +import OVERVIEW_DETAIL_FR from '@translate/france/dashboard/overview-detail.json' +import EVENT_ANALYSIS_FR from '@translate/france/dashboard/event-analysis.json' +import EVENT_ANALYSIS_DETAILS_FR from '@translate/france/dashboard/event-analysis-detail.json' +import CUSTOMER_FR from '@translate/france/dashboard/customer.json' +import TRANSACTION_FR from '@translate/france/dashboard/transaction.json' +import MY_FAVOURITE_FR from '@translate/france/events/my-favourite.json' +import MY_EVENT_FR from '@translate/france/events/my-event.json' +import TRASH_EVENT_FR from '@translate/france/events/trash-event.json' +import CREATE_EVENT_FR from '@translate/france/events/create-event.json' +import MY_EXPENSE_FR from '@translate/france/events/my-expense.json' +import MY_EXPENSE_DETAILS_FR from '@translate/france/events/my-expense-detail.json' +import COUPON_FR from '@translate/france/coupon.json' +import MY_TICKET_FR from '@translate/france/ticket.json' +import CALENDAR_FR from '@translate/france/calendar.json' +import ORDER_FR from '@translate/france/order.json' +import REVIEW_FR from '@translate/france/review.json' +import PROFILE_FR from '@translate/france/setting/profile.json' +import USERINFO_FR from '@translate/france/userinfo.json' +import FOLLOWER_FR from '@translate/france/setting/follower.json' +import FOLLOWING_FR from '@translate/france/setting/following.json' +import COMMON_FR from '@translate/france/common.json' -const locale_france = { - landing: LANDING_CN, - signin: SIGNIN_CN, - signup: SIGNUP_CN, - home: HOME_CN, - explore: EXPLORE_CN, - event_detail: EVENT_DETAIL_CN, - overview: OVERVIEW_CN, - overview_detail: OVERVIEW_DETAIL_CN, - event_analysis: EVENT_ANALYSIS_CN, - event_analysis_detail: EVENT_ANALYSIS_DETAILS_CN, - customer: CUSTOMER_CN, - payment: PAYMENT_CN, - my_favourite: MY_FAVOURITE_CN, - my_event: MY_EVENT_CN, - trash_event: TRASH_EVENT_CN, - create_event: CREATE_EVENT_CN, - calendar: CALENDAR_CN, - order: ORDER_CN, - review: REVIEW_CN, - profile: PROFILE_CN, - common: COMMON_CN +const locale_fr = { + landing: LANDING_FR, + signin: SIGNIN_FR, + signup: SIGNUP_FR, + home: HOME_FR, + explore: EXPLORE_FR, + event_detail: EVENT_DETAIL_FR, + overview: OVERVIEW_FR, + overview_detail: OVERVIEW_DETAIL_FR, + event_analysis: EVENT_ANALYSIS_FR, + event_analysis_detail: EVENT_ANALYSIS_DETAILS_FR, + customer: CUSTOMER_FR, + transaction: TRANSACTION_FR, + my_favourite: MY_FAVOURITE_FR, + my_event: MY_EVENT_FR, + trash_event: TRASH_EVENT_FR, + create_event: CREATE_EVENT_FR, + my_expense: MY_EXPENSE_FR, + my_expense_detail: MY_EXPENSE_DETAILS_FR, + coupon: COUPON_FR, + my_ticket: MY_TICKET_FR, + calendar: CALENDAR_FR, + order: ORDER_FR, + review: REVIEW_FR, + profile: PROFILE_FR, + userinfo: USERINFO_FR, + follower: FOLLOWER_FR, + following: FOLLOWING_FR, + common: COMMON_FR } -export default locale_france +export default locale_fr diff --git a/src/i18n/locales/germany.ts b/src/i18n/locales/germany.ts index 3476b9c..6d5c359 100644 --- a/src/i18n/locales/germany.ts +++ b/src/i18n/locales/germany.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_GM from '@translate/germany/dashboard/overview-detail.jso import EVENT_ANALYSIS_GM from '@translate/germany/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_GM from '@translate/germany/dashboard/event-analysis-detail.json' import CUSTOMER_GM from '@translate/germany/dashboard/customer.json' -import PAYMENT_GM from '@translate/germany/dashboard/payment.json' +import TRANSACTION_GM from '@translate/germany/dashboard/transaction.json' import MY_FAVOURITE_GM from '@translate/germany/events/my-favourite.json' import MY_EVENT_GM from '@translate/germany/events/my-event.json' import TRASH_EVENT_GM from '@translate/germany/events/trash-event.json' import CREATE_EVENT_GM from '@translate/germany/events/create-event.json' +import MY_EXPENSE_GM from '@translate/germany/events/my-expense.json' +import MY_EXPENSE_DETAILS_GM from '@translate/germany/events/my-expense-detail.json' +import COUPON_GM from '@translate/germany/coupon.json' +import MY_TICKET_GM from '@translate/germany/ticket.json' import CALENDAR_GM from '@translate/germany/calendar.json' import ORDER_GM from '@translate/germany/order.json' import REVIEW_GM from '@translate/germany/review.json' -import PROFILE_GM from '@translate/germany/profile.json' +import PROFILE_GM from '@translate/germany/setting/profile.json' +import USERINFO_GM from '@translate/germany/userinfo.json' +import FOLLOWER_GM from '@translate/germany/setting/follower.json' +import FOLLOWING_GM from '@translate/germany/setting/following.json' import COMMON_GM from '@translate/germany/common.json' -const locale_germany = { +const locale_gm = { landing: LANDING_GM, signin: SIGNIN_GM, signup: SIGNUP_GM, @@ -32,16 +39,23 @@ const locale_germany = { event_analysis: EVENT_ANALYSIS_GM, event_analysis_detail: EVENT_ANALYSIS_DETAILS_GM, customer: CUSTOMER_GM, - payment: PAYMENT_GM, + transaction: TRANSACTION_GM, my_favourite: MY_FAVOURITE_GM, my_event: MY_EVENT_GM, trash_event: TRASH_EVENT_GM, create_event: CREATE_EVENT_GM, + my_expense: MY_EXPENSE_GM, + my_expense_detail: MY_EXPENSE_DETAILS_GM, + coupon: COUPON_GM, + my_ticket: MY_TICKET_GM, calendar: CALENDAR_GM, order: ORDER_GM, review: REVIEW_GM, profile: PROFILE_GM, + userinfo: USERINFO_GM, + follower: FOLLOWER_GM, + following: FOLLOWING_GM, common: COMMON_GM } -export default locale_germany +export default locale_gm diff --git a/src/i18n/locales/italia.ts b/src/i18n/locales/italia.ts index 7adbab2..0aeb729 100644 --- a/src/i18n/locales/italia.ts +++ b/src/i18n/locales/italia.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_IT from '@translate/italia/dashboard/overview-detail.json import EVENT_ANALYSIS_IT from '@translate/italia/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_IT from '@translate/italia/dashboard/event-analysis-detail.json' import CUSTOMER_IT from '@translate/italia/dashboard/customer.json' -import PAYMENT_IT from '@translate/italia/dashboard/payment.json' +import TRANSACTION_IT from '@translate/italia/dashboard/transaction.json' import MY_FAVOURITE_IT from '@translate/italia/events/my-favourite.json' import MY_EVENT_IT from '@translate/italia/events/my-event.json' import TRASH_EVENT_IT from '@translate/italia/events/trash-event.json' import CREATE_EVENT_IT from '@translate/italia/events/create-event.json' +import MY_EXPENSE_IT from '@translate/italia/events/my-expense.json' +import MY_EXPENSE_DETAILS_IT from '@translate/italia/events/my-expense-detail.json' +import COUPON_IT from '@translate/italia/coupon.json' +import MY_TICKET_IT from '@translate/italia/ticket.json' import CALENDAR_IT from '@translate/italia/calendar.json' import ORDER_IT from '@translate/italia/order.json' import REVIEW_IT from '@translate/italia/review.json' -import PROFILE_IT from '@translate/italia/profile.json' +import PROFILE_IT from '@translate/italia/setting/profile.json' +import USERINFO_IT from '@translate/italia/userinfo.json' +import FOLLOWER_IT from '@translate/italia/setting/follower.json' +import FOLLOWING_IT from '@translate/italia/setting/following.json' import COMMON_IT from '@translate/italia/common.json' -const locale_italia = { +const locale_it = { landing: LANDING_IT, signin: SIGNIN_IT, signup: SIGNUP_IT, @@ -32,16 +39,23 @@ const locale_italia = { event_analysis: EVENT_ANALYSIS_IT, event_analysis_detail: EVENT_ANALYSIS_DETAILS_IT, customer: CUSTOMER_IT, - payment: PAYMENT_IT, + transaction: TRANSACTION_IT, my_favourite: MY_FAVOURITE_IT, my_event: MY_EVENT_IT, trash_event: TRASH_EVENT_IT, create_event: CREATE_EVENT_IT, + my_expense: MY_EXPENSE_IT, + my_expense_detail: MY_EXPENSE_DETAILS_IT, + coupon: COUPON_IT, + my_ticket: MY_TICKET_IT, calendar: CALENDAR_IT, order: ORDER_IT, review: REVIEW_IT, profile: PROFILE_IT, + userinfo: USERINFO_IT, + follower: FOLLOWER_IT, + following: FOLLOWING_IT, common: COMMON_IT } -export default locale_italia +export default locale_it diff --git a/src/i18n/locales/japan.ts b/src/i18n/locales/japan.ts index d1a9ea2..b6bc91e 100644 --- a/src/i18n/locales/japan.ts +++ b/src/i18n/locales/japan.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_JP from '@translate/japan/dashboard/overview-detail.json' import EVENT_ANALYSIS_JP from '@translate/japan/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_JP from '@translate/japan/dashboard/event-analysis-detail.json' import CUSTOMER_JP from '@translate/japan/dashboard/customer.json' -import PAYMENT_JP from '@translate/japan/dashboard/payment.json' +import TRANSACTION_JP from '@translate/japan/dashboard/transaction.json' import MY_FAVOURITE_JP from '@translate/japan/events/my-favourite.json' import MY_EVENT_JP from '@translate/japan/events/my-event.json' import TRASH_EVENT_JP from '@translate/japan/events/trash-event.json' import CREATE_EVENT_JP from '@translate/japan/events/create-event.json' +import MY_EXPENSE_JP from '@translate/japan/events/my-expense.json' +import MY_EXPENSE_DETAILS_JP from '@translate/japan/events/my-expense-detail.json' +import COUPON_JP from '@translate/japan/coupon.json' +import MY_TICKET_JP from '@translate/japan/ticket.json' import CALENDAR_JP from '@translate/japan/calendar.json' import ORDER_JP from '@translate/japan/order.json' import REVIEW_JP from '@translate/japan/review.json' -import PROFILE_JP from '@translate/japan/profile.json' +import PROFILE_JP from '@translate/japan/setting/profile.json' +import USERINFO_JP from '@translate/japan/userinfo.json' +import FOLLOWER_JP from '@translate/japan/setting/follower.json' +import FOLLOWING_JP from '@translate/japan/setting/following.json' import COMMON_JP from '@translate/japan/common.json' -const locale_japan = { +const locale_jp = { landing: LANDING_JP, signin: SIGNIN_JP, signup: SIGNUP_JP, @@ -32,16 +39,23 @@ const locale_japan = { event_analysis: EVENT_ANALYSIS_JP, event_analysis_detail: EVENT_ANALYSIS_DETAILS_JP, customer: CUSTOMER_JP, - payment: PAYMENT_JP, + transaction: TRANSACTION_JP, my_favourite: MY_FAVOURITE_JP, my_event: MY_EVENT_JP, trash_event: TRASH_EVENT_JP, create_event: CREATE_EVENT_JP, + my_expense: MY_EXPENSE_JP, + my_expense_detail: MY_EXPENSE_DETAILS_JP, + coupon: COUPON_JP, + my_ticket: MY_TICKET_JP, calendar: CALENDAR_JP, order: ORDER_JP, review: REVIEW_JP, profile: PROFILE_JP, + userinfo: USERINFO_JP, + follower: FOLLOWER_JP, + following: FOLLOWING_JP, common: COMMON_JP } -export default locale_japan +export default locale_jp diff --git a/src/i18n/locales/korea.ts b/src/i18n/locales/korea.ts index 2811748..f38ae16 100644 --- a/src/i18n/locales/korea.ts +++ b/src/i18n/locales/korea.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_KR from '@translate/korea/dashboard/overview-detail.json' import EVENT_ANALYSIS_KR from '@translate/korea/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_KR from '@translate/korea/dashboard/event-analysis-detail.json' import CUSTOMER_KR from '@translate/korea/dashboard/customer.json' -import PAYMENT_KR from '@translate/korea/dashboard/payment.json' +import TRANSACTION_KR from '@translate/korea/dashboard/transaction.json' import MY_FAVOURITE_KR from '@translate/korea/events/my-favourite.json' import MY_EVENT_KR from '@translate/korea/events/my-event.json' import TRASH_EVENT_KR from '@translate/korea/events/trash-event.json' import CREATE_EVENT_KR from '@translate/korea/events/create-event.json' +import MY_EXPENSE_KR from '@translate/korea/events/my-expense.json' +import MY_EXPENSE_DETAILS_KR from '@translate/korea/events/my-expense-detail.json' +import COUPON_KR from '@translate/korea/coupon.json' +import MY_TICKET_KR from '@translate/korea/ticket.json' import CALENDAR_KR from '@translate/korea/calendar.json' import ORDER_KR from '@translate/korea/order.json' import REVIEW_KR from '@translate/korea/review.json' -import PROFILE_KR from '@translate/korea/profile.json' +import PROFILE_KR from '@translate/korea/setting/profile.json' +import USERINFO_KR from '@translate/korea/userinfo.json' +import FOLLOWER_KR from '@translate/korea/setting/follower.json' +import FOLLOWING_KR from '@translate/korea/setting/following.json' import COMMON_KR from '@translate/korea/common.json' -const locale_korea = { +const locale_kr = { landing: LANDING_KR, signin: SIGNIN_KR, signup: SIGNUP_KR, @@ -32,16 +39,23 @@ const locale_korea = { event_analysis: EVENT_ANALYSIS_KR, event_analysis_detail: EVENT_ANALYSIS_DETAILS_KR, customer: CUSTOMER_KR, - payment: PAYMENT_KR, + transaction: TRANSACTION_KR, my_favourite: MY_FAVOURITE_KR, my_event: MY_EVENT_KR, trash_event: TRASH_EVENT_KR, create_event: CREATE_EVENT_KR, + my_expense: MY_EXPENSE_KR, + my_expense_detail: MY_EXPENSE_DETAILS_KR, + coupon: COUPON_KR, + my_ticket: MY_TICKET_KR, calendar: CALENDAR_KR, order: ORDER_KR, review: REVIEW_KR, profile: PROFILE_KR, + userinfo: USERINFO_KR, + follower: FOLLOWER_KR, + following: FOLLOWING_KR, common: COMMON_KR } -export default locale_korea +export default locale_kr diff --git a/src/i18n/locales/russia.ts b/src/i18n/locales/russia.ts index 239382b..136274a 100644 --- a/src/i18n/locales/russia.ts +++ b/src/i18n/locales/russia.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_RS from '@translate/russia/dashboard/overview-detail.json import EVENT_ANALYSIS_RS from '@translate/russia/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_RS from '@translate/russia/dashboard/event-analysis-detail.json' import CUSTOMER_RS from '@translate/russia/dashboard/customer.json' -import PAYMENT_RS from '@translate/russia/dashboard/payment.json' +import TRANSACTION_RS from '@translate/russia/dashboard/transaction.json' import MY_FAVOURITE_RS from '@translate/russia/events/my-favourite.json' import MY_EVENT_RS from '@translate/russia/events/my-event.json' import TRASH_EVENT_RS from '@translate/russia/events/trash-event.json' import CREATE_EVENT_RS from '@translate/russia/events/create-event.json' +import MY_EXPENSE_RS from '@translate/russia/events/my-expense.json' +import MY_EXPENSE_DETAILS_RS from '@translate/russia/events/my-expense-detail.json' +import COUPON_RS from '@translate/russia/coupon.json' +import MY_TICKET_RS from '@translate/russia/ticket.json' import CALENDAR_RS from '@translate/russia/calendar.json' import ORDER_RS from '@translate/russia/order.json' import REVIEW_RS from '@translate/russia/review.json' -import PROFILE_RS from '@translate/russia/profile.json' +import PROFILE_RS from '@translate/russia/setting/profile.json' +import USERINFO_RS from '@translate/russia/userinfo.json' +import FOLLOWER_RS from '@translate/russia/setting/follower.json' +import FOLLOWING_RS from '@translate/russia/setting/following.json' import COMMON_RS from '@translate/russia/common.json' -const locale_russia = { +const locale_rs = { landing: LANDING_RS, signin: SIGNIN_RS, signup: SIGNUP_RS, @@ -32,16 +39,23 @@ const locale_russia = { event_analysis: EVENT_ANALYSIS_RS, event_analysis_detail: EVENT_ANALYSIS_DETAILS_RS, customer: CUSTOMER_RS, - payment: PAYMENT_RS, + transaction: TRANSACTION_RS, my_favourite: MY_FAVOURITE_RS, my_event: MY_EVENT_RS, trash_event: TRASH_EVENT_RS, create_event: CREATE_EVENT_RS, + my_expense: MY_EXPENSE_RS, + my_expense_detail: MY_EXPENSE_DETAILS_RS, + coupon: COUPON_RS, + my_ticket: MY_TICKET_RS, calendar: CALENDAR_RS, order: ORDER_RS, review: REVIEW_RS, profile: PROFILE_RS, + userinfo: USERINFO_RS, + follower: FOLLOWER_RS, + following: FOLLOWING_RS, common: COMMON_RS } -export default locale_russia +export default locale_rs diff --git a/src/i18n/locales/spain.ts b/src/i18n/locales/spain.ts index 3ca9f68..a11e9e3 100644 --- a/src/i18n/locales/spain.ts +++ b/src/i18n/locales/spain.ts @@ -9,18 +9,25 @@ import OVERVIEW_DETAIL_SP from '@translate/spain/dashboard/overview-detail.json' import EVENT_ANALYSIS_SP from '@translate/spain/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_SP from '@translate/spain/dashboard/event-analysis-detail.json' import CUSTOMER_SP from '@translate/spain/dashboard/customer.json' -import PAYMENT_SP from '@translate/spain/dashboard/payment.json' +import TRANSACTION_SP from '@translate/spain/dashboard/transaction.json' import MY_FAVOURITE_SP from '@translate/spain/events/my-favourite.json' import MY_EVENT_SP from '@translate/spain/events/my-event.json' import TRASH_EVENT_SP from '@translate/spain/events/trash-event.json' import CREATE_EVENT_SP from '@translate/spain/events/create-event.json' +import MY_EXPENSE_SP from '@translate/spain/events/my-expense.json' +import MY_EXPENSE_DETAILS_SP from '@translate/spain/events/my-expense-detail.json' +import COUPON_SP from '@translate/spain/coupon.json' +import MY_TICKET_SP from '@translate/spain/ticket.json' import CALENDAR_SP from '@translate/spain/calendar.json' import ORDER_SP from '@translate/spain/order.json' import REVIEW_SP from '@translate/spain/review.json' -import PROFILE_SP from '@translate/spain/profile.json' +import PROFILE_SP from '@translate/spain/setting/profile.json' +import USERINFO_SP from '@translate/spain/userinfo.json' +import FOLLOWER_SP from '@translate/spain/setting/follower.json' +import FOLLOWING_SP from '@translate/spain/setting/following.json' import COMMON_SP from '@translate/spain/common.json' -const locale_spain = { +const locale_sp = { landing: LANDING_SP, signin: SIGNIN_SP, signup: SIGNUP_SP, @@ -32,16 +39,23 @@ const locale_spain = { event_analysis: EVENT_ANALYSIS_SP, event_analysis_detail: EVENT_ANALYSIS_DETAILS_SP, customer: CUSTOMER_SP, - payment: PAYMENT_SP, + transaction: TRANSACTION_SP, my_favourite: MY_FAVOURITE_SP, my_event: MY_EVENT_SP, trash_event: TRASH_EVENT_SP, create_event: CREATE_EVENT_SP, + my_expense: MY_EXPENSE_SP, + my_expense_detail: MY_EXPENSE_DETAILS_SP, + coupon: COUPON_SP, + my_ticket: MY_TICKET_SP, calendar: CALENDAR_SP, order: ORDER_SP, review: REVIEW_SP, profile: PROFILE_SP, + userinfo: USERINFO_SP, + follower: FOLLOWER_SP, + following: FOLLOWING_SP, common: COMMON_SP } -export default locale_spain +export default locale_sp diff --git a/src/i18n/locales/vietnam.ts b/src/i18n/locales/vietnam.ts index fce2760..324854f 100644 --- a/src/i18n/locales/vietnam.ts +++ b/src/i18n/locales/vietnam.ts @@ -9,15 +9,22 @@ import OVERVIEW_DETAIL_VN from '@translate/vietnam/dashboard/overview-detail.jso import EVENT_ANALYSIS_VN from '@translate/vietnam/dashboard/event-analysis.json' import EVENT_ANALYSIS_DETAILS_VN from '@translate/vietnam/dashboard/event-analysis-detail.json' import CUSTOMER_VN from '@translate/vietnam/dashboard/customer.json' -import PAYMENT_VN from '@translate/vietnam/dashboard/payment.json' +import TRANSACTION_VN from '@translate/vietnam/dashboard/transaction.json' import MY_FAVOURITE_VN from '@translate/vietnam/events/my-favourite.json' import MY_EVENT_VN from '@translate/vietnam/events/my-event.json' import TRASH_EVENT_VN from '@translate/vietnam/events/trash-event.json' import CREATE_EVENT_VN from '@translate/vietnam/events/create-event.json' +import MY_EXPENSE_VN from '@translate/vietnam/events/my-expense.json' +import MY_EXPENSE_DETAILS_VN from '@translate/vietnam/events/my-expense-detail.json' +import COUPON_VN from '@translate/vietnam/coupon.json' +import MY_TICKET_VN from '@translate/vietnam/ticket.json' import CALENDAR_VN from '@translate/vietnam/calendar.json' import ORDER_VN from '@translate/vietnam/order.json' import REVIEW_VN from '@translate/vietnam/review.json' -import PROFILE_VN from '@translate/vietnam/profile.json' +import PROFILE_VN from '@translate/vietnam/setting/profile.json' +import USERINFO_VN from '@translate/vietnam/userinfo.json' +import FOLLOWER_VN from '@translate/vietnam/setting/follower.json' +import FOLLOWING_VN from '@translate/vietnam/setting/following.json' import COMMON_VN from '@translate/vietnam/common.json' const locale_vietnam = { @@ -32,15 +39,22 @@ const locale_vietnam = { event_analysis: EVENT_ANALYSIS_VN, event_analysis_detail: EVENT_ANALYSIS_DETAILS_VN, customer: CUSTOMER_VN, - payment: PAYMENT_VN, + transaction: TRANSACTION_VN, my_favourite: MY_FAVOURITE_VN, my_event: MY_EVENT_VN, trash_event: TRASH_EVENT_VN, create_event: CREATE_EVENT_VN, + my_expense: MY_EXPENSE_VN, + my_expense_detail: MY_EXPENSE_DETAILS_VN, + coupon: COUPON_VN, + my_ticket: MY_TICKET_VN, calendar: CALENDAR_VN, order: ORDER_VN, review: REVIEW_VN, profile: PROFILE_VN, + userinfo: USERINFO_VN, + follower: FOLLOWER_VN, + following: FOLLOWING_VN, common: COMMON_VN } diff --git a/src/interfaces/contents/category.interface.ts b/src/interfaces/contents/category.interface.ts index c45e831..673ba72 100644 --- a/src/interfaces/contents/category.interface.ts +++ b/src/interfaces/contents/category.interface.ts @@ -1,5 +1,5 @@ export interface ICategory { - id?: string + id: string name: string iconImageUrl: string color: string diff --git a/src/interfaces/contents/conversation.interface.ts b/src/interfaces/contents/conversation.interface.ts deleted file mode 100644 index 5591cc0..0000000 --- a/src/interfaces/contents/conversation.interface.ts +++ /dev/null @@ -1,41 +0,0 @@ -export interface IConversation { - id: string - event: Event - organizer?: User - user: User - lastMessage: LastMessage - createdAt: string - updatedAt: string -} - -interface Event { - id: string - name: string - coverImageUrl: string -} - -interface User { - id: string - email: string - fullName: string - userName: string - avatarUrl: string -} - -interface LastMessage { - senderId: string - receiverId: string - content: string - createdAt: string - updatedAt: string - deletedAt: string -} - -export interface IMessage { - id: string - senderId: string - receiverId: string - content: string - createdAt: string - updatedAt: string -} diff --git a/src/interfaces/contents/creator.interface.ts b/src/interfaces/contents/creator.interface.ts deleted file mode 100644 index 787d0e1..0000000 --- a/src/interfaces/contents/creator.interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { EGender } from '@constants/enum.constant' - -export interface ICreator { - id?: string - avatar: string - userName: string - email: string - fullName: string - phoneNumber: string - dob: Date - gender: EGender -} diff --git a/src/interfaces/contents/email.interface.ts b/src/interfaces/contents/email.interface.ts index e2ab00a..0279758 100644 --- a/src/interfaces/contents/email.interface.ts +++ b/src/interfaces/contents/email.interface.ts @@ -1,18 +1,5 @@ -export interface IEmailAttachment { - id?: string - emailContentId: string - attachmentFileName: string - AttachmentUrl: string - content: string - attachmentUrl: string - isDeleted: boolean - deletedAt: Date - createdAt: Date - updatedAt: Date -} - export interface IEmailContent { - id?: string + id: string eventId: string content: string isDeleted: boolean @@ -21,11 +8,13 @@ export interface IEmailContent { updatedAt: Date } -export interface IEmailLogger { - id?: string +export interface IEmailAttachment { + id: string emailContentId: string - sendEmail: string - receiveEmail: string + attachmentFileName: string + AttachmentUrl: string + content: string + attachmentUrl: string isDeleted: boolean deletedAt: Date createdAt: Date diff --git a/src/interfaces/contents/event.interface.ts b/src/interfaces/contents/event.interface.ts index e1f3da8..3a755d3 100644 --- a/src/interfaces/contents/event.interface.ts +++ b/src/interfaces/contents/event.interface.ts @@ -44,6 +44,7 @@ export interface ISubImage { export interface ICardEvent { id: string + categories: ICategory[] coverImageUrl: string name: string startTime: string diff --git a/src/interfaces/contents/index.ts b/src/interfaces/contents/index.ts index ed793c4..b676d05 100644 --- a/src/interfaces/contents/index.ts +++ b/src/interfaces/contents/index.ts @@ -1,8 +1,9 @@ export * from './category.interface' -export * from './creator.interface' +export * from './coupon.interface' export * from './email.interface' +export * from './expense.interface' export * from './event.interface' -export * from './location.interface' export * from './payment.interface' export * from './review.interface' +export * from './ticket.interface' export * from './ticketType.interface' diff --git a/src/interfaces/contents/location.interface.ts b/src/interfaces/contents/location.interface.ts deleted file mode 100644 index c3a6ddc..0000000 --- a/src/interfaces/contents/location.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ILocation { - id?: string - name: string - longitudeX: number - latitudeY: number -} diff --git a/src/interfaces/contents/payment.interface.ts b/src/interfaces/contents/payment.interface.ts index f99c94e..5c09baf 100644 --- a/src/interfaces/contents/payment.interface.ts +++ b/src/interfaces/contents/payment.interface.ts @@ -49,3 +49,36 @@ export interface IPaymentMethod { } paymentAccountNumber: string } + +export interface IPaymentTransaction { + id: string + event: { + name: string + coverImageUrl: string + } + customerName: string + ticketQuantity: number + totalPrice: number + discountPrice: number + finalPrice: number + status: EPaymentStatus + createdAt: string +} + +export interface IPaymentOrder { + id: string + event: { + name: string + coverImageUrl: string + creator: { + userName: string + avatarUrl: string + } + } + ticketQuantity: number + totalPrice: number + discountPrice: number + finalPrice: number + status: EPaymentStatus + createdAt: string +} diff --git a/src/interfaces/contents/ticket.interface.ts b/src/interfaces/contents/ticket.interface.ts new file mode 100644 index 0000000..6093262 --- /dev/null +++ b/src/interfaces/contents/ticket.interface.ts @@ -0,0 +1,21 @@ +export interface ITicket { + id: string + ticketNo: string + customerName: string + customerEmail: string + customerPhone: string + event: IEvent + ticketType: ITicketType +} + +interface IEvent { + id: string + name: string + coverImageUrl: string +} + +interface ITicketType { + id: string + name: string + price: number +} diff --git a/src/interfaces/systems/function.interface.ts b/src/interfaces/systems/function.interface.ts deleted file mode 100644 index a978c9f..0000000 --- a/src/interfaces/systems/function.interface.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface IFunction { - id?: string - name: string - url: string - sortOrder: number - parentId?: string | null - isDeleted: boolean - deletedAt: Date - createdAt: Date - updatedAt: Date -} diff --git a/src/interfaces/systems/index.ts b/src/interfaces/systems/index.ts index d0996dd..2a8b27a 100644 --- a/src/interfaces/systems/index.ts +++ b/src/interfaces/systems/index.ts @@ -1,6 +1,6 @@ export * from './auth.interface' -export * from './function.interface' -export * from './permission.interface' +export * from './invitation.interface' +export * from './notification.interface' export * from './price_range.interface' export * from './role.interface' export * from './user.interface' diff --git a/src/interfaces/systems/permission.interface.ts b/src/interfaces/systems/permission.interface.ts deleted file mode 100644 index c4877a4..0000000 --- a/src/interfaces/systems/permission.interface.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface IPermissionScreen { - id?: string - name: string - parentId: string - hasCreate: boolean - hasUpdate: boolean - hasDelete: boolean - hasView: boolean - hasApprove: boolean -} - -export interface IRolePermission { - id?: string - functionIds: string[] - functionNames: string[] - roleId: string - roleName: string -} diff --git a/src/interfaces/systems/user.interface.ts b/src/interfaces/systems/user.interface.ts index b777c68..f0cdb97 100644 --- a/src/interfaces/systems/user.interface.ts +++ b/src/interfaces/systems/user.interface.ts @@ -1,4 +1,5 @@ import { EGender } from '@constants/enum.constant' +import { IRole } from './role.interface' export interface IUser { id: string @@ -22,8 +23,3 @@ export interface IUserFollower { email: string userName: string } - -interface IRole { - id: string - name: string -} diff --git a/src/interfaces/websockets/conversation.interface.ts b/src/interfaces/websockets/conversation.interface.ts index 2b26a88..5591cc0 100644 --- a/src/interfaces/websockets/conversation.interface.ts +++ b/src/interfaces/websockets/conversation.interface.ts @@ -1,28 +1,41 @@ -export interface Conversation { - id?: string - eventId: string - event: ConversationEvent - hostId: string - userId: string - user: ConversationUser - lastMessage?: ConversationLastMessage - isDeleted: boolean - deletedAt: Date - createdAt: Date - updatedAt: Date +export interface IConversation { + id: string + event: Event + organizer?: User + user: User + lastMessage: LastMessage + createdAt: string + updatedAt: string } -export interface ConversationEvent { +interface Event { + id: string name: string - coverImage: string + coverImageUrl: string } -export interface ConversationUser { +interface User { + id: string + email: string fullName: string - avatar: string + userName: string + avatarUrl: string } -export interface ConversationLastMessage { +interface LastMessage { + senderId: string + receiverId: string content: string + createdAt: string + updatedAt: string + deletedAt: string +} + +export interface IMessage { + id: string senderId: string + receiverId: string + content: string + createdAt: string + updatedAt: string } diff --git a/src/interfaces/websockets/index.interface.ts b/src/interfaces/websockets/index.interface.ts index 8fa8582..0e178a8 100644 --- a/src/interfaces/websockets/index.interface.ts +++ b/src/interfaces/websockets/index.interface.ts @@ -1,3 +1,2 @@ export * from './conversation.interface' -export * from './message.interface' export * from './user_connection.interface' diff --git a/src/interfaces/websockets/message.interface.ts b/src/interfaces/websockets/message.interface.ts deleted file mode 100644 index 2f45266..0000000 --- a/src/interfaces/websockets/message.interface.ts +++ /dev/null @@ -1,45 +0,0 @@ -export enum EEnumMessageType { - TEXT = 'TEXT', - AUDIO = 'AUDIO', - IMAGE = 'IMAGE' -} - -export interface IMessage { - id?: string - userId: string - eventId: string - conversationId: string - content: string - audioFileName: string - audioUrl: string - imageFileName: string - imageUrl: string - videoFileName: string - videoUrl: string - isDeleted: boolean - deletedAt: Date - createdAt: Date - updatedAt: Date -} - -export const initMessage = { - type: EEnumMessageType.TEXT -} - -export interface JoinChatRoomParams { - eventId: string - hostId: string - userId: string -} - -export interface SendMessageParams { - userId: string - conversationId: string - content?: string - imageId?: string - imageUrl?: string - videoId?: string - videoUrl?: string - audioId?: string - audioUrl?: string -} diff --git a/src/layouts/chat.tsx b/src/layouts/chat.tsx index fed1330..b2c56d3 100644 --- a/src/layouts/chat.tsx +++ b/src/layouts/chat.tsx @@ -22,10 +22,15 @@ import { useAppSelector } from '@hooks/useRedux' import { useGetMessageByConversationIdQuery } from '@redux/apis/conversation.api' //interface -import { IMessage } from '@interfaces/contents/conversation.interface' +import { IMessage } from '@interfaces/websockets/conversation.interface' import { IUser } from '@interfaces/systems' -const ChatLayout = ({ children }: PropsWithChildren) => { +//i18n +import { withTranslation, WithTranslation } from 'react-i18next' + +interface ModalMessageProps extends PropsWithChildren, WithTranslation {} + +const ChatLayout = ({ children, t }: ModalMessageProps) => { const loadMoreIntersect = useRef(null) const messagesCtrRef = useRef(null) const [openLiveChat, setOpenLiveChat] = useState(false) @@ -49,14 +54,14 @@ const ChatLayout = ({ children }: PropsWithChildren) => { <> {!user && (
-
Please login to chat
+
{t('box_message.right.login_to_chat')}
)} {!conversation && user && (
-
Please select conversation to see messages
+
{t('box_message.right.select_conversation')}
)} @@ -72,7 +77,7 @@ const ChatLayout = ({ children }: PropsWithChildren) => {
{data && data.items?.length === 0 && (
-
No messages found
+
{t('box_message.right.no_message')}
)} {data && data.items?.length > 0 && ( @@ -101,4 +106,4 @@ const ChatLayout = ({ children }: PropsWithChildren) => { ) } -export default ChatLayout +export default withTranslation('common')(ChatLayout) diff --git a/src/layouts/components/ModalMessage.tsx b/src/layouts/components/ModalMessage.tsx index 0272bf2..dc1a2a1 100644 --- a/src/layouts/components/ModalMessage.tsx +++ b/src/layouts/components/ModalMessage.tsx @@ -16,9 +16,14 @@ import { useGetConversationsByUserIdQuery } from '@redux/apis/conversation.api' import { useGetConversationsByOrganizerIdQuery } from '@redux/apis/conversation.api' //interface -import { IConversation } from '@interfaces/contents/conversation.interface' +import { IConversation } from '@interfaces/websockets/conversation.interface' -const ModalMessage = ({ children }: PropsWithChildren) => { +//i18n +import { withTranslation, WithTranslation } from 'react-i18next' + +interface ModalMessageProps extends PropsWithChildren, WithTranslation {} + +const ModalMessage = ({ children, t }: ModalMessageProps) => { const [tabActive, setTabActive] = useState('Event') const userId: string = useAppSelector((state) => state.persistedReducer.user.user?.id) @@ -39,7 +44,7 @@ const ModalMessage = ({ children }: PropsWithChildren) => {
- My Conversation + {t('box_message.left.title')}
@@ -62,7 +67,7 @@ const ModalMessage = ({ children }: PropsWithChildren) => { onKeyUp={(e: any) => { setSearch(e.target.value) }} - placeholder='Search conversation' + placeholder={t('box_message.left.placeholder')} className='w-full' />
@@ -100,4 +105,4 @@ const ModalMessage = ({ children }: PropsWithChildren) => { ) } -export default ModalMessage +export default withTranslation('common')(ModalMessage) diff --git a/src/layouts/components/appbar/AppBar.tsx b/src/layouts/components/appbar/AppBar.tsx index 1b138ab..1fe09d1 100644 --- a/src/layouts/components/appbar/AppBar.tsx +++ b/src/layouts/components/appbar/AppBar.tsx @@ -13,6 +13,8 @@ import Search from '@ui/Search' import ModalBase from '@ui/ModalBase' import NotificationsPanel from '../navbar/NotificationsPanel' import SelectLanguage from '@components/SelectLanguage' +import ToggleDarkLight from './switch/ToggleDarkLight' +import InvitationPanel from '../navbar/InvitationPanel' //constants import { LOCALES } from '@constants/options.constant' @@ -25,8 +27,6 @@ import useDefault from '@assets/images/common/user_default.png' //i18 import { useTranslation, withTranslation } from 'react-i18next' -import ToggleDarkLight from './switch/ToggleDarkLight' -import InvitationPanel from '../navbar/InvitationPanel' //interfaces import { IUser } from '@interfaces/systems' @@ -51,7 +51,6 @@ const AppBar = ({ t }: any) => { const activeLocale = LOCALES.find((l: any) => l.value === locale) const handleChangeLangue = (value: any) => { - console.log(value) setLocale(value) i18n.changeLanguage(value) localStorage.setItem('language', value) @@ -145,7 +144,7 @@ const AppBar = ({ t }: any) => { ) : ( )}
@@ -154,7 +153,7 @@ const AppBar = ({ t }: any) => { {width < 768 && ( setSearchModalOpen(false)}>
-

Search

+

{t('header.search')}

diff --git a/src/layouts/components/navbar/InvitationItem.tsx b/src/layouts/components/navbar/InvitationItem.tsx index e2bd2af..f653a71 100644 --- a/src/layouts/components/navbar/InvitationItem.tsx +++ b/src/layouts/components/navbar/InvitationItem.tsx @@ -22,7 +22,7 @@ interface Props { } const InvitationItem = (props: Props) => { - const { invitation, index, onView } = props + const { t, invitation, index, onView } = props return ( @@ -31,7 +31,7 @@ const InvitationItem = (props: Props) => {
{invitation.inviter.fullName} -

Mời bạn thích sự kiện

+

{t('invitation.favourite_text')}

{dayjs(invitation.createdAt).fromNow()} @@ -44,7 +44,7 @@ const InvitationItem = (props: Props) => { onView(invitation.event.id) }} > - View + {t('invitation.view_event')}

diff --git a/src/layouts/components/navbar/InvitationPanel.tsx b/src/layouts/components/navbar/InvitationPanel.tsx index c5bb706..0a3ccfe 100644 --- a/src/layouts/components/navbar/InvitationPanel.tsx +++ b/src/layouts/components/navbar/InvitationPanel.tsx @@ -73,7 +73,7 @@ const InvitationsPanel = (props: Props) => { onClick={handleLoadMore} disabled={data?.items.length === data?.metadata.totalCount} > - Load More + {t('invitation.load_more')}
diff --git a/src/layouts/components/navbar/NotificationItem.tsx b/src/layouts/components/navbar/NotificationItem.tsx index 1e05345..ce21772 100644 --- a/src/layouts/components/navbar/NotificationItem.tsx +++ b/src/layouts/components/navbar/NotificationItem.tsx @@ -21,7 +21,7 @@ interface Props { } const NotificationItem = (props: Props) => { - const { notification, index, onView } = props + const { t, notification, index, onView } = props return ( @@ -31,7 +31,7 @@ const NotificationItem = (props: Props) => {
{notification.follower.fullName}

- {notification.follower.userName} đã theo dõi bạn + {notification.follower.userName} {t('notification.follow_text')}

{dayjs(notification.createdAt).fromNow()} @@ -39,7 +39,7 @@ const NotificationItem = (props: Props) => {

diff --git a/src/layouts/components/navbar/NotificationsPanel.tsx b/src/layouts/components/navbar/NotificationsPanel.tsx index 20d1906..1191b5c 100644 --- a/src/layouts/components/navbar/NotificationsPanel.tsx +++ b/src/layouts/components/navbar/NotificationsPanel.tsx @@ -104,7 +104,7 @@ const NotificationsPanel = (props: Props) => { onClick={handleLoadMore} disabled={notification_followings?.items.length === notification_followings?.metadata.totalCount} > - Load More + {t('notification.load_more')}
diff --git a/src/pages/common/Modify-Create-Event.tsx b/src/pages/common/Modify-Create-Event.tsx index 82a2610..3120074 100644 --- a/src/pages/common/Modify-Create-Event.tsx +++ b/src/pages/common/Modify-Create-Event.tsx @@ -42,8 +42,6 @@ import createdSampleData from '@data/created_sample' //interface import { IUser } from '@interfaces/systems' -const CREATE_STEP = ['Information', 'Banner Image', 'Set Ticket', 'Review'] - interface Props { t: any title: string @@ -54,6 +52,8 @@ interface Props { const ModifyEvent = (props: Props) => { const { t, title, create, event } = props + const CREATE_STEP = [t('step.information'), t('step.banner'), t('step.ticket'), t('step.review')] + const user: IUser = useAppSelector((state) => state.persistedReducer.user.user) const [createEvent, { isLoading: loadingCreateEvent }] = useCreateEventMutation() diff --git a/src/pages/common/UserInfo.tsx b/src/pages/common/UserInfo.tsx index b6c3a56..8cac548 100644 --- a/src/pages/common/UserInfo.tsx +++ b/src/pages/common/UserInfo.tsx @@ -16,13 +16,13 @@ import { withTranslation } from 'react-i18next' //redux import { useGetUserByIdQuery } from '@redux/apis/user.api' -const UserInfo = () => { +const UserInfo = ({ t }: any) => { const params = useParams() const { data } = useGetUserByIdQuery(params.id!) return ( - +
@@ -41,4 +41,4 @@ const UserInfo = () => { ) } -export default withTranslation('profile')(UserInfo) +export default withTranslation('userinfo')(UserInfo) diff --git a/src/pages/coupon/Coupon.tsx b/src/pages/coupon/Coupon.tsx index f19963a..0d67046 100644 --- a/src/pages/coupon/Coupon.tsx +++ b/src/pages/coupon/Coupon.tsx @@ -3,13 +3,16 @@ import ProtectedLayout from '@layouts/protected' import PageHeader from '@layouts/components/PageHeader' import CouponsGrid from '@widgets/CouponsGrid' -const Coupon = () => { +//i18n +import { withTranslation } from 'react-i18next' + +const Coupon = ({ t }: any) => { return ( - + ) } -export default Coupon +export default withTranslation('coupon')(Coupon) diff --git a/src/pages/coupon/CouponEvent.tsx b/src/pages/coupon/CouponEvent.tsx deleted file mode 100644 index 46b6184..0000000 --- a/src/pages/coupon/CouponEvent.tsx +++ /dev/null @@ -1,12 +0,0 @@ -//component -import ProtectedLayout from '@layouts/protected' - -const CouponEvent = () => { - return ( - -
Coupon Event
-
- ) -} - -export default CouponEvent diff --git a/src/pages/coupon/components/ModalCreate.tsx b/src/pages/coupon/components/ModalCreate.tsx index be8e377..aa5cd17 100644 --- a/src/pages/coupon/components/ModalCreate.tsx +++ b/src/pages/coupon/components/ModalCreate.tsx @@ -20,7 +20,11 @@ import { useAppSelector } from '@hooks/useRedux' //util import dayjs from 'dayjs' +//18n +import { withTranslation } from 'react-i18next' + interface IProps { + t: any modalOpen: boolean setModalOpen: (value: boolean) => void onCreate: (data: ICreateCouponPayload) => void @@ -28,7 +32,7 @@ interface IProps { } const ModalCreateCoupon = (props: IProps) => { - const { modalOpen, setModalOpen, onCreate, isLoading } = props + const { t, modalOpen, setModalOpen, onCreate, isLoading } = props const userId: string = useAppSelector((state) => state.persistedReducer.user.user?.id) @@ -64,7 +68,7 @@ const ModalCreateCoupon = (props: IProps) => { > -
Create Coupon
+
{t('modal.create_coupon')}
{