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
c36ba5e8
Commit
c36ba5e8
authored
Aug 28, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Đã hoàn thiện xong giao diện modal
parent
7fea3f07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
3 deletions
+152
-3
style.js
src/screens/incoming_document/detail/style.js
+89
-1
view.js
src/screens/incoming_document/detail/view.js
+63
-2
No files found.
src/screens/incoming_document/detail/style.js
View file @
c36ba5e8
...
@@ -74,7 +74,95 @@ const styles = StyleSheet.create({
...
@@ -74,7 +74,95 @@ const styles = StyleSheet.create({
backgroundColor
:
R
.
colors
.
blue1
,
backgroundColor
:
R
.
colors
.
blue1
,
padding
:
10
,
padding
:
10
,
width
:
300
width
:
300
}
},
//MODAL
modalOverlay
:
{
flex
:
1
,
backgroundColor
:
'rgba(0, 0, 0, 0.5)'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
},
modalContainer
:
{
backgroundColor
:
'white'
,
borderRadius
:
10
,
width
:
'90%'
,
maxHeight
:
'80%'
,
},
modalHeader
:
{
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
padding
:
10
,
},
modalTitle
:
{
fontSize
:
R
.
fontsize
.
fontsSizeTitle
,
fontWeight
:
'600'
,
fontFamily
:
R
.
fonts
.
fontMedium
,
color
:
R
.
colors
.
blue
,
},
closeButton
:
{
width
:
30
,
height
:
30
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
},
closeButtonText
:
{
fontSize
:
R
.
fontsize
.
fontSizeContent
,
color
:
R
.
colors
.
gray
,
fontWeight
:
'bold'
,
},
modalBody
:
{
paddingHorizontal
:
15
},
inputLabel
:
{
fontSize
:
R
.
fontsize
.
fontSizeSubTitle
,
color
:
R
.
colors
.
black
,
marginBottom
:
3
,
fontWeight
:
'400'
,
fontFamily
:
R
.
fonts
.
fontRegular
,
},
textInput
:
{
borderWidth
:
1
,
borderColor
:
R
.
colors
.
grayBorderInputTextHeader
,
borderRadius
:
8
,
padding
:
12
,
fontSize
:
R
.
fontsize
.
fontSizeContent
,
color
:
R
.
colors
.
black
,
minHeight
:
120
,
textAlignVertical
:
'top'
,
},
modalFooter
:
{
flexDirection
:
'row'
,
justifyContent
:
'flex-end'
,
padding
:
15
,
},
button
:
{
paddingHorizontal
:
20
,
paddingVertical
:
3
,
borderRadius
:
30
,
width
:
110
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
cancelButton
:
{
backgroundColor
:
R
.
colors
.
orange
,
marginRight
:
10
,
},
cancelButtonText
:
{
color
:
R
.
colors
.
white
,
fontSize
:
R
.
fontsize
.
fontSizeContent
,
fontFamily
:
R
.
fonts
.
fontRegular
,
fontWeight
:
'400'
,
},
submitButton
:
{
backgroundColor
:
R
.
colors
.
blue
,
},
submitButtonText
:
{
color
:
'white'
,
fontSize
:
R
.
fontsize
.
fontSizeContent
,
fontFamily
:
R
.
fonts
.
fontRegular
,
fontWeight
:
'400'
,
},
})
})
...
...
src/screens/incoming_document/detail/view.js
View file @
c36ba5e8
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
import
{
Text
,
Text
,
View
,
View
,
...
@@ -8,6 +8,8 @@ import {
...
@@ -8,6 +8,8 @@ import {
ScrollView
,
ScrollView
,
FlatList
,
FlatList
,
Alert
,
Alert
,
Modal
,
TextInput
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
styles
from
'./style'
;
import
styles
from
'./style'
;
...
@@ -17,6 +19,8 @@ import FAB from '../../../components/FAB/fab';
...
@@ -17,6 +19,8 @@ import FAB from '../../../components/FAB/fab';
import
SubButton
from
'../../../components/FAB/sub_button'
;
import
SubButton
from
'../../../components/FAB/sub_button'
;
const
DetailIncomingDocumentView
=
props
=>
{
const
DetailIncomingDocumentView
=
props
=>
{
const
{
icomingDocument
}
=
props
;
const
{
icomingDocument
}
=
props
;
const
[
showModal
,
setShowModal
]
=
useState
(
false
);
const
[
annotationContent
,
setAnnotationContent
]
=
useState
(
''
);
console
.
log
(
props
);
console
.
log
(
props
);
const
getColor
=
status
=>
{
const
getColor
=
status
=>
{
switch
(
status
)
{
switch
(
status
)
{
...
@@ -26,6 +30,60 @@ const DetailIncomingDocumentView = props => {
...
@@ -26,6 +30,60 @@ const DetailIncomingDocumentView = props => {
return
R
.
colors
.
blue
;
return
R
.
colors
.
blue
;
}
}
};
};
const
handleAddAnnotation
=
()
=>
{
if
(
annotationContent
.
trim
())
{
// Here you would typically call an API to save the annotation
Alert
.
alert
(
'Thành công'
,
'Đã thêm bút phê thành công!'
);
setAnnotationContent
(
''
);
setShowModal
(
false
);
}
else
{
Alert
.
alert
(
'Lỗi'
,
'Vui lòng nhập nội dung bút phê!'
);
}
};
const
openModal
=
()
=>
{
return
(
<
Modal
animationType
=
"slide"
transparent
=
{
true
}
visible
=
{
showModal
}
onRequestClose
=
{()
=>
setShowModal
(
false
)}
>
<
View
style
=
{
styles
.
modalOverlay
}
>
<
View
style
=
{
styles
.
modalContainer
}
>
<
View
style
=
{
styles
.
modalHeader
}
>
<
Text
style
=
{
styles
.
modalTitle
}
>
Th
ê
m
b
ú
t
ph
ê
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
modalBody
}
>
<
Text
style
=
{
styles
.
inputLabel
}
>
B
ú
t
ph
ê
<
/Text
>
<
TextInput
style
=
{
styles
.
textInput
}
placeholder
=
"Nhập nội dung bút phê..."
placeholderTextColor
=
{
R
.
colors
.
gray
}
multiline
=
{
true
}
numberOfLines
=
{
3
}
textAlignVertical
=
"top"
value
=
{
annotationContent
}
onChangeText
=
{
setAnnotationContent
}
/
>
<
/View
>
<
View
style
=
{
styles
.
modalFooter
}
>
<
TouchableOpacity
style
=
{[
styles
.
button
,
styles
.
cancelButton
]}
onPress
=
{()
=>
setShowModal
(
false
)}
>
<
Text
style
=
{
styles
.
cancelButtonText
}
>
H
ủ
y
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{[
styles
.
button
,
styles
.
submitButton
]}
onPress
=
{
handleAddAnnotation
}
>
<
Text
style
=
{
styles
.
submitButtonText
}
>
Th
ê
m
m
ớ
i
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
)
}
const
renderItem
=
({
item
})
=>
{
const
renderItem
=
({
item
})
=>
{
console
.
log
(
item
);
console
.
log
(
item
);
return
(
return
(
...
@@ -232,7 +290,7 @@ const DetailIncomingDocumentView = props => {
...
@@ -232,7 +290,7 @@ const DetailIncomingDocumentView = props => {
<
View
style
=
{{
marginHorizontal
:
15
}}
>
<
View
style
=
{{
marginHorizontal
:
15
}}
>
<
FAB
>
<
FAB
>
<
SubButton
<
SubButton
onPress
=
{()
=>
Alert
.
alert
(
'Pressed 1!'
)}
onPress
=
{()
=>
setShowModal
(
true
)}
label
=
"Thêm bút phê"
label
=
"Thêm bút phê"
images
=
{
R
.
images
.
icEdit
}
images
=
{
R
.
images
.
icEdit
}
backgroundColor
=
{
R
.
colors
.
orange
}
backgroundColor
=
{
R
.
colors
.
orange
}
...
@@ -246,8 +304,11 @@ const DetailIncomingDocumentView = props => {
...
@@ -246,8 +304,11 @@ const DetailIncomingDocumentView = props => {
<
/FAB
>
<
/FAB
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
{
openModal
()}
<
/View
>
<
/View
>
);
);
};
};
export
default
DetailIncomingDocumentView
;
export
default
DetailIncomingDocumentView
;
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