Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppUms_Lecturer
Overview
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
tungnq
AppUms_Lecturer
Commits
dfac4b31
Commit
dfac4b31
authored
Aug 13, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Đã fix giao diện thành search thành công
parent
fd33b466
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
17 deletions
+66
-17
index.js
src/screens/notification/index.js
+20
-2
style.js
src/screens/notification/style.js
+7
-2
view.js
src/screens/notification/view.js
+39
-13
No files found.
src/screens/notification/index.js
View file @
dfac4b31
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
,
useMemo
}
from
'react'
;
import
{
Text
,
View
,
StyleSheet
}
from
'react-native'
;
import
NotificationView
from
'./view'
;
...
...
@@ -107,13 +107,31 @@ const Notification = (props) => {
setSearchText
(
text
);
};
const
fitlerSearch
=
useMemo
(()
=>
{
const
list
=
dataNotifi
[
activeTab
]
||
[];
if
(
!
searchText
.
trim
())
return
list
;
const
searchLower
=
searchText
.
toLowerCase
();
return
list
.
filter
(
item
=>
{
if
(
item
.
title_notifi
)
{
return
item
.
title_notifi
.
toLowerCase
().
includes
(
searchLower
)
}
if
(
item
.
title_notifi_tuition
)
{
return
item
.
title_notifi_tuition
.
toLowerCase
().
includes
(
searchLower
)
}
return
false
;
});
},
[
dataNotifi
,
activeTab
,
searchText
])
return
(
<
NotificationView
dataTitleListTabView
=
{
dataListTabView
}
activeTab
=
{
activeTab
}
onTabChange
=
{
handleTabChange
}
dataNotifi
=
{
dataNotifi
}
dataNotifi
=
{
{[
activeTab
]:
fitlerSearch
}
}
getEmptyMessage
=
{
getEmptyMessage
}
searchText
=
{
searchText
}
onSearchChange
=
{
handleSearchChange
}
...
...
src/screens/notification/style.js
View file @
dfac4b31
...
...
@@ -46,8 +46,6 @@ const styles = StyleSheet.create({
backgroundColor
:
R
.
colors
.
white
,
flexDirection
:
'row'
,
maxHeight
:
41
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
boxIconSearch
:{
maxWidth
:
35
,
...
...
@@ -62,6 +60,13 @@ const styles = StyleSheet.create({
fontWeight
:
'500'
,
flex
:
1
,
},
// boxSearch:{
// position:'relative',
// top:0,
// right:0,
// left:0,
// },
//List Notification
containerListNotification
:{
paddingVertical
:
15
,
...
...
src/screens/notification/view.js
View file @
dfac4b31
...
...
@@ -31,7 +31,7 @@ const NotificationView = props => {
}
};
//Xử lý màu trạng thái khi ở tab view
const
getStatusColor
=
(
status
)
=>
{
const
getStatusColor
=
status
=>
{
switch
(
status
)
{
case
'Đã gửi'
:
return
R
.
colors
.
green
||
'#4CAF50'
;
...
...
@@ -72,7 +72,7 @@ const NotificationView = props => {
<
View
style
=
{
styles
.
boxIconSearch
}
>
<
Image
source
=
{
R
.
images
.
icSearchHeader
}
maxWidth
=
{
Platform
.
OS
===
'ios'
?
16
:
20
}
maxWidth
=
{
Platform
.
OS
===
'ios'
?
16
:
20
}
maxHeight
=
{
Platform
.
OS
===
'ios'
?
16
:
20
}
resizeMode
=
"contain"
tintColor
=
{
R
.
colors
.
gray
}
...
...
@@ -93,10 +93,16 @@ const NotificationView = props => {
const
renderNotificationItemView
=
({
item
})
=>
{
return
(
<
View
style
=
{
styles
.
cardItem
}
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
item
.
title_notifi
}
<
/Text
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
2
}
ellipsizeMode
=
"tail"
>
{
item
.
message
}
<
/Text
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
item
.
title_notifi
}
<
/Text
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
2
}
ellipsizeMode
=
"tail"
>
{
item
.
message
}
<
/Text
>
<
View
style
=
{
styles
.
boxTimeView
}
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
item
.
time
}
<
/Text
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
item
.
time
}
<
/Text
>
<
/View
>
<
/View
>
);
...
...
@@ -123,18 +129,24 @@ const NotificationView = props => {
{
item
.
time_send
}
<
/Text
>
<
View
style
=
{
styles
.
sizedBox
}
><
/View
>
<
Text
style
=
{[
styles
.
text
,
{
color
:
statusColor
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
<
Text
style
=
{[
styles
.
text
,
{
color
:
statusColor
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
item
.
status
}
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
text
}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
<
Text
style
=
{
styles
.
text
}
>
Lo
ạ
i
th
ô
ng
b
á
o
:
<
/Text
>
{
item
.
style
}
<
/Text
>
{
item
.
style
}
<
/Text
>
<
/View
>
<
Image
source
=
{
R
.
images
.
icNext
}
resizeMode
=
"contain"
style
=
{{
width
:
10
,
height
:
15
,
alignSelf
:
'center'
}}
/
>
<
Image
source
=
{
R
.
images
.
icNext
}
resizeMode
=
"contain"
style
=
{{
width
:
10
,
height
:
15
,
alignSelf
:
'center'
}}
/
>
<
/TouchableOpacity
>
);
};
...
...
@@ -163,13 +175,27 @@ const NotificationView = props => {
return
(
<
View
style
=
{
styles
.
safeArea
}
>
<
Header
title
=
{
'Thông báo'
}
/
>
<
View
>
{
renderListTabView
()}
{
renderSearchBox
()}
<
/View
>
<
View
style
=
{
styles
.
containerBody
}
>
{(
dataNotifi
[
activeTab
]
&&
dataNotifi
[
activeTab
].
length
>
0
)
&&
renderSearchBox
()}
{
dataNotifi
[
activeTab
].
length
===
0
?
renderItemEmpty
():
renderListNotification
()}
{
/* {(dataNotifi[activeTab] && dataNotifi[activeTab].length > 0) && renderSearchBox()} */
}
{
dataNotifi
[
activeTab
].
length
===
0
?
renderItemEmpty
()
:
renderListNotification
()}
<
/View
>
<
View
style
=
{
styles
.
containerFooter
}
>
<
TouchableOpacity
style
=
{
styles
.
btnFooter
}
onPress
=
{()
=>
navigate
.
navigate
(
SCREENNAME
.
PROFILE
)}
>
<
TouchableOpacity
style
=
{
styles
.
btnFooter
}
onPress
=
{()
=>
navigate
.
navigate
(
SCREENNAME
.
PROFILE
)}
>
<
Text
style
=
{
styles
.
textBtnFooter
}
>
T
ạ
o
th
ô
ng
b
á
o
m
ớ
i
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
...
...
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