File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55}
66
77.todo {
8- @apply bg-teal -100 p-2 rounded-md border border-teal -300 mt-4;
8+ @apply bg-blue -100 p-2 rounded-md border border-blue -300 mt-4 text-blue-800 ;
99}
Original file line number Diff line number Diff line change 11export default {
22 currency : 'USD' ,
3- submitBtn : 'Submit ' ,
4- cancelBtn : 'Cancel ' ,
3+ loadTodos : 'Load Todos ' ,
4+ loadTodosSuccess : 'Todos loaded successfully! ' ,
55} ;
Original file line number Diff line number Diff line change 11export default {
22 currency : 'VND' ,
3- submitBtn : 'Xác nhận ' ,
4- cancelBtn : 'Hủy ' ,
3+ loadTodos : 'Tải danh sách công việc ' ,
4+ loadTodosSuccess : 'Tải danh sách công việc thành công! ' ,
55} ;
Original file line number Diff line number Diff line change 1+ import i18n from '@/helpers/i18n' ;
12import { useListTodos } from '@/services/hooks/todo/use-list-todos' ;
23import type { TodoDto } from '@/types/dto/todo.dto' ;
34import { createFileRoute } from '@tanstack/react-router' ;
4- import { Button , Row } from 'antd' ;
5+ import { Button , Col , Row } from 'antd' ;
56import { useState } from 'react' ;
67
78export const Route = createFileRoute ( '/' ) ( {
@@ -17,10 +18,17 @@ function RouteComponent() {
1718 } ;
1819
1920 return (
20- < Row className = "p-4" >
21- < Button onClick = { handleClick } variant = "solid" color = "primary" >
22- { isLoading ? 'Loading...' : 'Load Todos' }
23- </ Button >
21+ < Col className = "p-4" >
22+ < Row >
23+ < Button
24+ onClick = { handleClick }
25+ variant = "solid"
26+ color = "primary"
27+ loading = { isLoading }
28+ >
29+ { i18n . t ( 'common:loadTodos' ) }
30+ </ Button >
31+ </ Row >
2432 { data && (
2533 < Row className = "todo" >
2634 { error && < p > { error . message } </ p > }
@@ -29,6 +37,6 @@ function RouteComponent() {
2937 } ) }
3038 </ Row >
3139 ) }
32- </ Row >
40+ </ Col >
3341 ) ;
3442}
Original file line number Diff line number Diff line change 11import api from '@/helpers/axios-instance' ;
2+ import i18n from '@/helpers/i18n' ;
23import { endpoints } from '@/services/endpoints' ;
34import { useToast } from '@/services/hooks/common/use-toast' ;
45import type { TodoDto } from '@/types/dto/todo.dto' ;
@@ -16,7 +17,7 @@ export const useListTodos = (enabled: boolean) => {
1617
1718 useEffect ( ( ) => {
1819 if ( isSuccess ) {
19- toast . success ( 'Todos loaded successfully' ) ;
20+ toast . success ( i18n . t ( 'common:loadTodosSuccess' ) ) ;
2021 }
2122 } , [ isSuccess , toast ] ) ;
2223
You can’t perform that action at this time.
0 commit comments