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
a791dda3
Commit
a791dda3
authored
May 10, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
9710396e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
PickerAvatart.js
src/components/Picker/PickerAvatart.js
+8
-6
No files found.
src/components/Picker/PickerAvatart.js
View file @
a791dda3
...
@@ -22,6 +22,7 @@ import I18n from '../../helper/i18/i18n';
...
@@ -22,6 +22,7 @@ import I18n from '../../helper/i18/i18n';
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
TABNAVIGATOR
}
from
'../../routers/ScreenNames'
;
import
{
TABNAVIGATOR
}
from
'../../routers/ScreenNames'
;
import
{
changeAvatart
}
from
'../../apis/Functions/users'
;
import
{
changeAvatart
}
from
'../../apis/Functions/users'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
const
options
=
{
const
options
=
{
title
:
'Select Avatar'
,
title
:
'Select Avatar'
,
...
@@ -58,16 +59,13 @@ const PickerImg = (props) => {
...
@@ -58,16 +59,13 @@ const PickerImg = (props) => {
};
};
const
callApi
=
async
(
image
)
=>
{
const
callApi
=
async
(
image
)
=>
{
props
.
showLoading
();
const
res
=
await
changeAvatart
(
const
res
=
await
changeAvatart
(
createFormData
(
image
,
{
uid
:
props
.
user
.
uid
,
platform
:
Platform
.
OS
}),
createFormData
(
image
,
{
uid
:
props
.
user
.
uid
,
platform
:
Platform
.
OS
}),
);
);
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
naviagtion
.
reset
({
index
:
1
,
routes
:
[{
name
:
TABNAVIGATOR
}],
});
props
.
saveUserToRedux
(
res
.
data
.
data
);
props
.
saveUserToRedux
(
res
.
data
.
data
);
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
},
500
);
},
500
);
...
@@ -224,4 +222,8 @@ const mapStateToProps = (state) => {
...
@@ -224,4 +222,8 @@ const mapStateToProps = (state) => {
user
:
state
.
userReducer
,
user
:
state
.
userReducer
,
};
};
};
};
export
default
connect
(
mapStateToProps
,
{
saveUserToRedux
})(
PickerImg
);
export
default
connect
(
mapStateToProps
,
{
saveUserToRedux
,
showLoading
,
hideLoading
,
})(
PickerImg
);
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