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
322e9ca4
Commit
322e9ca4
authored
Aug 13, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO:Đã fix màn hình home
parent
2982ac00
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
29 deletions
+16
-29
Header.js
src/components/Header/Header.js
+6
-2
header.js
src/screens/home/header.js
+2
-0
view.js
src/screens/home/view.js
+8
-27
No files found.
src/components/Header/Header.js
View file @
322e9ca4
...
...
@@ -25,10 +25,11 @@ const Header = props => {
const
{
title
,
isBack
}
=
props
;
const
navigate
=
useNavigation
();
return
(
<
SafeAreaView
>
<
SafeAreaView
style
=
{
styles
.
safeArea
}
>
<
StatusBar
barStyle
=
"light-content"
backgroundColor
=
{
R
.
colors
.
blue500
}
backgroundColor
=
"transparent"
translucent
=
{
true
}
/
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
Text
numberOfLines
=
{
1
}
style
=
{
styles
.
txtTitle
}
>
...
...
@@ -49,6 +50,9 @@ const Header = props => {
export
default
Header
;
const
styles
=
StyleSheet
.
create
({
safeArea
:{
backgroundColor
:
R
.
colors
.
blue
,
},
headerContainer
:
{
height
:
HEIGHT
(
45
),
width
:
'100%'
,
...
...
src/screens/home/header.js
View file @
322e9ca4
...
...
@@ -12,6 +12,8 @@ const HeaderHome = (props) => {
<
SafeAreaView
style
=
{
styles
.
containerBoxHeader
}
>
<
StatusBar
barStyle
=
"light-content"
backgroundColor
=
"transparent"
translucent
=
{
true
}
/
>
<
View
style
=
{
styles
.
boxLogo
}
>
<
Image
...
...
src/screens/home/view.js
View file @
322e9ca4
...
...
@@ -10,8 +10,8 @@ import {
Keyboard
,
SafeAreaView
,
Image
,
StatusBar
,
// FEATURE: Thêm StatusBar để control status bar
Platform
,
// FEATURE: Check platform để xử lý khác biệt iOS/Android
StatusBar
,
Platform
,
}
from
"react-native"
;
import
HeaderCus
from
"../home/header"
;
import
R
from
"../../assets/R"
;
...
...
@@ -33,17 +33,14 @@ const HomeView = (props) => {
}
=
props
;
const
navigate
=
useNavigation
();
// FUNCTIONALITY: Render menu item với tối ưu performance
const
renderMenuItem
=
({
item
})
=>
{
return
<
ItemGrid
item
=
{
item
}
onPress
=
{()
=>
onMenuItemPress
(
item
)}
/>
;
};
// UI/UX: Card thông tin user với layout tối ưu
const
cardItemInfo
=
()
=>
{
return
(
<
View
style
=
{
styles
.
profileCard
}
>
<
View
style
=
{
styles
.
profile_left
}
>
{
/* FEATURE: Avatar với fallback placeholder */
}
<
View
style
=
{
styles
.
avatar
}
>
{
userProfile
?.
avatar
?
(
<
Image
...
...
@@ -60,7 +57,6 @@ const HomeView = (props) => {
)}
<
/View
>
{
/* FEATURE: Thông tin user với null safety */
}
<
View
style
=
{
styles
.
information
}
>
<
Text
style
=
{
styles
.
text_card_info
}
...
...
@@ -79,7 +75,6 @@ const HomeView = (props) => {
<
/View
>
<
/View
>
{
/* FEATURE: Button navigate tới profile */
}
<
TouchableOpacity
style
=
{
styles
.
profile_btn
}
onPress
=
{()
=>
navigate
.
navigate
(
SCREENNAME
.
PROFILE
)}
...
...
@@ -89,7 +84,7 @@ const HomeView = (props) => {
<
View
style
=
{
styles
.
iconNext
}
>
<
Image
source
=
{
R
.
images
.
icNext
}
style
=
{{
width
:
5
,
height
:
10
}}
// OPTIMIZE: Dùng style thay maxWidth/maxHeight
style
=
{{
width
:
5
,
height
:
10
}}
/
>
<
/View
>
<
/TouchableOpacity
>
...
...
@@ -97,7 +92,6 @@ const HomeView = (props) => {
);
};
// FUNCTIONALITY: Render menu activity với FlatList tối ưu
const
renderMenuActivity
=
()
=>
{
return
(
<
View
style
=
{
styles
.
menu_container
}
>
...
...
@@ -110,14 +104,13 @@ const HomeView = (props) => {
scrollEnabled
=
{
false
}
columnWrapperStyle
=
{
styles
.
row
}
ListEmptyComponent
=
{
renderItemEmpty
}
removeClippedSubviews
=
{
true
}
// PERFORMANCE: Tối ưu memory
maxToRenderPerBatch
=
{
9
}
// PERFORMANCE: Render tối đa 9 items/batch
removeClippedSubviews
=
{
true
}
maxToRenderPerBatch
=
{
9
}
/
>
<
/View
>
);
};
// FUNCTIONALITY: Render menu statistics
const
renderMenuStatistics
=
()
=>
{
return
(
<
View
style
=
{
styles
.
menu_container
}
>
...
...
@@ -137,7 +130,6 @@ const HomeView = (props) => {
);
};
// FUNCTIONALITY: Render menu notification
const
renderMenuNotification
=
()
=>
{
return
(
<
View
style
=
{
styles
.
menu_container
}
>
...
...
@@ -157,13 +149,12 @@ const HomeView = (props) => {
);
};
// UI/UX: Empty state component
const
renderItemEmpty
=
()
=>
{
return
(
<
View
style
=
{
styles
.
cardItemEmpty
}
>
<
Image
source
=
{
R
.
images
.
icNoData
}
style
=
{{
width
:
50
,
height
:
50
}}
// OPTIMIZE: Dùng style object
style
=
{{
width
:
50
,
height
:
50
}}
/
>
<
Text
style
=
{[
styles
.
menu_text
,
{
color
:
R
.
colors
.
red
}]}
>
Kh
ô
ng
c
ó
d
ữ
li
ệ
u
...
...
@@ -173,17 +164,8 @@ const HomeView = (props) => {
};
return
(
<>
{
/* FIXME: StatusBar để control màu status bar và remove white space */
}
<
StatusBar
barStyle
=
"light-content"
// Text trắng trên status bar
backgroundColor
=
"transparent"
// Background trong suốt
translucent
=
{
true
}
// Cho phép content hiển thị dưới status bar
/
>
<
View
style
=
{
styles
.
safeArea
}
>
<
TouchableWithoutFeedback
onPress
=
{
Keyboard
.
dismiss
}
accessible
=
{
false
}
>
{
/* FIXME: Dùng View thay SafeAreaView để loại bỏ white space */
}
<
View
style
=
{[
styles
.
safeArea
,
{
paddingTop
:
Platform
.
OS
===
'ios'
?
0
:
StatusBar
.
currentHeight
}]}
>
<
View
style
=
{
styles
.
container_body
}
>
<
ImageBackground
source
=
{
R
.
images
.
igBackground
}
...
...
@@ -210,9 +192,8 @@ const HomeView = (props) => {
{
renderMenuNotification
()}
<
/ScrollView
>
<
/View
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
/
>
<
/
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