Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
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
1
Merge Requests
1
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
Giang Tran
InvestCustomer
Commits
1d08f5bb
Commit
1d08f5bb
authored
Sep 08, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
38e610cd
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
15 deletions
+54
-15
project.pbxproj
ios/Invest.xcodeproj/project.pbxproj
+4
-4
Functions.js
src/Config/Functions.js
+13
-1
SnackReducer.js
src/Reducers/SnackReducer.js
+1
-0
Media.js
src/Screens/NewFeed/Media/Media.js
+3
-1
TopMedia.js
src/Screens/NewFeed/Media/TopMedia.js
+13
-6
SnackBar.js
src/components/SnackBar.js
+6
-1
FirebaseNotification.js
src/helper/FirebaseNotification.js
+10
-1
ScreenNames.js
src/routers/ScreenNames.js
+2
-0
TabNavigation.js
src/routers/TabNavigation.js
+2
-1
No files found.
ios/Invest.xcodeproj/project.pbxproj
View file @
1d08f5bb
...
@@ -905,7 +905,7 @@
...
@@ -905,7 +905,7 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/InvestDebug.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Invest/InvestDebug.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
5
;
CURRENT_PROJECT_VERSION
=
1
6
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
GCC_PREPROCESSOR_DEFINITIONS
=
(
GCC_PREPROCESSOR_DEFINITIONS
=
(
...
@@ -914,7 +914,7 @@
...
@@ -914,7 +914,7 @@
);
);
INFOPLIST_FILE
=
Invest/Info.plist
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.3.
1
;
MARKETING_VERSION
=
2.3.
2
;
OTHER_LDFLAGS
=
(
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"$(inherited)"
,
"-ObjC"
,
"-ObjC"
,
...
@@ -939,11 +939,11 @@
...
@@ -939,11 +939,11 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
5
;
CURRENT_PROJECT_VERSION
=
1
6
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
INFOPLIST_FILE
=
Invest/Info.plist
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.3.
1
;
MARKETING_VERSION
=
2.3.
2
;
OTHER_LDFLAGS
=
(
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"$(inherited)"
,
"-ObjC"
,
"-ObjC"
,
...
...
src/Config/Functions.js
View file @
1d08f5bb
...
@@ -12,7 +12,12 @@ import _ from 'lodash';
...
@@ -12,7 +12,12 @@ import _ from 'lodash';
import
I18n
from
'../helper/i18/i18n'
;
import
I18n
from
'../helper/i18/i18n'
;
import
AppText
from
'../components/AppText'
;
import
AppText
from
'../components/AppText'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
{
DETAILNEW
,
TABNAVIGATOR
,
AUTHEN
}
from
'../routers/ScreenNames'
;
import
{
DETAILNEW
,
TABNAVIGATOR
,
AUTHEN
,
REJECTWEB
,
}
from
'../routers/ScreenNames'
;
import
R
from
'../assets/R'
;
import
R
from
'../assets/R'
;
import
{
isTablet
}
from
'react-native-device-info'
;
import
{
isTablet
}
from
'react-native-device-info'
;
import
{
RSA_KEY
,
MY_RSA_KEY
}
from
'./constants'
;
import
{
RSA_KEY
,
MY_RSA_KEY
}
from
'./constants'
;
...
@@ -68,6 +73,13 @@ export const convertScreen = (name) => {
...
@@ -68,6 +73,13 @@ export const convertScreen = (name) => {
case
'CUSTOMER_VERIFIED'
:
case
'CUSTOMER_VERIFIED'
:
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
return
TABNAVIGATOR
;
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
case
'REDIRECT'
:
return
REJECTWEB
;
default
:
default
:
return
DETAILNEW
;
return
DETAILNEW
;
}
}
...
...
src/Reducers/SnackReducer.js
View file @
1d08f5bb
...
@@ -6,6 +6,7 @@ const initialState = {
...
@@ -6,6 +6,7 @@ const initialState = {
title
:
''
,
title
:
''
,
content
:
''
,
content
:
''
,
id_record
:
''
,
id_record
:
''
,
link
:
null
,
};
};
// @ts-ignore
// @ts-ignore
...
...
src/Screens/NewFeed/Media/Media.js
View file @
1d08f5bb
...
@@ -21,7 +21,9 @@ const Media = (props) => {
...
@@ -21,7 +21,9 @@ const Media = (props) => {
platform
:
Platform
.
OS
,
platform
:
Platform
.
OS
,
});
});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
data
[
0
]
&&
res
.
data
.
data
[
0
].
data
[
0
])
setMediaHot
([]);
if
(
res
.
data
.
data
[
0
]
&&
res
.
data
.
data
[
0
].
data
[
0
])
{
setMediaHot
(
res
.
data
.
data
[
0
].
data
[
0
]);
}
setData
(
res
.
data
.
data
);
setData
(
res
.
data
.
data
);
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
I18n
.
t
(
'Can_not_get_data'
));
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
I18n
.
t
(
'Can_not_get_data'
));
...
...
src/Screens/NewFeed/Media/TopMedia.js
View file @
1d08f5bb
...
@@ -47,12 +47,18 @@ const MediaView = (props) => {
...
@@ -47,12 +47,18 @@ const MediaView = (props) => {
<
/Text
>
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
Block
row
space
=
{
'between'
}
padding
=
{[
10
,
10
]}
>
<
View
<
View
style
=
{{
flexDirection
:
'row'
}}
>
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
10
,
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Icon
<
Icon
name
=
{
'calendar'
}
name
=
{
'calendar'
}
color
=
{
R
.
colors
.
white
}
color
=
{
R
.
colors
.
white
}
size
=
{
getFontXD
(
4
6
)}
size
=
{
getFontXD
(
4
2
)}
/
>
/
>
<
Text
style
=
{
styles
.
txtDate
}
>
{
published_at
}
<
/Text
>
<
Text
style
=
{
styles
.
txtDate
}
>
{
published_at
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -68,7 +74,7 @@ const MediaView = (props) => {
...
@@ -68,7 +74,7 @@ const MediaView = (props) => {
/
>
/
>
<
Text
style
=
{
styles
.
txtPlay
}
>
Xem
video
<
/Text
>
<
Text
style
=
{
styles
.
txtPlay
}
>
Xem
video
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/
Block
>
<
/
View
>
<
/View
>
<
/View
>
<
/LinearGradient
>
<
/LinearGradient
>
<
/ImageBackground
>
<
/ImageBackground
>
...
@@ -85,10 +91,11 @@ const styles = StyleSheet.create({
...
@@ -85,10 +91,11 @@ const styles = StyleSheet.create({
},
},
contentTop
:
{
contentTop
:
{
padding
:
10
,
padding
:
10
,
flex
:
1
,
height
:
HEIGHTXD
(
260
),
width
:
'100%'
,
},
},
txtBig
:
{
txtBig
:
{
fontSize
:
getFontXD
(
5
2
),
fontSize
:
getFontXD
(
4
2
),
color
:
R
.
colors
.
white
,
color
:
R
.
colors
.
white
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
textDecorationLine
:
'underline'
,
textDecorationLine
:
'underline'
,
...
...
src/components/SnackBar.js
View file @
1d08f5bb
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
TouchableOpacity
,
TouchableOpacity
,
StatusBar
,
StatusBar
,
TouchableWithoutFeedback
,
TouchableWithoutFeedback
,
Linking
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../assets/R'
;
import
R
from
'../assets/R'
;
import
Block
from
'./Block'
;
import
Block
from
'./Block'
;
...
@@ -18,7 +19,7 @@ import {useNavigation} from '@react-navigation/native';
...
@@ -18,7 +19,7 @@ import {useNavigation} from '@react-navigation/native';
import
AppText
from
'../components/AppText'
;
import
AppText
from
'../components/AppText'
;
const
SnackBar
=
(
props
)
=>
{
const
SnackBar
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
const
navigate
=
useNavigation
();
const
{
isOpen
,
title
,
content
,
screen
,
id_record
}
=
props
.
snackReducer
;
const
{
isOpen
,
title
,
content
,
screen
,
id_record
,
link
}
=
props
.
snackReducer
;
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
isOpen
)
if
(
isOpen
)
...
@@ -53,8 +54,12 @@ const SnackBar = (props) => {
...
@@ -53,8 +54,12 @@ const SnackBar = (props) => {
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
<
TouchableOpacity
onPress
=
{()
=>
{
onPress
=
{()
=>
{
if
(
link
!=
null
)
{
Linking
.
openURL
(
link
);
}
else
{
props
.
hideNotification
();
props
.
hideNotification
();
navigate
.
navigate
(
screen
,
{
id
:
id_record
});
navigate
.
navigate
(
screen
,
{
id
:
id_record
});
}
}}
}}
style
=
{[
styles
.
btn
,
{
marginLeft
:
20
}]}
>
style
=
{[
styles
.
btn
,
{
marginLeft
:
20
}]}
>
<
AppText
i18nKey
=
{
'Detail'
}
style
=
{
styles
.
txtBtn
}
/
>
<
AppText
i18nKey
=
{
'Detail'
}
style
=
{
styles
.
txtBtn
}
/
>
...
...
src/helper/FirebaseNotification.js
View file @
1d08f5bb
/* eslint-disable no-console */
/* eslint-disable no-console */
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
Platform
,
View
,
Alert
}
from
'react-native'
;
import
{
Platform
,
View
,
Alert
,
Linking
}
from
'react-native'
;
import
messaging
from
'@react-native-firebase/messaging'
;
import
messaging
from
'@react-native-firebase/messaging'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
KEY
from
'../assets/AsynStorage'
;
import
KEY
from
'../assets/AsynStorage'
;
...
@@ -43,6 +43,7 @@ const FirebaseNotification = (props) => {
...
@@ -43,6 +43,7 @@ const FirebaseNotification = (props) => {
content
:
body
,
content
:
body
,
screen
:
convertScreen
(
action_type
),
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
id_record
:
record_id
,
link
:
remoteMessage
.
data
?.
redirect_to
,
});
});
if
(
action_type
!=
'CUSTOMER_NEWS'
)
refetchDataUser
();
if
(
action_type
!=
'CUSTOMER_NEWS'
)
refetchDataUser
();
...
@@ -55,10 +56,14 @@ const FirebaseNotification = (props) => {
...
@@ -55,10 +56,14 @@ const FirebaseNotification = (props) => {
remoteMessage
,
remoteMessage
,
);
);
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
if
(
action_type
==
'REDIRECT'
)
{
Linking
.
openURL
(
remoteMessage
.
data
.
redirect_to
);
}
else
{
props
.
newScreenInit
({
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
id_record
:
record_id
,
});
});
}
});
});
messaging
()
messaging
()
.
getInitialNotification
()
.
getInitialNotification
()
...
@@ -70,11 +75,15 @@ const FirebaseNotification = (props) => {
...
@@ -70,11 +75,15 @@ const FirebaseNotification = (props) => {
remoteMessage
.
data
,
remoteMessage
.
data
,
);
);
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
if
(
action_type
==
'REDIRECT'
)
{
Linking
.
openURL
(
remoteMessage
.
data
.
redirect_to
);
}
else
{
props
.
newScreenInit
({
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
id_record
:
record_id
,
});
});
}
}
}
});
});
return
unsubscribe
;
return
unsubscribe
;
...
...
src/routers/ScreenNames.js
View file @
1d08f5bb
...
@@ -95,3 +95,5 @@ export const RULESSMARTOTP = 'RULESSMARTOTP';
...
@@ -95,3 +95,5 @@ export const RULESSMARTOTP = 'RULESSMARTOTP';
export
const
FAQSSMARTOTP
=
'FAQSSMARTOTP'
;
export
const
FAQSSMARTOTP
=
'FAQSSMARTOTP'
;
export
const
CONFIRMCREATEOTP
=
'CONFIRMCREATEOTP'
;
export
const
CONFIRMCREATEOTP
=
'CONFIRMCREATEOTP'
;
export
const
REJECTWEB
=
'REJECTWEB'
;
src/routers/TabNavigation.js
View file @
1d08f5bb
...
@@ -132,7 +132,8 @@ const TabNavigator = (props) => {
...
@@ -132,7 +132,8 @@ const TabNavigator = (props) => {
name
=
"Screen1"
name
=
"Screen1"
component
=
{
Home
}
component
=
{
Home
}
options
=
{{
options
=
{{
tabBarLabel
:
'Overview'
,
tabBarLabel
:
props
.
language
.
language
==
'vi'
?
'Trang chủ'
:
'Overview'
,
tabBarIcon
:
({
color
,
size
})
=>
(
tabBarIcon
:
({
color
,
size
})
=>
(
<
Icon
name
=
"landmark"
size
=
{
size
}
color
=
{
color
}
/
>
<
Icon
name
=
"landmark"
size
=
{
size
}
color
=
{
color
}
/
>
),
),
...
...
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