Skip to content
Snippets Groups Projects
Commit 2f957076 authored by Lucas Eduardo Schoenfelder's avatar Lucas Eduardo Schoenfelder
Browse files

fixed not being able to follow the author of a learning object

parent b336a60c
No related branches found
No related tags found
3 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system
...@@ -51,7 +51,7 @@ export function NoIcon (props) { ...@@ -51,7 +51,7 @@ export function NoIcon (props) {
const handleFollow = (followerID) => { const handleFollow = (followerID) => {
if (followerID !== undefined) { if (followerID !== undefined) {
const url = `/users/${followerID}/follow/` const url = `/users/${followerID}/follow/`
putRequest(url, {}, (data) => {console.log(data)}, (error) => {console.log(error)}) putRequest(url, {}, (data) => {props.toggleFollowed()}, (error) => {console.log(error)})
} }
} }
......
...@@ -78,6 +78,18 @@ export default function FollowingButton (props) { ...@@ -78,6 +78,18 @@ export default function FollowingButton (props) {
) )
} }
export function NoIconFollowing (props) {
const handleFollow = (unfollowID) => {
const url = `/users/${unfollowID}/follow/`
putRequest(url, {}, (data) => {props.toggleFollowed()}, (error) => {console.log(error)})
}
return (
<NoIconButton onClick={() => handleFollow(props.followableID)}>seguindo</NoIconButton>
)
}
export const StyledButton = styled(Button)` export const StyledButton = styled(Button)`
background-color : #00bcd4 !important; background-color : #00bcd4 !important;
...@@ -123,3 +135,21 @@ export const StyledButton = styled(Button)` ...@@ -123,3 +135,21 @@ export const StyledButton = styled(Button)`
color : #fff !important; color : #fff !important;
} }
` `
const NoIconButton = styled(Button)`
.MuiButton-label {
color : #00bcd4 !important;
}
background-color : #fff !important;
border : solid 1px rgba(0,188,212,.85) !important;
font-size : 14px !important;
border-radius : 3px !important;
height : 36px !important;
min-width : 88px !important;
vertical-align : middle !important;
text-color : #00bcd4 !important;
align-items : center !important;
text-align : center !important;
padding : 0 6px !important;
margin : 6px 8px !important;
`
...@@ -218,6 +218,7 @@ export default function LearningObjectPage (props){ ...@@ -218,6 +218,7 @@ export default function LearningObjectPage (props){
createdAt={recurso.created_at} createdAt={recurso.created_at}
updatedAt={recurso.updated_at} updatedAt={recurso.updated_at}
license={recurso.license} license={recurso.license}
followed={recurso.publisher.followed}
/> />
</Card> </Card>
</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