|
Download wp-calypso/client/blocks/follow-button/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/follow-button/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/blocks/follow-button/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/follow-button/README.md
1.07 kB
Follow Button
This component is used to display a follow/unfollow button. It has two parts, the actual button and a container that works with Redux state. For most uses, the container is the easiest route.
How to use the container
import FollowButtonContainer from 'calypso/blocks/follow-button';
function render() {
return (
<div className="your-stuff">
<FollowButtonContainer siteUrl="http://trailnose.com" />
</div>
);
}
Props
siteUrl: string, a site URL to follow or unfollow
How to use the button directly
import FollowButton from 'calypso/blocks/follow-button/button';
function render() {
return (
<div className="your-stuff">
<FollowButton following={ false } />
</div>
);
}
Props
following: (default: false) a boolean indicating if the current user is currently following the site URLdisabled: (default: false) a boolean indicating if the button is currently disabledhasButtonStyle: (default: false) a boolean indicating if the button should use a style with a button shape/border