diff --git a/.changeset/spicy-ghosts-grin.md b/.changeset/spicy-ghosts-grin.md new file mode 100644 index 00000000..f614ff74 --- /dev/null +++ b/.changeset/spicy-ghosts-grin.md @@ -0,0 +1,5 @@ +--- +"react-share": minor +--- + +Add content field to TumblrShareButton diff --git a/README.md b/README.md index d5860201..1d3ab9b9 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,7 @@ Optional props: - `tags` (`string[]`): Tags to attach to the post. - `caption` (`string`): Description shown with the shared page. - `posttype` (`string`, default `"link"`): Tumblr post type. +- `content` (`string`): The content for some post types. See [Tumblr's documentation](https://help.tumblr.com/knowledge-base/share-button-documentation/) for details. ```jsx import { TumblrShareButton, TumblrIcon } from "react-share"; diff --git a/src/TumblrShareButton.tsx b/src/TumblrShareButton.tsx index f469f664..6d37c948 100644 --- a/src/TumblrShareButton.tsx +++ b/src/TumblrShareButton.tsx @@ -10,7 +10,14 @@ function tumblrLink( caption, tags, posttype, - }: { title?: string; caption?: string; tags?: string; posttype?: 'link' | string }, + content, + }: { + title?: string; + caption?: string; + tags?: string; + posttype?: 'link' | string; + content?: string; + }, ) { assert(url, 'tumblr.url'); @@ -22,6 +29,7 @@ function tumblrLink( caption, tags, posttype, + content, }) ); } @@ -29,14 +37,15 @@ function tumblrLink( type Options = { title?: string; caption?: string; - posttype?: 'link' | string; + posttype?: 'link' | 'text' | 'quote' | 'photo' | 'chat' | 'video' | string; + content?: string; }; type TumblrShareButtonProps = Omit, 'title'> & Options & { tags?: string[] }; const TumblrShareButton = forwardRef( - ({ caption, posttype, tags, title, ...props }, ref) => ( + ({ caption, posttype, tags, title, content, ...props }, ref) => ( ( tags: (tags || []).join(','), caption, posttype: posttype || 'link', + content, }} windowHeight={460} windowWidth={660}