Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rede De Mentores
Frontend
Commits
488fa005
Commit
488fa005
authored
Jun 19, 2020
by
johnnyloreano
Browse files
Correcao da funcao de mudar visibilidade, criei uma propriedade pra mudar o icone no redeCard
parent
6032333c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/RedeCard/RedeCard.jsx
View file @
488fa005
import
React
from
'
react
'
;
import
{
object
,
func
,
bool
}
from
'
prop-types
'
;
import
Container
from
'
./StyledComponents
'
;
//
import visible from '../../assets/visibility-button.png';
import
visible
from
'
../../assets/visibility-button.png
'
;
import
remove
from
'
../../assets/rubbish-bin-delete-button.png
'
;
import
edition
from
'
../../assets/create-new-pencil-button.png
'
;
import
notVisible
from
'
../../assets/invisible-button.png
'
;
...
...
@@ -29,6 +29,7 @@ const Card = ({
onClickRemove
,
onClickEdit
,
todosHorarios
,
isVisible
,
})
=>
{
const
nextAvailableHours
=
mentoria
.
dateTime
.
slice
(
0
,
3
)
.
map
((
day
)
=>
<
RedeButton
claro
descricao
=
{
`
${
day
.
day
.
slice
(
0
,
3
)}
-
${
day
.
times
[
0
].
hour
}
`
}
onClick
=
{
onClickSchedule
}
/>);
...
...
@@ -61,7 +62,7 @@ const Card = ({
<>
<
RedeIcon
imageUrl
=
{
remove
}
onClick
=
{
onClickRemove
}
/>
<
RedeIcon
imageUrl
=
{
mentoria
.
data
?
mentoria
.
data
.
isV
isible
:
notVisible
}
imageUrl
=
{
isVisible
?
v
isible
:
notVisible
}
onClick
=
{
onClickVisible
}
/>
<
RedeIcon
imageUrl
=
{
edition
}
onClick
=
{
onClickEdit
}
/>
...
...
src/pages/mentor/Mentor.jsx
View file @
488fa005
...
...
@@ -41,16 +41,20 @@ function Mentor() {
};
const
changeVisibility
=
(
i
)
=>
{
const
allMentorias
=
mentorias
;
allMentorias
[
i
].
data
.
isVisible
=
!
allMentorias
[
i
].
data
.
isVisible
;
setMentorias
(
allMentorias
);
const
allMentorias
=
[...
mentorias
];
// return;
const
token
=
sessionStorage
.
getItem
(
'
token
'
);
const
{
id
}
=
mentorias
[
i
];
const
config
=
{
params
:
{
id
},
headers
:
{
Authorization
:
`Bearer
${
token
}
`
},
};
mudarVisibilidade
(
config
);
mudarVisibilidade
(
config
).
then
(
(
res
)
=>
{
allMentorias
[
i
].
data
.
isVisible
=
!
allMentorias
[
i
].
data
.
isVisible
;
setMentorias
(
allMentorias
);
},
);
};
const
editPage
=
(
mentoria
)
=>
{
...
...
@@ -124,6 +128,7 @@ function Mentor() {
onClickRemove
=
{
()
=>
changeAvalibility
(
i
)
}
onClickVisible
=
{
()
=>
changeVisibility
(
i
)
}
onClickEdit
=
{
()
=>
editPage
(
mentoria
)
}
isVisible
=
{
mentoria
.
data
.
isVisible
}
todosHorarios
/>
))
...
...
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