Skip to content

Commit

Permalink
update translation
Browse files Browse the repository at this point in the history
  • Loading branch information
QuocAnh189 committed Dec 23, 2024
1 parent 3354464 commit d4d7d60
Show file tree
Hide file tree
Showing 408 changed files with 13,156 additions and 2,960 deletions.
24 changes: 11 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -94,7 +93,7 @@ function App() {
<Route path='/organization/dashboard/event-analysis' element={<EventAnalysis />} />
<Route path='/organization/dashboard/event-analysis/:id' element={<EventAnalysisDetail />} />
<Route path='/organization/dashboard/customer' element={<Customer />} />
<Route path='/organization/dashboard/payment' element={<Payment />} />
<Route path='/organization/dashboard/transaction' element={<Transaction />} />
<Route path='/organization/explore' element={<Explore />} />
<Route path='/organization/event/:id' element={<EventDetail />} />
<Route path='/organization/create-event' element={<CreateEvent />} />
Expand All @@ -105,7 +104,6 @@ function App() {
<Route path='/organization/my-expense' element={<MyExpense />} />
<Route path='/organization/my-expense/:id' element={<MyExpenseDetail />} />
<Route path='/organization/coupon' element={<Coupon />} />
<Route path='/organization/coupon/:id/events' element={<CouponEvent />} />
<Route path='/organization/ticket' element={<MyTicket />} />
<Route path='/organization/calendar' element={<Calendar />} />
<Route path='/organization/order' element={<Order />} />
Expand Down
5 changes: 3 additions & 2 deletions src/components/CalendarSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={`${wrapperClass || ''} flex flex-col gap-2.5 w-full`}>
<label className='h5 w-fit' htmlFor={id}>
{label}:
</label>
<RangeDatePicker id={id} />
<RangeDatePicker onChange={onChange} id={id} />
</div>
)
}
Expand Down
21 changes: 9 additions & 12 deletions src/components/ColumnExpense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>('')
const [price, setPrice] = useState<number>(0)
Expand All @@ -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()
Expand Down Expand Up @@ -77,11 +78,7 @@ const ColumnExpense = (props: IProps) => {
}

return (
<Spring
type='fade-up'
index={index}
className='min-w-[400px] h-auto bg-[#ebecf0] ml-2 rounded-6 h-fit-content rounded-xl'
>
<Spring type='fade-up' index={index} className='min-w-[400px] h-auto bg-[#ebecf0] ml-2 rounded-6 rounded-xl'>
<div className='flex h-[50px] p-4 items-center justify-between'>
<div className='flex items-center gap-2'>
<h5 className='h5 text-primary'>{expense.title}</h5>
Expand Down Expand Up @@ -117,7 +114,7 @@ const ColumnExpense = (props: IProps) => {
onClick={toggleOpenNewCardForm}
>
<AddCardIcon />
Add new Sub Expense
{t('add_new_sub_expense')}
</button>
</div>
) : (
Expand All @@ -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')}
/>
<input
className={classNames('field-input', { 'field-input--error': false })}
Expand Down Expand Up @@ -162,4 +159,4 @@ const ColumnExpense = (props: IProps) => {
)
}

export default ColumnExpense
export default withTranslation('my_expense_detail')(ColumnExpense)
20 changes: 12 additions & 8 deletions src/components/CouponCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(false)
const [modalOpen, setModalOpen] = useState<boolean>(false)
Expand All @@ -41,7 +45,7 @@ const CouponCard = (props: Props) => {
<TruncatedText text={coupon.name} width={titleWidth} lines={2} />
</h6>
</div>
<div className='flex items-center justify-center bg-primary-600 w-12 h-12 rounded-full'>
<div className='flex items-center justify-center bg-green w-12 h-12 rounded-full'>
<p className='text-white font-bold'>{coupon.percentageValue}%</p>
</div>
</div>
Expand All @@ -50,10 +54,10 @@ const CouponCard = (props: Props) => {
</p>
<div className='flex items-center justify-between'>
<button className='text-btn' onClick={() => setModalOpen(true)}>
View Edit
{t('card.view_edit')}
</button>
<button onClick={() => setOpenDialog(true)} className='text-btn text-error'>
Delete
{t('card.delete')}
</button>
</div>
</Spring>
Expand All @@ -78,4 +82,4 @@ const CouponCard = (props: Props) => {
)
}

export default CouponCard
export default withTranslation('coupon')(CouponCard)
28 changes: 16 additions & 12 deletions src/components/FormToChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
<div className='flex px-[100px] gap-8'>
<div className='flex flex-col flex-auto gap-5 p-8 rounded-md shadow-xl bg-body'>
<h1 className='text-2xl font-bold text-header'>Conversation</h1>
<p className='text-header'>
If you have any questions or problems related to this event.
<h1 className='text-2xl font-bold text-header'>{t('conversation.title')}</h1>
<p className='h6 text-header'>
{t('conversation.description_one')}
<br />
Do not hesitate to contact me.
{t('conversation.description_two')}
</p>
<div className='flex flex-col gap-3'>
<div className='flex items-center gap-4 text-header'>
<div className='field-wrapper'>
<label className='field-label' htmlFor='qty'>
Name
{t('conversation.name_label')}
</label>
<input
readOnly
Expand All @@ -46,7 +50,7 @@ const FormToChat = (props: Props) => {
</div>
<div className='field-wrapper'>
<label className='field-label' htmlFor='qty'>
Email
{t('conversation.email_label')}
</label>
<input
readOnly
Expand All @@ -59,7 +63,7 @@ const FormToChat = (props: Props) => {
</div>
<div className='field-wrapper'>
<label className='field-label' htmlFor='qty'>
Event
{t('conversation.event_label')}
</label>
<input readOnly className={classNames('field-input')} id='qty' value={eventName} />
</div>
Expand All @@ -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')}
</button>
</div>
</div>
)
}

export default FormToChat
export default withTranslation('event_detail')(FormToChat)
22 changes: 0 additions & 22 deletions src/components/NotData.tsx

This file was deleted.

Loading

0 comments on commit d4d7d60

Please sign in to comment.