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
10bf147d
Commit
10bf147d
authored
Aug 29, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Đã hoàn thiện giao diện phần tạo văn bản đi
parent
fa64995b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
42 deletions
+99
-42
Dropdown.js
src/components/DropdownAlert/Dropdown.js
+78
-37
TextField.js
src/components/Input/TextField.js
+7
-2
TextMulti.js
src/components/Input/TextMulti.js
+7
-3
style.js
src/screens/list_send_document/status/style.js
+7
-0
view.js
src/screens/list_send_document/status/view.js
+0
-0
No files found.
src/components/DropdownAlert/Dropdown.js
View file @
10bf147d
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
import
{
View
,
View
,
Text
,
Text
,
TouchableOpacity
,
TouchableOpacity
,
StyleSheet
,
StyleSheet
,
FlatList
,
Image
,
Image
,
ScrollView
,
ScrollView
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
const
Dropdown
=
({
items
,
placeholder
=
'Chọn...'
,
onSelect
,
height
})
=>
{
const
Dropdown
=
({
items
=
[],
placeholder
=
'Chọn...'
,
onSelect
,
height
,
backgroundColor
,
// mới thêm
editable
=
true
,
disabledBackgroundColor
=
R
.
colors
.
blue1
,
disabledTextColor
=
'#999'
,
disabledIconColor
=
'#999'
,
})
=>
{
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
const
[
selected
,
setSelected
]
=
useState
(
null
);
const
[
selected
,
setSelected
]
=
useState
(
null
);
const
handleSelect
=
item
=>
{
const
headerHeight
=
height
??
35
;
useEffect
(()
=>
{
if
(
!
editable
&&
isOpen
)
setIsOpen
(
false
);
},
[
editable
,
isOpen
]);
const
handleToggle
=
()
=>
{
if
(
!
editable
)
return
;
setIsOpen
(
prev
=>
!
prev
);
};
const
handleSelect
=
(
item
)
=>
{
if
(
!
editable
)
return
;
setSelected
(
item
);
setSelected
(
item
);
setIsOpen
(
false
);
setIsOpen
(
false
);
if
(
onSelect
)
onSelect
(
item
);
onSelect
&&
onSelect
(
item
);
};
};
const
resolvedBg
=
editable
?
(
backgroundColor
||
'#fff'
)
:
disabledBackgroundColor
;
const
resolvedTextColor
=
editable
?
'#333'
:
disabledTextColor
;
const
resolvedIconTint
=
editable
?
'#333'
:
disabledIconColor
;
const
resolvedBorderColor
=
editable
?
R
.
colors
?.
grayBorderInputTextHeader
||
'#ccc'
:
'#ddd'
;
return
(
return
(
<
View
style
=
{
[
styles
.
container
]
}
>
<
View
style
=
{
styles
.
container
}
>
{
/*
Nút hiển thị
*/
}
{
/*
Header
*/
}
<
TouchableOpacity
<
TouchableOpacity
style
=
{[
styles
.
dropdownHeader
,{
height
:
height
}]}
activeOpacity
=
{
editable
?
0.7
:
1
}
onPress
=
{()
=>
setIsOpen
(
!
isOpen
)}
>
onPress
=
{
handleToggle
}
<
Text
style
=
{
styles
.
dropdownHeaderText
}
>
disabled
=
{
!
editable
}
style
=
{[
styles
.
dropdownHeader
,
{
height
:
headerHeight
,
backgroundColor
:
resolvedBg
,
borderColor
:
resolvedBorderColor
,
opacity
:
editable
?
1
:
0.8
,
},
]}
>
<
Text
style
=
{[
styles
.
dropdownHeaderText
,
{
color
:
resolvedTextColor
}]}
>
{
selected
?
selected
.
label
:
placeholder
}
{
selected
?
selected
.
label
:
placeholder
}
<
/Text
>
<
/Text
>
<
Image
source
=
{
R
.
images
.
icDrop
}
style
=
{
styles
.
imageIcon
}
/
>
<
Image
source
=
{
R
.
images
.
icDrop
}
style
=
{[
styles
.
imageIcon
,
{
tintColor
:
resolvedIconTint
}]}
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
{
/*
Danh sách xổ xuống
*/
}
{
/*
List
*/
}
{
isOpen
&&
(
{
isOpen
&&
(
<
View
<
View
style
=
{[
style
=
{[
styles
.
dropdownList
,
styles
.
dropdownList
,
{
position
:
'absolute'
,
top
:
35
,
left
:
0
,
right
:
0
,
zIndex
:
999
},
{
]}
>
top
:
headerHeight
,
{
/* <FlatList
backgroundColor
:
'#fff'
,
nestedScrollEnabled={true}
borderColor
:
'#e5e5e5'
,
data={items}
},
keyExtractor={(item) => item.id.toString()}
]}
renderItem={({ item }) => (
>
<
ScrollView
style
=
{{
maxHeight
:
220
}}
>
{
items
.
map
((
item
)
=>
(
<
TouchableOpacity
<
TouchableOpacity
key
=
{
String
(
item
.
id
)}
style
=
{
styles
.
dropdownItem
}
style
=
{
styles
.
dropdownItem
}
onPress
=
{()
=>
handleSelect
(
item
)}
onPress
=
{()
=>
handleSelect
(
item
)}
>
>
<
Text
style
=
{
styles
.
dropdownItemText
}
>
{
item
.
label
}
<
/Text
>
<
Text
style
=
{
styles
.
dropdownItemText
}
>
{
item
.
label
}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
)}
/> */
}
<
ScrollView
style
=
{{
maxHeight
:
200
}}
>
{
items
.
map
(
item
=>
(
<
TouchableOpacity
key
=
{
item
.
id
.
toString
()}
style
=
{
styles
.
dropdownItem
}
onPress
=
{()
=>
handleSelect
(
item
)}
>
<
Text
style
=
{
styles
.
dropdownItemText
}
>
{
item
.
label
}
<
/Text
>
<
/TouchableOpacity
>
))}
))}
<
/ScrollView
>
<
/ScrollView
>
<
/View
>
<
/View
>
...
@@ -72,29 +108,35 @@ export default Dropdown;
...
@@ -72,29 +108,35 @@ export default Dropdown;
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
container
:
{
container
:
{
width
:
'100%'
,
width
:
'100%'
,
position
:
'relative'
,
},
},
dropdownHeader
:
{
dropdownHeader
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
borderWidth
:
1
,
borderWidth
:
1
,
borderColor
:
R
.
colors
.
grayBorderInputTextHeader
,
borderRadius
:
5
,
borderRadius
:
5
,
backgroundColor
:
'#fff'
,
height
:
35
,
paddingHorizontal
:
15
,
paddingHorizontal
:
15
,
},
},
dropdownHeaderText
:
{
dropdownHeaderText
:
{
fontSize
:
12
,
fontSize
:
12
,
color
:
'#333'
,
},
},
dropdownList
:
{
dropdownList
:
{
position
:
'absolute'
,
left
:
0
,
right
:
0
,
zIndex
:
999
,
elevation
:
8
,
// Android
borderWidth
:
1
,
borderWidth
:
1
,
borderColor
:
'#ccc'
,
borderRadius
:
6
,
backgroundColor
:
'#fff'
,
shadowColor
:
'#000'
,
// iOS
shadowOpacity
:
0.1
,
shadowRadius
:
8
,
shadowOffset
:
{
width
:
0
,
height
:
4
},
},
},
dropdownItem
:
{
dropdownItem
:
{
padding
:
5
,
paddingVertical
:
8
,
paddingHorizontal
:
12
,
borderBottomWidth
:
1
,
borderBottomWidth
:
1
,
borderBottomColor
:
'#eee'
,
borderBottomColor
:
'#eee'
,
},
},
...
@@ -106,6 +148,5 @@ const styles = StyleSheet.create({
...
@@ -106,6 +148,5 @@ const styles = StyleSheet.create({
width
:
20
,
width
:
20
,
height
:
20
,
height
:
20
,
resizeMode
:
'contain'
,
resizeMode
:
'contain'
,
tintColor
:
'#333'
,
},
},
});
});
src/components/Input/TextField.js
View file @
10bf147d
...
@@ -51,7 +51,10 @@ const TextField = props => {
...
@@ -51,7 +51,10 @@ const TextField = props => {
placeholder
=
{
placeholder
}
placeholder
=
{
placeholder
}
maxLength
=
{
maxLength
?
maxLength
:
256
}
maxLength
=
{
maxLength
?
maxLength
:
256
}
placeholderTextColor
=
{
R
.
colors
.
gray
}
placeholderTextColor
=
{
editable
===
false
?
(
backgroundColor
||
R
.
colors
.
black
)
// khi disabled thì lấy màu xám
:
backgroundColor
}
editable
=
{
editable
!=
null
?
editable
:
true
}
editable
=
{
editable
!=
null
?
editable
:
true
}
secureTextEntry
=
{
isPassword
}
secureTextEntry
=
{
isPassword
}
autoCapitalize
=
"none"
autoCapitalize
=
"none"
...
@@ -68,7 +71,9 @@ const TextField = props => {
...
@@ -68,7 +71,9 @@ const TextField = props => {
fontSize
:
fontSize
,
fontSize
:
fontSize
,
paddingVertical
:
5
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
paddingHorizontal
:
10
,
backgroundColor
:
backgroundColor
,
backgroundColor
:
editable
===
false
?
(
backgroundColor
||
R
.
colors
.
blue1
)
// khi disabled thì lấy màu xám
:
backgroundColor
,
// khi enable thì lấy màu bạn truyền,
}}
}}
/
>
/
>
{
error
&&
<
View
{
error
&&
<
View
...
...
src/components/Input/TextMulti.js
View file @
10bf147d
...
@@ -54,7 +54,10 @@ const TextField = props => {
...
@@ -54,7 +54,10 @@ const TextField = props => {
multiline
=
{
true
}
multiline
=
{
true
}
numberOfLines
=
{
numberOfLines
}
numberOfLines
=
{
numberOfLines
}
onFocus
=
{
onFocus
}
onFocus
=
{
onFocus
}
placeholderTextColor
=
{
R
.
colors
.
gray
}
placeholderTextColor
=
{
editable
===
false
?
(
backgroundColor
||
R
.
colors
.
black
)
// khi disabled thì lấy màu xám
:
backgroundColor
||
R
.
colors
.
gray
}
autoCapitalize
=
"none"
autoCapitalize
=
"none"
style
=
{{
style
=
{{
textAlignVertical
:
'top'
,
textAlignVertical
:
'top'
,
...
@@ -68,8 +71,9 @@ const TextField = props => {
...
@@ -68,8 +71,9 @@ const TextField = props => {
fontSize
:
fontSizePlaceHolder
,
fontSize
:
fontSizePlaceHolder
,
paddingVertical
:
10
,
paddingVertical
:
10
,
paddingHorizontal
:
10
,
paddingHorizontal
:
10
,
backgroundColor
:
backgroundColor
,
backgroundColor
:
editable
===
false
?
(
backgroundColor
||
R
.
colors
.
blue1
)
// khi disabled thì lấy màu xám
:
backgroundColor
,
// khi enable thì lấy màu bạn truyền,
}}
}}
/
>
/
>
<
/View
>
<
/View
>
...
...
src/screens/list_send_document/status/style.js
View file @
10bf147d
...
@@ -30,6 +30,7 @@ row_1:{
...
@@ -30,6 +30,7 @@ row_1:{
fontFamily
:
R
.
fonts
.
fontRegular
,
fontFamily
:
R
.
fonts
.
fontRegular
,
color
:
R
.
colors
.
black
,
color
:
R
.
colors
.
black
,
},
},
containerDropdown
:{
containerDropdown
:{
marginBottom
:
10
,
marginBottom
:
10
,
position
:
'relative'
,
position
:
'relative'
,
...
@@ -84,6 +85,12 @@ row_1:{
...
@@ -84,6 +85,12 @@ row_1:{
borderWidth
:
1
,
borderWidth
:
1
,
borderColor
:
R
.
colors
.
blue1
,
borderColor
:
R
.
colors
.
blue1
,
height
:
80
height
:
80
},
textBtn
:{
fontSize
:
R
.
fontsize
.
fontSizeContent
,
fontWeight
:
'400'
,
fontFamily
:
R
.
fonts
.
fontRegular
,
color
:
R
.
colors
.
black
,
}
}
...
...
src/screens/list_send_document/status/view.js
View file @
10bf147d
This diff is collapsed.
Click to expand it.
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