Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PortalMEC-React
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PortalMEC
PortalMEC-React
Commits
54d09633
Commit
54d09633
authored
4 years ago
by
Lucas Eduardo Schoenfelder
Browse files
Options
Downloads
Patches
Plain Diff
added functionality to commit changes made
parent
f1caa218
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!39
Update admin system
,
!32
Homologa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Pages/EditProfilePage.js
+30
-1
30 additions, 1 deletion
src/Pages/EditProfilePage.js
with
30 additions
and
1 deletion
src/Pages/EditProfilePage.js
+
30
−
1
View file @
54d09633
...
@@ -12,8 +12,15 @@ import MuiAlert from '@material-ui/lab/Alert';
...
@@ -12,8 +12,15 @@ import MuiAlert from '@material-ui/lab/Alert';
import
{
Alert
}
from
'
../Components/LoginModal.js
'
import
{
Alert
}
from
'
../Components/LoginModal.js
'
import
Grid
from
'
@material-ui/core/Grid
'
import
Grid
from
'
@material-ui/core/Grid
'
import
CustomizedBreadcrumbs
from
'
../Components/TabPanels/Breadcrumbs.js
'
import
CustomizedBreadcrumbs
from
'
../Components/TabPanels/Breadcrumbs.js
'
import
axios
from
'
axios
'
import
{
getAxiosConfig
}
from
'
../Components/HelperFunctions/getAxiosConfig
'
import
{
apiUrl
}
from
'
../env.js
'
import
{
Store
}
from
'
../Store.js
'
export
default
function
EditProfilePage
(
props
)
{
export
default
function
EditProfilePage
(
props
)
{
const
{
state
}
=
useContext
(
Store
)
const
id
=
state
.
currentUser
.
id
const
[
tabs
,
setTabs
]
=
useState
([
const
[
tabs
,
setTabs
]
=
useState
([
'
Editar Perfil
'
,
'
Solicitar conta de Professor
'
,
'
Gerenciar Conta
'
'
Editar Perfil
'
,
'
Solicitar conta de Professor
'
,
'
Gerenciar Conta
'
])
])
...
@@ -30,6 +37,28 @@ export default function EditProfilePage (props) {
...
@@ -30,6 +37,28 @@ export default function EditProfilePage (props) {
handleSnackbar
(
false
);
handleSnackbar
(
false
);
}
}
const
updateUserInfo
=
(
newUserInfo
)
=>
{
console
.
log
(
newUserInfo
)
let
config
=
getAxiosConfig
()
axios
.
put
(
(
`
${
apiUrl
}
/users/`
+
id
),
newUserInfo
,
config
).
then
(
(
res
)
=>
{
console
.
log
(
res
)
if
(
res
.
headers
[
'
access-token
'
]
)
{
sessionStorage
.
setItem
(
'
@portalmec/accessToken
'
,
res
.
headers
[
'
access-token
'
])
}
props
.
history
.
push
(
'
/perfil
'
)
},
(
err
)
=>
{
console
.
log
(
err
)
}
)
}
return
(
return
(
<
div
style
=
{{
backgroundColor
:
"
#f4f4f4
"
,
color
:
"
#666
"
}}
>
<
div
style
=
{{
backgroundColor
:
"
#f4f4f4
"
,
color
:
"
#666
"
}}
>
<
Snackbar
open
=
{
snackbarOpened
}
autoHideDuration
=
{
1000
}
onClose
=
{
handleCloseSnackbar
}
<
Snackbar
open
=
{
snackbarOpened
}
autoHideDuration
=
{
1000
}
onClose
=
{
handleCloseSnackbar
}
...
@@ -66,7 +95,7 @@ export default function EditProfilePage (props) {
...
@@ -66,7 +95,7 @@ export default function EditProfilePage (props) {
<
/Grid
>
<
/Grid
>
<
TabContentDiv
item
xs
=
{
9
}
>
<
TabContentDiv
item
xs
=
{
9
}
>
<
Paper
elevation
=
{
3
}
style
=
{{
width
:
"
100%
"
}}
>
<
Paper
elevation
=
{
3
}
style
=
{{
width
:
"
100%
"
}}
>
{
tabValue
===
0
&&
<
TabPanelEditarPerfil
/>
}
{
tabValue
===
0
&&
<
TabPanelEditarPerfil
updateUserInfo
=
{
updateUserInfo
}
/>
}
{
tabValue
===
1
&&
<
TabPanelSolicitarContaProfessor
/>
}
{
tabValue
===
1
&&
<
TabPanelSolicitarContaProfessor
/>
}
<
/Paper
>
<
/Paper
>
{
tabValue
===
2
&&
<
TabPanelGerenciarConta
handleSnackbar
=
{()
=>
{
handleSnackbar
(
true
)}}
/>
}
{
tabValue
===
2
&&
<
TabPanelGerenciarConta
handleSnackbar
=
{()
=>
{
handleSnackbar
(
true
)}}
/>
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment