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
0ff15727
Commit
0ff15727
authored
4 years ago
by
Lucas Eduardo Schoenfelder
Browse files
Options
Downloads
Patches
Plain Diff
missing share button and save to collection button functionalities
parent
e54e1881
No related branches found
No related tags found
3 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!24
Tela recurso
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Pages/ResourcePage.js
+56
-1
56 additions, 1 deletion
src/Pages/ResourcePage.js
with
56 additions
and
1 deletion
src/Pages/ResourcePage.js
+
56
−
1
View file @
0ff15727
...
...
@@ -24,7 +24,14 @@ import Grid from '@material-ui/core/Grid';
import
TextoObjeto
from
'
../Components/ResourcePageComponents/TextoObjeto.js
'
import
Footer
from
'
../Components/ResourcePageComponents/Footer.js
'
import
Sobre
from
'
../Components/ResourcePageComponents/Sobre.js
'
import
CommentsArea
from
'
../Components/ResourcePageComponents/CommentsArea.js
'
import
noAvatar
from
"
../img/default_profile.png
"
;
import
Snackbar
from
'
@material-ui/core/Snackbar
'
;
import
MuiAlert
from
'
@material-ui/lab/Alert
'
;
export
function
Alert
(
props
)
{
return
<
MuiAlert
elevation
=
{
6
}
variant
=
"
filled
"
{...
props
}
/>
;
}
export
default
function
LearningObjectPage
(
props
){
const
id
=
props
.
match
.
params
.
recursoId
...
...
@@ -34,13 +41,35 @@ export default function LearningObjectPage (props){
useEffect
(
()
=>
{
axios
.
get
(
(
`
${
apiUrl
}
/learning_objects/`
+
id
)
).
then
(
(
response
)
=>
{
if
(
response
.
headers
[
'
access-token
'
]
)
{
sessionStorage
.
setItem
(
'
@portalmec/accessToken
'
,
response
.
headers
[
'
access-token
'
])
}
console
.
log
(
response
)
setRecurso
(
response
.
data
)
toggle
(
false
)
},
(
error
)
=>
{
console
.
log
(
error
)})
},
[])
const
[
snackbarOpen
,
toggleSnackbar
]
=
useState
(
false
)
const
handleSnackbar
=
(
index
)
=>
{
setIndex
(
index
);
toggleSnackbar
(
true
)}
const
snackbarText
=
[
"
Baixando o Recurso... Lembre-se de relatar sua experiência após o uso do Recurso!
"
,
"
Seu comentário foi publicado com sucesso!
"
,
"
Comentário editado com sucesso.
"
,
"
Comentário deletado com sucesso.
"
]
const
[
snackbarIndex
,
setIndex
]
=
useState
(
0
)
return
(
<
React
.
Fragment
>
<
Snackbar
open
=
{
snackbarOpen
}
autoHideDuration
=
{
1000
}
onClose
=
{
toggleSnackbar
}
anchorOrigin
=
{{
vertical
:
'
top
'
,
horizontal
:
'
right
'
}}
>
<
Alert
severity
=
"
info
"
style
=
{{
backgroundColor
:
"
#00acc1
"
}}
>
{
snackbarText
[
snackbarIndex
]}
<
/Alert
>
<
/Snackbar
>
<
Background
>
{
carregando
?
...
...
@@ -59,6 +88,8 @@ export default function LearningObjectPage (props){
}
{
/*adicionar opcoes caso o usuario seja o publisher*/
}
{
/*adicionar links para os botoes de editar/deletar*/
}
{
/*implementar checkUserRole('publisher')*/
}
<
TextoObjeto
name
=
{
recurso
.
name
}
rating
=
{
recurso
.
rating
}
...
...
@@ -69,16 +100,28 @@ export default function LearningObjectPage (props){
educationalStages
=
{
recurso
.
educational_stages
}
viewCount
=
{
recurso
.
views_count
}
downloadCount
=
{
recurso
.
downloads_count
}
id
=
{
recurso
.
publisher
.
id
}
stateRecurso
=
{
recurso
.
state
}
/
>
<
/div
>
{
/*adicionar funcionalidade nos botoes do footer*/
}
<
Footer
/>
{
/*"Você já reportou esse recurso"*/
}
<
Footer
recursoId
=
{
id
}
downloadableLink
=
{
recurso
.
default_attachment_location
}
handleSnackbar
=
{
handleSnackbar
}
title
=
{
recurso
.
name
}
thumb
=
{
recurso
.
thumbnail
}
link
=
{
window
.
location
.
href
}
/
>
<
/Card
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
<
Card
>
{
/*add option to MoreVertIcon*/
}
{
/*change file size display*/
}
{
/*change render method on additional item info*/
}
<
Sobre
avatar
=
{
recurso
.
publisher
.
avatar
?
(
apiDomain
+
recurso
.
publisher
.
avatar
)
:
noAvatar
}
publisher
=
{
recurso
.
publisher
.
name
}
...
...
@@ -95,12 +138,24 @@ export default function LearningObjectPage (props){
/
>
<
/Card
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
<
Card
>
{
/*adicionar funcionalidade ao botao de entrar*/
}
<
CommentsArea
recursoId
=
{
id
}
handleSnackbar
=
{
handleSnackbar
}
/
>
<
/Card
>
<
/Grid
>
<
/Grid
>
]
)
}
<
/Background
>
<
/React.Fragment
>
)
}
...
...
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