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
baecb1a1
Commit
baecb1a1
authored
Oct 31, 2025
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix/routing home page
parent
d1597302
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
page.tsx
src/app/(main)/(home)/page.tsx
+25
-25
layout.tsx
src/app/(main)/layout.tsx
+0
-0
favicon.ico
src/app/favicon.ico
+0
-0
globals.css
src/app/globals.css
+0
-0
No files found.
src/app/(main)/
home
/page.tsx
→
src/app/(main)/
(home)
/page.tsx
View file @
baecb1a1
...
@@ -24,29 +24,29 @@ const Home = () => {
...
@@ -24,29 +24,29 @@ const Home = () => {
const
swiperRef
=
useRef
<
SwiperType
|
null
>
(
null
)
const
swiperRef
=
useRef
<
SwiperType
|
null
>
(
null
)
// server
// server
const
{
data
:
categoryData
}
=
useGetCategory
<
GetCategoryAdminResponseType
>
();
//
const { data: categoryData } = useGetCategory<GetCategoryAdminResponseType>();
const
{
data
:
allData
,
isLoading
}
=
useGetNews
<
GetNewsResponseType
>
({
//
const { data: allData, isLoading } = useGetNews<GetNewsResponseType>({
pageSize
:
'999'
,
//
pageSize: '999',
filters
:
submitSearch
?
`title @=
${
submitSearch
}
`
:
undefined
,
//
filters: submitSearch ? `title @=${submitSearch}` : undefined,
})
//
})
//tab filter
//tab filter
let
data
//
let data
if
(
tab
===
'all'
)
{
//
if (tab === 'all') {
data
=
allData
//
data = allData
}
else
{
//
} else {
// fillter by category
//
// fillter by category
const
filteredRows
=
allData
?.
responseData
?.
rows
?.
filter
(
//
const filteredRows = allData?.responseData?.rows?.filter(
(
news
)
=>
news
.
category
===
tab
//
(news) => news.category === tab
)
//
)
data
=
{
//
data = {
...
allData
,
//
...allData,
responseData
:
{
//
responseData: {
...
allData
?.
responseData
,
//
...allData?.responseData,
rows
:
filteredRows
??
[]
//
rows: filteredRows ?? []
}
//
}
}
//
}
}
//
}
// update slidesPerView on resize to match the Swiper breakpoints
// update slidesPerView on resize to match the Swiper breakpoints
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -112,7 +112,7 @@ const Home = () => {
...
@@ -112,7 +112,7 @@ const Home = () => {
setCurrentIndex
(
typeof
swiper
.
realIndex
===
'number'
?
swiper
.
realIndex
:
swiper
.
activeIndex
)
setCurrentIndex
(
typeof
swiper
.
realIndex
===
'number'
?
swiper
.
realIndex
:
swiper
.
activeIndex
)
}
}
}
}
>
>
{
allData
?.
responseData
.
rows
.
map
((
news
)
=>
(
{
/* {
allData?.responseData.rows.map((news) => (
<SwiperSlide key={news.id}>
<SwiperSlide key={news.id}>
<a href={`/tin-tuc/${news.id}`} className='block bg-white shadow-md overflow-hidden relative'>
<a href={`/tin-tuc/${news.id}`} className='block bg-white shadow-md overflow-hidden relative'>
<AppImage
<AppImage
...
@@ -134,7 +134,7 @@ const Home = () => {
...
@@ -134,7 +134,7 @@ const Home = () => {
</div>
</div>
</a>
</a>
</SwiperSlide>
</SwiperSlide>
))
}
))}
*/
}
<
SwiperSlide
>
<
SwiperSlide
>
<
a
href=
{
`#`
}
className=
'block bg-white shadow-md overflow-hidden relative'
>
<
a
href=
{
`#`
}
className=
'block bg-white shadow-md overflow-hidden relative'
>
...
@@ -200,7 +200,7 @@ const Home = () => {
...
@@ -200,7 +200,7 @@ const Home = () => {
</
div
>
</
div
>
{
/* News list */
}
{
/* News list */
}
<
div
className=
'pb-5 overflow-hidden'
>
{
/*
<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} />
<NewsContent key={news.id} news={news} />
))}
))}
...
@@ -215,7 +215,7 @@ const Home = () => {
...
@@ -215,7 +215,7 @@ const Home = () => {
}}
}}
/>
/>
</div>
</div>
</
div
>
</div>
*/
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/app/(main)/layout.tsx
deleted
100644 → 0
View file @
d1597302
src/app/favicon.ico
deleted
100644 → 0
View file @
d1597302
25.3 KB
src/app/globals.css
deleted
100644 → 0
View file @
d1597302
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