Skip to content
Snippets Groups Projects
Commit edae67eb authored by Raul Almeida's avatar Raul Almeida
Browse files

WIP Collection Page

parent 000a303d
No related branches found
No related tags found
5 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system,!32Homologa,!23Tela de coleção
...@@ -19,6 +19,7 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/> ...@@ -19,6 +19,7 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>
import React from 'react'; import React from 'react';
import { Grid } from '@material-ui/core'; import { Grid } from '@material-ui/core';
import styled from 'styled-components'; import styled from 'styled-components';
import { Link } from 'react-router-dom';
import CircularProgress from '@material-ui/core/CircularProgress'; import CircularProgress from '@material-ui/core/CircularProgress';
import LinearProgress from '@material-ui/core/LinearProgress'; import LinearProgress from '@material-ui/core/LinearProgress';
...@@ -30,13 +31,19 @@ export default function CollectionAuthor(props) { ...@@ -30,13 +31,19 @@ export default function CollectionAuthor(props) {
justify="center" justify="center"
alignItems="center"> alignItems="center">
{props.imgsrc ? {props.imgsrc ?
<UserAvatar src={props.imgsrc}/> <UserLink
to={`/usuario-publico/${props.author_id}`}
>
<UserAvatar src={props.imgsrc}/>
</UserLink>
: :
<CircularProgress color="secondary"/> <CircularProgress color="secondary"/>
} }
<InfoText>Coleção organizada por:</InfoText> <InfoText>Coleção organizada por:</InfoText>
{props.name ? {props.name ?
<UserName>{props.name}</UserName> <UserLink to={`/usuario-publico/${props.author_id}`} >
<UserName>{props.name}</UserName>
</UserLink>
: :
<CircularProgress /> <CircularProgress />
} }
...@@ -58,3 +65,9 @@ const UserName = styled.h1` ...@@ -58,3 +65,9 @@ const UserName = styled.h1`
margin-top: 10px; margin-top: 10px;
color: #673ab7; color: #673ab7;
` `
const UserLink = styled(Link)`
text-decoration: none;
&:focus, &:hover, &:visited, &:link, &:active {
text-decoration: none;
}
`
...@@ -56,6 +56,7 @@ export default function CollectionPage(props) { ...@@ -56,6 +56,7 @@ export default function CollectionPage(props) {
<Grid item xs={10} md={3}> <Grid item xs={10} md={3}>
<CollectionAuthor <CollectionAuthor
author_id={collection.owner ? collection.owner.id : 0}
name={collection.owner ? collection.owner.name : ""} name={collection.owner ? collection.owner.name : ""}
imgsrc={collection.owner ? apiDomain+collection.owner.avatar : ''}/> imgsrc={collection.owner ? apiDomain+collection.owner.avatar : ''}/>
</Grid> </Grid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment