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
cf80d23b
Commit
cf80d23b
authored
Jun 29, 2020
by
larissafiorini
Browse files
merge develop
parents
d98d07dc
647bc6d6
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/components/RedeButton/StyledComponents/Cancelar.jsx
View file @
cf80d23b
...
...
@@ -6,7 +6,6 @@ const Cancelar = css`
color:
${
COLOR
.
AZUL
}
;
background-color:
${
COLOR
.
BRANCO
}
;
border: solid 1px
${
COLOR
.
AZUL
}
;
margin: 10px 40px;
:hover {
color:
${
COLOR
.
BRANCO
}
;
...
...
src/components/RedeCard/RedeCard.jsx
View file @
cf80d23b
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/components/RedeHeader/RedeHeader.jsx
View file @
cf80d23b
...
...
@@ -27,7 +27,7 @@ const RedeHeader = (props) => {
useEffect
(()
=>
{
// ComponentDidMount
setTitle
(
''
);
// TODO: Tirar esse setTitle();
const
tknValue
=
sessionStorage
.
getItem
(
'
token
'
);
const
path
=
props
.
location
.
pathname
;
const
path
=
props
&&
props
.
location
&&
props
.
location
.
pathname
?
props
.
location
.
pathname
:
''
;
if
(
!
tknValue
&&
excludedPaths
.
indexOf
(
path
)
===
-
1
&&
!
String
(
path
).
match
(
/
(
nova-senha
\/
.*
)
/
))
{
history
.
push
(
'
/
'
);
}
...
...
src/pages/adm/StyledComponents/ButtonWrapper.jsx
0 → 100644
View file @
cf80d23b
import
styled
from
"
styled-components
"
;
const
ButtonWrapper
=
styled
.
div
`
display: flex;
align-items: center;
place-content: center;
width: 100%;
position: relative;
button{
margin-left:10px;
margin-right:10px;
}
@media only screen and (max-width: 768px) {
width: 100%;
padding: 0px;
}
`
;
export
default
ButtonWrapper
;
src/pages/adm/StyledComponents/Modal.jsx
View file @
cf80d23b
...
...
@@ -4,6 +4,7 @@ import DialogActions from '@material-ui/core/DialogActions';
import
DialogContent
from
'
@material-ui/core/DialogContent
'
;
import
DialogContentText
from
'
@material-ui/core/DialogContentText
'
;
import
DialogTitle
from
'
@material-ui/core/DialogTitle
'
;
import
ButtonWrapper
from
'
./ButtonWrapper
'
;
import
RedeTextField
from
'
../../../components/RedeTextField/RedeTextField
'
;
import
RedeButton
from
'
../../../components/RedeButton/RedeButton
'
;
...
...
@@ -31,15 +32,17 @@ const Modal = ({
/>
</
DialogContent
>
<
DialogActions
>
<
RedeButton
descricao
=
"Cancelar"
onClick
=
{
handleClose
}
cancelar
/>
<
RedeButton
descricao
=
"Aprovar"
onClick
=
{
editFunction
}
/>
<
ButtonWrapper
>
<
RedeButton
descricao
=
"Cancelar"
onClick
=
{
handleClose
}
cancelar
/>
<
RedeButton
descricao
=
"Aprovar"
onClick
=
{
editFunction
}
/>
</
ButtonWrapper
>
</
DialogActions
>
</
Dialog
>
</
div
>
...
...
src/pages/cadastro-mentor/CadastroMentor.jsx
View file @
cf80d23b
...
...
@@ -225,7 +225,7 @@ function CadastroMentor() {
const
ajudaEmail
=
()
=>
{
if
(
sent
&&
!
email
)
return
'
Email é obrigatório!
'
;
if
(
!
validateEmail
(
email
))
return
'
Email inválido!
'
;
if
(
sent
&&
email
&&
!
validateEmail
(
email
))
return
'
Email inválido!
'
;
return
''
;
};
...
...
src/pages/cadastro-mentorado/CadastroMentorado.jsx
View file @
cf80d23b
...
...
@@ -224,7 +224,7 @@ function CadastroMentorado() {
const
ajudaEmail
=
()
=>
{
if
(
sent
&&
!
email
)
return
'
Email é obrigatório!
'
;
if
(
!
validateEmail
(
email
))
return
'
Email inválido!
'
;
if
(
sent
&&
email
&&
!
validateEmail
(
email
))
return
'
Email inválido!
'
;
return
''
;
};
...
...
src/pages/cadastro-mentoria/CadastroMentoria.jsx
View file @
cf80d23b
...
...
@@ -316,7 +316,6 @@ function CadastroMentoria() {
</
DivSelect
>
</
Container
.
SecondOption
>
</
Container
.
Form
>
<
Container
.
Submit
>
<
RedeButton
descricao
=
"Cancelar"
cancelar
onClick
=
{
(
e
)
=>
cleanForm
(
e
)
}
/>
<
RedeButton
descricao
=
{
ActionButtonTitle
}
onClick
=
{
handleAddMentoria
}
/>
...
...
src/pages/cadastro-mentoria/StyledComponents/Submit.jsx
View file @
cf80d23b
import
styled
from
'
styled-components
'
;
const
Submit
=
styled
.
div
`
margin:0 auto;
width:85%;
display: flex;
align-items: center;
justify-content: center;
margin-left: 15px;
justify-content: space-evenly;
@media only screen and (max-width: 1024px) {
flex-direction: column;
...
...
src/pages/mentor/Mentor.jsx
View file @
cf80d23b
...
...
@@ -5,7 +5,6 @@ import { useSnackbar } from 'notistack';
import
StyledContainer
from
'
./StyledComponents
'
;
import
Card
from
'
../../components/RedeCard/RedeCard
'
;
import
ModalRep
from
'
../adm/StyledComponents/ModalReprove
'
;
// import ProfileInfo from '../../components/RedeProfileInfo/RedeProfileInfo';
import
{
mentoriasByMentor
,
desativarMentoria
,
mudarVisibilidade
}
from
'
../../services/mentoria
'
;
import
{
profile
}
from
'
../../services/user
'
;
import
RedeButton
from
'
../../components/RedeButton/RedeButton
'
;
...
...
@@ -42,16 +41,31 @@ function Mentor() {
};
const
changeVisibility
=
(
i
)
=>
{
const
allMentorias
=
mentorias
;
allMentorias
[
i
].
data
.
isVisible
=
!
allMentorias
[
i
].
data
.
isVisible
;
setMentorias
(
allMentorias
);
const
allMentorias
=
[...
mentorias
];
const
token
=
sessionStorage
.
getItem
(
'
token
'
);
const
{
id
}
=
mentorias
[
i
];
const
config
=
{
params
:
{
id
},
headers
:
{
Authorization
:
`Bearer
${
token
}
`
},
};
mudarVisibilidade
(
config
);
mudarVisibilidade
(
config
).
then
(
()
=>
{
allMentorias
[
i
].
data
.
isVisible
=
!
allMentorias
[
i
].
data
.
isVisible
;
setMentorias
(
allMentorias
);
let
message
;
if
(
allMentorias
[
i
].
data
.
isVisible
)
message
=
'
Mentoria não está mais disponível para os mentorandos!
'
;
else
message
=
'
Mentoria está disponível para os mentorandos!
'
;
enqueueSnackbar
(
message
,
{
variant
:
'
success
'
,
autoHideDuration
:
2500
});
},
).
catch
(
()
=>
{
enqueueSnackbar
(
'
Falha ao atualizar essa mentoria. Verifique sua conexão e tente novamente.
'
,
{
variant
:
'
error
'
,
autoHideDuration
:
2500
},
);
},
);
};
const
editPage
=
(
mentoria
)
=>
{
...
...
@@ -135,6 +149,7 @@ function Mentor() {
onClickRemove
=
{
()
=>
abreModalRep
(
mentoria
.
id
)
}
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