Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
thecybernanny-webapp
Project
Overview
Details
Activity
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
asranov0003
thecybernanny-webapp
Commits
a7c21989
Commit
a7c21989
authored
Jul 31, 2025
by
asranov0003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: news
parent
a513873f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
News.css
src/pages/News/News.css
+4
-0
News.tsx
src/pages/News/News.tsx
+8
-0
No files found.
src/pages/News/News.css
View file @
a7c21989
...
...
@@ -2,6 +2,10 @@
padding-top
:
60px
;
}
.news__title
{
margin-bottom
:
1rem
;
}
.news__list
{
display
:
flex
;
flex-direction
:
column
;
...
...
src/pages/News/News.tsx
View file @
a7c21989
...
...
@@ -7,12 +7,14 @@ import {
type
RootState
,
}
from
"../../stores/store"
;
import
{
fetchAllNews
}
from
"../../stores/slices/newsSlice"
;
import
{
useTranslation
}
from
"react-i18next"
;
const
News
:
React
.
FC
=
()
=>
{
const
{
news
,
isNewsLoading
}
=
useAppSelector
(
(
state
:
RootState
)
=>
state
.
news
);
const
dispatch
=
useAppDispatch
();
const
{
t
}
=
useTranslation
();
useEffect
(()
=>
{
dispatch
(
fetchAllNews
());
...
...
@@ -20,12 +22,18 @@ const News: React.FC = () => {
return
(
<
div
className=
"news wrapper"
>
<
h3
className=
"news__title"
>
{
t
(
"navs.news"
)
}
</
h3
>
{
isNewsLoading
&&
news
.
length
===
0
&&
(
<
div
className=
"cloading__center"
>
<
CLoading
/>
</
div
>
)
}
{
!
isNewsLoading
&&
news
.
length
===
0
&&
(
<
p
className=
"news__empty"
>
{
t
(
"common.noData"
)
}
</
p
>
)
}
<
div
className=
"news__list"
>
{
news
.
map
((
item
)
=>
{
return
(
...
...
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