-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from kronaemmanuel/shareCTA
Sharing buttons on both Country and Measurement pages
- Loading branch information
Showing
5 changed files
with
74 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { Link, Flex } from 'ooni-components' | ||
import { Text } from 'rebass' | ||
import { MdShare } from 'react-icons/lib/md' | ||
|
||
function SocialButtons({ url }){ | ||
const text = 'Data from OONI Explorer'; | ||
return( | ||
<Flex px={2} alignItems='center'> | ||
<MdShare height='20px' width='20px'/> | ||
<Text pl={2} textAlign='right'> | ||
Share on | ||
<Link color='blue7' target="_blank" href={`https://www.facebook.com/sharer/sharer.php?u=https://explorer.ooni.org/${url}`}> Facebook </Link> | ||
or | ||
<Link color='blue7' target="_blank" href={`https://twitter.com/intent/tweet?text=${text}&url=https://explorer.ooni.org/${url}`}> Twitter</Link> | ||
</Text> | ||
</Flex> | ||
) | ||
} | ||
|
||
SocialButtons.propTypes = { | ||
url: PropTypes.string.isRequired | ||
} | ||
|
||
export default SocialButtons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters