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
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
25 deletions
+64
-25
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
+8
-3
FirebaseNotification.js
src/helper/FirebaseNotification.js
+18
-9
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 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/InvestDebug.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
5
;
CURRENT_PROJECT_VERSION
=
1
6
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
ENABLE_BITCODE
=
NO
;
GCC_PREPROCESSOR_DEFINITIONS
=
(
...
...
@@ -914,7 +914,7 @@
);
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.3.
1
;
MARKETING_VERSION
=
2.3.
2
;
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"-ObjC"
,
...
...
@@ -939,11 +939,11 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
5
;
CURRENT_PROJECT_VERSION
=
1
6
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.3.
1
;
MARKETING_VERSION
=
2.3.
2
;
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"-ObjC"
,
...
...
src/Config/Functions.js
View file @
1d08f5bb
...
...
@@ -12,7 +12,12 @@ import _ from 'lodash';
import
I18n
from
'../helper/i18/i18n'
;
import
AppText
from
'../components/AppText'
;
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
{
isTablet
}
from
'react-native-device-info'
;
import
{
RSA_KEY
,
MY_RSA_KEY
}
from
'./constants'
;
...
...
@@ -68,6 +73,13 @@ export const convertScreen = (name) => {
case
'CUSTOMER_VERIFIED'
:
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
case
'SYNC_WHEN_CUSTOMER_VERIFIED'
:
return
TABNAVIGATOR
;
case
'REDIRECT'
:
return
REJECTWEB
;
default
:
return
DETAILNEW
;
}
...
...
src/Reducers/SnackReducer.js
View file @
1d08f5bb
...
...
@@ -6,6 +6,7 @@ const initialState = {
title
:
''
,
content
:
''
,
id_record
:
''
,
link
:
null
,
};
// @ts-ignore
...
...
src/Screens/NewFeed/Media/Media.js
View file @
1d08f5bb
...
...
@@ -21,7 +21,9 @@ const Media = (props) => {
platform
:
Platform
.
OS
,
});
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
);
}
else
{
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) => {
<
/Text
>
<
/TouchableOpacity
>
<
Block
row
space
=
{
'between'
}
padding
=
{[
10
,
10
]}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
10
,
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Icon
name
=
{
'calendar'
}
color
=
{
R
.
colors
.
white
}
size
=
{
getFontXD
(
4
6
)}
size
=
{
getFontXD
(
4
2
)}
/
>
<
Text
style
=
{
styles
.
txtDate
}
>
{
published_at
}
<
/Text
>
<
/View
>
...
...
@@ -68,7 +74,7 @@ const MediaView = (props) => {
/
>
<
Text
style
=
{
styles
.
txtPlay
}
>
Xem
video
<
/Text
>
<
/TouchableOpacity
>
<
/
Block
>
<
/
View
>
<
/View
>
<
/LinearGradient
>
<
/ImageBackground
>
...
...
@@ -85,10 +91,11 @@ const styles = StyleSheet.create({
},
contentTop
:
{
padding
:
10
,
flex
:
1
,
height
:
HEIGHTXD
(
260
),
width
:
'100%'
,
},
txtBig
:
{
fontSize
:
getFontXD
(
5
2
),
fontSize
:
getFontXD
(
4
2
),
color
:
R
.
colors
.
white
,
fontWeight
:
'bold'
,
textDecorationLine
:
'underline'
,
...
...
src/components/SnackBar.js
View file @
1d08f5bb
...
...
@@ -6,6 +6,7 @@ import {
TouchableOpacity
,
StatusBar
,
TouchableWithoutFeedback
,
Linking
,
}
from
'react-native'
;
import
R
from
'../assets/R'
;
import
Block
from
'./Block'
;
...
...
@@ -18,7 +19,7 @@ import {useNavigation} from '@react-navigation/native';
import
AppText
from
'../components/AppText'
;
const
SnackBar
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
const
{
isOpen
,
title
,
content
,
screen
,
id_record
}
=
props
.
snackReducer
;
const
{
isOpen
,
title
,
content
,
screen
,
id_record
,
link
}
=
props
.
snackReducer
;
useEffect
(()
=>
{
if
(
isOpen
)
...
...
@@ -53,8 +54,12 @@ const SnackBar = (props) => {
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
hideNotification
();
navigate
.
navigate
(
screen
,
{
id
:
id_record
});
if
(
link
!=
null
)
{
Linking
.
openURL
(
link
);
}
else
{
props
.
hideNotification
();
navigate
.
navigate
(
screen
,
{
id
:
id_record
});
}
}}
style
=
{[
styles
.
btn
,
{
marginLeft
:
20
}]}
>
<
AppText
i18nKey
=
{
'Detail'
}
style
=
{
styles
.
txtBtn
}
/
>
...
...
src/helper/FirebaseNotification.js
View file @
1d08f5bb
/* eslint-disable no-console */
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
AsyncStorage
from
'@react-native-community/async-storage'
;
import
KEY
from
'../assets/AsynStorage'
;
...
...
@@ -43,6 +43,7 @@ const FirebaseNotification = (props) => {
content
:
body
,
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
link
:
remoteMessage
.
data
?.
redirect_to
,
});
if
(
action_type
!=
'CUSTOMER_NEWS'
)
refetchDataUser
();
...
...
@@ -55,10 +56,14 @@ const FirebaseNotification = (props) => {
remoteMessage
,
);
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
});
if
(
action_type
==
'REDIRECT'
)
{
Linking
.
openURL
(
remoteMessage
.
data
.
redirect_to
);
}
else
{
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
});
}
});
messaging
()
.
getInitialNotification
()
...
...
@@ -70,10 +75,14 @@ const FirebaseNotification = (props) => {
remoteMessage
.
data
,
);
const
{
action_type
,
body
,
title
,
record_id
}
=
remoteMessage
.
data
;
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
});
if
(
action_type
==
'REDIRECT'
)
{
Linking
.
openURL
(
remoteMessage
.
data
.
redirect_to
);
}
else
{
props
.
newScreenInit
({
screen
:
convertScreen
(
action_type
),
id_record
:
record_id
,
});
}
}
});
...
...
src/routers/ScreenNames.js
View file @
1d08f5bb
...
...
@@ -95,3 +95,5 @@ export const RULESSMARTOTP = 'RULESSMARTOTP';
export
const
FAQSSMARTOTP
=
'FAQSSMARTOTP'
;
export
const
CONFIRMCREATEOTP
=
'CONFIRMCREATEOTP'
;
export
const
REJECTWEB
=
'REJECTWEB'
;
src/routers/TabNavigation.js
View file @
1d08f5bb
...
...
@@ -132,7 +132,8 @@ const TabNavigator = (props) => {
name
=
"Screen1"
component
=
{
Home
}
options
=
{{
tabBarLabel
:
'Overview'
,
tabBarLabel
:
props
.
language
.
language
==
'vi'
?
'Trang chủ'
:
'Overview'
,
tabBarIcon
:
({
color
,
size
})
=>
(
<
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