diff --git a/src/Components/ContactButtons/FollowButton.js b/src/Components/ContactButtons/FollowButton.js index 5594fa6619ba288e50f997c8f449039a0f0b828b..9666eeaeb2d81cb5aa0d181ab84f93876dc26b1b 100644 --- a/src/Components/ContactButtons/FollowButton.js +++ b/src/Components/ContactButtons/FollowButton.js @@ -51,7 +51,7 @@ export function NoIcon (props) { const handleFollow = (followerID) => { if (followerID !== undefined) { const url = `/users/${followerID}/follow/` - putRequest(url, {}, (data) => {console.log(data)}, (error) => {console.log(error)}) + putRequest(url, {}, (data) => {props.toggleFollowed()}, (error) => {console.log(error)}) } } diff --git a/src/Components/ContactButtons/FollowingButton.js b/src/Components/ContactButtons/FollowingButton.js index b2d22f248597fa5fd15f9289f7ea538ec2a8b2b5..88b9bc6a850a7405918c8fde7fdfbc342bbed3f7 100644 --- a/src/Components/ContactButtons/FollowingButton.js +++ b/src/Components/ContactButtons/FollowingButton.js @@ -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)` background-color : #00bcd4 !important; @@ -123,3 +135,21 @@ export const StyledButton = styled(Button)` 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; +` diff --git a/src/Pages/ResourcePage.js b/src/Pages/ResourcePage.js index 194807e62cc60998b5b1f470a2bf7decc803fef4..0c2346800c1fb04252d7ce81f2b58f0f1a3d87bb 100644 --- a/src/Pages/ResourcePage.js +++ b/src/Pages/ResourcePage.js @@ -218,6 +218,7 @@ export default function LearningObjectPage (props){ createdAt={recurso.created_at} updatedAt={recurso.updated_at} license={recurso.license} + followed={recurso.publisher.followed} /> </Card> </Grid>