Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppUms_Student
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_Student
Commits
09313f5f
Commit
09313f5f
authored
Sep 18, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Chuyển các hàm logic ở file view sang function
parent
10a23b76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
53 deletions
+53
-53
Functions.js
src/config/Functions.js
+12
-0
style.js
src/screens/class_schedule/style.js
+39
-40
view.js
src/screens/class_schedule/view.js
+2
-13
No files found.
src/config/Functions.js
View file @
09313f5f
...
@@ -601,3 +601,14 @@ export const getMimeType = fileExt => {
...
@@ -601,3 +601,14 @@ export const getMimeType = fileExt => {
return
'*/*'
;
return
'*/*'
;
}
}
};
};
export
const
monthNames
=
[
'Tháng 1'
,
'Tháng 2'
,
'Tháng 3'
,
'Tháng 4'
,
'Tháng 5'
,
'Tháng 6'
,
'Tháng 7'
,
'Tháng 8'
,
'Tháng 9'
,
'Tháng 10'
,
'Tháng 11'
,
'Tháng 12'
,
];
export
const
weekDays
=
[
'CN'
,
'T2'
,
'T3'
,
'T4'
,
'T5'
,
'T6'
,
'T7'
];
export
const
formatDateToString
=
(
date
)
=>
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
};
\ No newline at end of file
src/screens/class_schedule/style.js
View file @
09313f5f
...
@@ -22,8 +22,8 @@ const styles = StyleSheet.create({
...
@@ -22,8 +22,8 @@ const styles = StyleSheet.create({
paddingVertical
:
15
,
paddingVertical
:
15
,
},
},
header_title
:
{
header_title
:
{
fontSize
:
R
.
fontsize
.
fontsSize
Title
,
fontSize
:
R
.
fontsize
.
fontsSize
16
,
fontFamily
:
R
.
fonts
.
font
Medium
,
fontFamily
:
R
.
fonts
.
Inter
Medium
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
fontWeight
:
'600'
,
fontWeight
:
'600'
,
},
},
...
@@ -32,14 +32,13 @@ const styles = StyleSheet.create({
...
@@ -32,14 +32,13 @@ const styles = StyleSheet.create({
width
:
30
,
width
:
30
,
height
:
30
,
height
:
30
,
borderRadius
:
20
,
borderRadius
:
20
,
backgroundColor
:
R
.
colors
.
blue
,
backgroundColor
:
R
.
colors
.
blue
500
,
alignItems
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
},
navButtonText
:
{
navButtonText
:
{
color
:
R
.
colors
.
white
,
color
:
R
.
colors
.
white
,
fontSize
:
R
.
fontsize
.
fontsSize
Title
,
fontSize
:
R
.
fontsize
.
fontsSize
12
,
fontFamily
:
R
.
fonts
.
font
Medium
,
fontFamily
:
R
.
fonts
.
Inter
Medium
,
height
:
'100%'
,
height
:
'100%'
,
},
},
...
@@ -71,20 +70,20 @@ const styles = StyleSheet.create({
...
@@ -71,20 +70,20 @@ const styles = StyleSheet.create({
width
:
CELL_WIDTH
,
width
:
CELL_WIDTH
,
minHeight
:
CELL_HEIGHT
,
minHeight
:
CELL_HEIGHT
,
borderWidth
:
1
,
borderWidth
:
1
,
borderColor
:
R
.
colors
.
gray
BorderInputTextHeader
,
borderColor
:
R
.
colors
.
gray
220
,
padding
:
6
,
padding
:
6
,
alignItems
:
'center'
,
alignItems
:
'center'
,
},
},
// Ô ngày được chọn
// Ô ngày được chọn
selectedDayCell
:
{
selectedDayCell
:
{
borderColor
:
R
.
colors
.
blue
,
borderColor
:
R
.
colors
.
blue
500
,
borderWidth
:
1
,
borderWidth
:
1
,
},
},
// Text số ngày
// Text số ngày
dayText
:
{
dayText
:
{
fontSize
:
R
.
fontsize
.
font
SizeLabel
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
marginBottom
:
2
,
marginBottom
:
2
,
},
},
...
@@ -97,14 +96,14 @@ const styles = StyleSheet.create({
...
@@ -97,14 +96,14 @@ const styles = StyleSheet.create({
selectedDayText
:
{
selectedDayText
:
{
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
fontWeight
:
'500'
,
fontWeight
:
'500'
,
fontFamily
:
R
.
fonts
.
font
SemiBold
,
fontFamily
:
R
.
fonts
.
Inter
SemiBold
,
},
},
// Text ngày hôm nay
// Text ngày hôm nay
todayText
:
{
todayText
:
{
color
:
R
.
colors
.
white
,
color
:
R
.
colors
.
white
,
fontWeight
:
'
bold
'
,
fontWeight
:
'
500
'
,
fontFamily
:
R
.
fonts
.
font
SemiBold
,
fontFamily
:
R
.
fonts
.
Inter
SemiBold
,
backgroundColor
:
R
.
colors
.
blue
,
backgroundColor
:
R
.
colors
.
blue
500
,
borderRadius
:
15
,
borderRadius
:
15
,
paddingHorizontal
:
6
,
paddingHorizontal
:
6
,
paddingVertical
:
4
,
paddingVertical
:
4
,
...
@@ -121,27 +120,27 @@ const styles = StyleSheet.create({
...
@@ -121,27 +120,27 @@ const styles = StyleSheet.create({
paddingHorizontal
:
5
,
paddingHorizontal
:
5
,
borderRadius
:
10
,
borderRadius
:
10
,
marginBottom
:
2
,
marginBottom
:
2
,
backgroundColor
:
R
.
colors
.
blue
,
backgroundColor
:
R
.
colors
.
blue
500
,
},
},
eventBarText
:
{
eventBarText
:
{
fontSize
:
R
.
fontsize
.
font
SizeLabel
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
color
:
R
.
colors
.
white
,
color
:
R
.
colors
.
white
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
},
},
// Text hiển thị số sự kiện còn lại
// Text hiển thị số sự kiện còn lại
moreEventsText
:
{
moreEventsText
:
{
fontSize
:
R
.
fontsize
.
font
SizeLabel
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
color
:
R
.
colors
.
gray
,
color
:
R
.
colors
.
gray
200
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
textAlign
:
'center'
,
textAlign
:
'center'
,
},
},
// Modal bottom sheet
// Modal bottom sheet
modalBackdrop
:
{
modalBackdrop
:
{
flex
:
1
,
flex
:
1
,
backgroundColor
:
R
.
colors
.
gray
BorderInputTextHeader
,
backgroundColor
:
R
.
colors
.
gray
220
,
justifyContent
:
'flex-end'
,
justifyContent
:
'flex-end'
,
},
},
bottomSheet
:
{
bottomSheet
:
{
...
@@ -159,7 +158,7 @@ const styles = StyleSheet.create({
...
@@ -159,7 +158,7 @@ const styles = StyleSheet.create({
dragHandle
:
{
dragHandle
:
{
width
:
40
,
width
:
40
,
height
:
4
,
height
:
4
,
backgroundColor
:
R
.
colors
.
gray
,
backgroundColor
:
R
.
colors
.
gray
150
,
borderRadius
:
5
,
borderRadius
:
5
,
alignSelf
:
'center'
,
alignSelf
:
'center'
,
marginTop
:
10
,
marginTop
:
10
,
...
@@ -173,8 +172,8 @@ const styles = StyleSheet.create({
...
@@ -173,8 +172,8 @@ const styles = StyleSheet.create({
paddingHorizontal
:
15
,
paddingHorizontal
:
15
,
},
},
bottomSheetTitle
:
{
bottomSheetTitle
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontFamily
:
R
.
fonts
.
font
Medium
,
fontFamily
:
R
.
fonts
.
Inter
Medium
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
fontWeight
:
'600'
,
fontWeight
:
'600'
,
flex
:
1
,
flex
:
1
,
...
@@ -184,14 +183,14 @@ const styles = StyleSheet.create({
...
@@ -184,14 +183,14 @@ const styles = StyleSheet.create({
width
:
30
,
width
:
30
,
height
:
30
,
height
:
30
,
borderRadius
:
15
,
borderRadius
:
15
,
backgroundColor
:
R
.
colors
.
gray
,
backgroundColor
:
R
.
colors
.
gray
200
,
alignItems
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
},
},
closeButtonText
:
{
closeButtonText
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
},
},
...
@@ -213,9 +212,9 @@ const styles = StyleSheet.create({
...
@@ -213,9 +212,9 @@ const styles = StyleSheet.create({
paddingVertical
:
40
,
paddingVertical
:
40
,
},
},
noEventsText
:
{
noEventsText
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
color
:
R
.
colors
.
gray
,
color
:
R
.
colors
.
gray
200
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
},
},
...
@@ -228,8 +227,8 @@ const styles = StyleSheet.create({
...
@@ -228,8 +227,8 @@ const styles = StyleSheet.create({
marginBottom
:
10
,
marginBottom
:
10
,
marginHorizontal
:
15
,
marginHorizontal
:
15
,
borderLeftWidth
:
4
,
borderLeftWidth
:
4
,
borderLeftColor
:
R
.
colors
.
blue
,
borderLeftColor
:
R
.
colors
.
blue
500
,
shadowColor
:
R
.
colors
.
black
,
shadowColor
:
R
.
colors
.
black
250
,
shadowOffset
:
{
shadowOffset
:
{
width
:
0
,
width
:
0
,
height
:
2
,
height
:
2
,
...
@@ -246,9 +245,9 @@ const styles = StyleSheet.create({
...
@@ -246,9 +245,9 @@ const styles = StyleSheet.create({
marginRight
:
15
,
marginRight
:
15
,
},
},
eventTime
:
{
eventTime
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontFamily
:
R
.
fonts
.
font
Medium
,
fontFamily
:
R
.
fonts
.
Inter
Medium
,
color
:
R
.
colors
.
blue
,
color
:
R
.
colors
.
blue
500
,
fontWeight
:
'600'
,
fontWeight
:
'600'
,
},
},
// Container nội dung sự kiện
// Container nội dung sự kiện
...
@@ -256,16 +255,16 @@ const styles = StyleSheet.create({
...
@@ -256,16 +255,16 @@ const styles = StyleSheet.create({
flex
:
1
,
flex
:
1
,
},
},
eventTitle
:
{
eventTitle
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontFamily
:
R
.
fonts
.
fontMedium
,
fontFamily
:
R
.
fonts
.
InterRegular
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
fontWeight
:
'600'
,
fontWeight
:
'600'
,
marginBottom
:
4
,
marginBottom
:
4
,
},
},
eventDescription
:
{
eventDescription
:
{
fontSize
:
R
.
fontsize
.
font
SizeContent
,
fontSize
:
R
.
fontsize
.
font
sSize12
,
fontFamily
:
R
.
fonts
.
font
Regular
,
fontFamily
:
R
.
fonts
.
Inter
Regular
,
color
:
R
.
colors
.
gray2
,
color
:
R
.
colors
.
gray2
00
,
fontWeight
:
'400'
,
fontWeight
:
'400'
,
},
},
});
});
...
...
src/screens/class_schedule/view.js
View file @
09313f5f
...
@@ -13,6 +13,7 @@ import R from '../../assets/R';
...
@@ -13,6 +13,7 @@ import R from '../../assets/R';
import
{
styles
,
CELL_WIDTH
,
BOTTOM_SHEET_HEIGHT
}
from
'./style'
;
import
{
styles
,
CELL_WIDTH
,
BOTTOM_SHEET_HEIGHT
}
from
'./style'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
*
as
SCREENNAME
from
'../../routers/ScreenNames'
;
import
*
as
SCREENNAME
from
'../../routers/ScreenNames'
;
import
{
monthNames
,
weekDays
,
formatDateToString
}
from
'../../config/Functions'
;
LogBox
.
ignoreAllLogs
(
LogBox
.
ignoreAllLogs
(
true
true
);
);
...
@@ -36,11 +37,6 @@ const ClassScheduleView = ({
...
@@ -36,11 +37,6 @@ const ClassScheduleView = ({
})
=>
{
})
=>
{
const
navigation
=
useNavigation
();
const
navigation
=
useNavigation
();
const
renderHeader
=
()
=>
{
const
renderHeader
=
()
=>
{
const
monthNames
=
[
'Tháng 1'
,
'Tháng 2'
,
'Tháng 3'
,
'Tháng 4'
,
'Tháng 5'
,
'Tháng 6'
,
'Tháng 7'
,
'Tháng 8'
,
'Tháng 9'
,
'Tháng 10'
,
'Tháng 11'
,
'Tháng 12'
,
];
return
(
return
(
<
View
style
=
{
styles
.
header
}
>
<
View
style
=
{
styles
.
header
}
>
<
TouchableOpacity
<
TouchableOpacity
...
@@ -63,8 +59,6 @@ const ClassScheduleView = ({
...
@@ -63,8 +59,6 @@ const ClassScheduleView = ({
};
};
const
renderWeekDays
=
()
=>
{
const
renderWeekDays
=
()
=>
{
const
weekDays
=
[
'CN'
,
'T2'
,
'T3'
,
'T4'
,
'T5'
,
'T6'
,
'T7'
];
return
(
return
(
<
View
style
=
{
styles
.
weekDaysContainer
}
>
<
View
style
=
{
styles
.
weekDaysContainer
}
>
{
weekDays
.
map
((
day
,
index
)
=>
(
{
weekDays
.
map
((
day
,
index
)
=>
(
...
@@ -127,12 +121,7 @@ const ClassScheduleView = ({
...
@@ -127,12 +121,7 @@ const ClassScheduleView = ({
);
);
};
};
const
formatDateToString
=
(
date
)
=>
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
};
const
renderCalendarGrid
=
()
=>
{
const
renderCalendarGrid
=
()
=>
{
...
...
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