Skip to content

Commit

Permalink
Merge pull request #42 from citrusbyte/feature/social-share
Browse files Browse the repository at this point in the history
Share publications to corporations
AquiGorka authored Oct 18, 2017
2 parents 1cd1b39 + 2c0aa02 commit c484781
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/thicket-webapp/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"type": "git",
"url": "https://github.com/citrusbyte/thicket"
},
"homepage": "https://thicket.citrusbyte.com",
"homepage": "https://thicket.surge.sh",
"dependencies": {
"autoprefixer": "7.1.2",
"babel-core": "6.25.0",
10 changes: 10 additions & 0 deletions packages/thicket-webapp/src/App/Publication/index.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@ import React from 'react'
import { deleteImage } from '../syncedDB'
import { Cancel as DeleteIcon } from '../NavLinks'
import './Publication.css'
import { homepage } from '../../../package.json'

const twitterURL = 'https://twitter.com/intent/tweet'
const facebookURL = 'https://www.facebook.com/sharer.php'

const del = (history, id) => () => {
deleteImage(id)
@@ -11,6 +15,7 @@ const del = (history, id) => () => {
export default ({publications, match, history}) => {
const id = match.params.id
const gif = publications[id]
const url = `${homepage}/${id}`

return <div className="publication">
<div className="publication__content">
@@ -20,8 +25,13 @@ export default ({publications, match, history}) => {
alt=""
/>
</div>
<div>
<a href={`${twitterURL}?url=${url}`} target="_blank">tweet this</a>
<a href={`${facebookURL}?u=${url}`} target="_blank">post to facebook</a>
</div>
<div className="publication__controls">
<DeleteIcon onClick={del(history, id)} alt="Delete GIF" />
</div>
</div>
}

0 comments on commit c484781

Please sign in to comment.