@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
53 lines (44 loc) • 1.49 kB
TypeScript
import { LoadingButtonProps } from '@mui/lab';
import { SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
export interface VoteButtonProps extends Pick<LoadingButtonProps, Exclude<keyof LoadingButtonProps, 'onClick' | 'disabled' | 'loading'>> {
/**
* Id of the contribution object to vote
* @default null
*/
contributionId: number;
/**
* Type of the contribution object to vote
* @default null
*/
contributionType: SCContributionType;
/**
* Contribution object to vote
* @default null
*/
contribution?: SCFeedObjectType | SCCommentType | null;
/**
* onVote callback
* @default null
*/
onVote?: (contribution: SCFeedObjectType | SCCommentType) => any;
/**
* Others properties
*/
[p: string]: any;
}
/**
* > API documentation for the Community-JS Vote Button component. Learn about the available props and the CSS API.
#### Import
```jsx
import {VoteAudienceButton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCVoteButton` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCVoteButton-root|Styles applied to the root element.|
|voted|.SCVoteButton-voted|Styles applied to the root element when the user has vote the contribution.|
* @param inProps
*/
export default function VoteButton(inProps: VoteButtonProps): JSX.Element;