Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
d1597302
Commit
d1597302
authored
Oct 31, 2025
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix/home pag
parent
5ffab2ff
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
452 deletions
+181
-452
page.tsx
src/app/(main)/home/page.tsx
+181
-181
page.tsx
src/app/(main)/page.tsx
+0
-0
page.tsx
src/app/page.tsx
+0
-271
No files found.
src/app/(main)/home/page.tsx
View file @
d1597302
...
...
@@ -24,29 +24,29 @@ const Home = () => {
const
swiperRef
=
useRef
<
SwiperType
|
null
>
(
null
)
// server
//
const { data: categoryData } = useGetCategory<GetCategoryAdminResponseType>();
//
const { data: allData, isLoading } = useGetNews<GetNewsResponseType>({
//
pageSize: '999',
//
filters: submitSearch ? `title @=${submitSearch}` : undefined,
//
})
const
{
data
:
categoryData
}
=
useGetCategory
<
GetCategoryAdminResponseType
>
();
const
{
data
:
allData
,
isLoading
}
=
useGetNews
<
GetNewsResponseType
>
({
pageSize
:
'999'
,
filters
:
submitSearch
?
`title @=
${
submitSearch
}
`
:
undefined
,
})
//tab filter
//
let data
//
if (tab === 'all') {
//
data = allData
//
} else {
//
//
fillter by category
//
const filteredRows = allData?.responseData?.rows?.filter(
//
(news) => news.category === tab
//
)
//
data = {
//
...allData,
//
responseData: {
//
...allData?.responseData,
//
rows: filteredRows ?? []
//
}
//
}
//
}
let
data
if
(
tab
===
'all'
)
{
data
=
allData
}
else
{
// fillter by category
const
filteredRows
=
allData
?.
responseData
?.
rows
?.
filter
(
(
news
)
=>
news
.
category
===
tab
)
data
=
{
...
allData
,
responseData
:
{
...
allData
?.
responseData
,
rows
:
filteredRows
??
[]
}
}
}
// update slidesPerView on resize to match the Swiper breakpoints
useEffect
(()
=>
{
...
...
@@ -112,7 +112,7 @@ const Home = () => {
setCurrentIndex
(
typeof
swiper
.
realIndex
===
'number'
?
swiper
.
realIndex
:
swiper
.
activeIndex
)
}
}
>
{
/*
{allData?.responseData.rows.map((news) => (
{
allData
?.
responseData
.
rows
.
map
((
news
)
=>
(
<
SwiperSlide
key=
{
news
.
id
}
>
<
a
href=
{
`/tin-tuc/${news.id}`
}
className=
'block bg-white shadow-md overflow-hidden relative'
>
<
AppImage
...
...
@@ -134,7 +134,7 @@ const Home = () => {
</
div
>
</
a
>
</
SwiperSlide
>
))} */
}
))
}
<
SwiperSlide
>
<
a
href=
{
`#`
}
className=
'block bg-white shadow-md overflow-hidden relative'
>
...
...
@@ -201,11 +201,11 @@ const Home = () => {
{
/* News list */
}
<
div
className=
'pb-5 overflow-hidden'
>
{
/*
{data?.responseData.rows.slice(0, 5).map((news) => (
{
data
?.
responseData
.
rows
.
slice
(
0
,
5
).
map
((
news
)
=>
(
<
NewsContent
key=
{
news
.
id
}
news=
{
news
}
/>
))} */
}
))
}
{
/*
<div className='w-full flex justify-center mt-4'>
<
div
className=
'w-full flex justify-center mt-4'
>
<
AppPagination
page=
{
Math
.
floor
(
currentIndex
/
Math
.
max
(
slidesPerView
,
1
))
+
1
}
count=
{
Math
.
ceil
((
data
?.
responseData
.
rows
?.
length
??
0
)
/
Math
.
max
(
slidesPerView
,
1
))
}
...
...
@@ -214,7 +214,7 @@ const Home = () => {
swiperRef
.
current
?.
slideTo
(
toIndex
)
}
}
/>
</div>
*/
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/app/(main)/page.tsx
deleted
100644 → 0
View file @
5ffab2ff
src/app/page.tsx
deleted
100644 → 0
View file @
5ffab2ff
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment