diff --git a/src/components/Reactions/README.md b/src/components/Reactions/README.md index 94711f1..bff5943 100644 --- a/src/components/Reactions/README.md +++ b/src/components/Reactions/README.md @@ -83,20 +83,20 @@ For more code examples go to [Reactions.stories.tsx](https://github.com/gravity- **ReactionsProps** (main component props — Reactions' list): -| Property | Type | Required | Default | Description | -| :------------------ | :------------------------------------------ | :------: | :------ | :--------------------------------------------------------------------------------------------- | -| `addButtonPosition` | `'start' or 'end'` | | `'end'` | Position of the "Add reaction" button. | -| `className` | `string` | | | HTML `class` attribute | -| `hideAddButton` | `boolean` | | `false` | Should we hide the "Add reaction" button. | -| `onToggle` | `(value: string) => void` | | | Fires when a user clicks on a Reaction (in a Palette or in the Reactions' list) | -| `paletteProps` | `ReactionsPaletteProps` | `true` | | Notifications' palette props — it's a `Palette` component with available reactions to the user | -| `qa` | `string` | | | `qa` attribute for testing | -| `reactions` | `PaletteOption[]` | `true` | | List of all available reactions | -| `reactionsState` | `ReactionState[]` | `true` | | List of reactions that were used | -| `readOnly` | `boolean` | | `false` | readOnly state (usage example: only signed in users can react) | -| `renderTooltip` | `(state: ReactionState) => React.ReactNode` | | | Reaction's tooltip with the list of reacted users for example | -| `size` | `ButtonSize` | | `m` | Buttons's size | -| `style` | `React.CSSProperties` | | | HTML `style` attribute | +| Property | Type | Required | Default | Description | +| :------------------- | :------------------------------------------ | :------: | :------ | :--------------------------------------------------------------------------------------------- | +| `addButtonPlacement` | `'start' or 'end'` | | `'end'` | Position of the "Add reaction" button. | +| `className` | `string` | | | HTML `class` attribute | +| `hideAddButton` | `boolean` | | `false` | Should we hide the "Add reaction" button. | +| `onToggle` | `(value: string) => void` | | | Fires when a user clicks on a Reaction (in a Palette or in the Reactions' list) | +| `paletteProps` | `ReactionsPaletteProps` | `true` | | Notifications' palette props — it's a `Palette` component with available reactions to the user | +| `qa` | `string` | | | `qa` attribute for testing | +| `reactions` | `PaletteOption[]` | `true` | | List of all available reactions | +| `reactionsState` | `ReactionState[]` | `true` | | List of reactions that were used | +| `readOnly` | `boolean` | | `false` | readOnly state (usage example: only signed in users can react) | +| `renderTooltip` | `(state: ReactionState) => React.ReactNode` | | | Reaction's tooltip with the list of reacted users for example | +| `size` | `ButtonSize` | | `m` | Buttons's size | +| `style` | `React.CSSProperties` | | | HTML `style` attribute | **ReactionState** (single reaction props): diff --git a/src/components/Reactions/Reactions.tsx b/src/components/Reactions/Reactions.tsx index 39415d2..1def2b2 100644 --- a/src/components/Reactions/Reactions.tsx +++ b/src/components/Reactions/Reactions.tsx @@ -51,7 +51,7 @@ export interface ReactionsProps extends Pick, QAProps, DOM * * @default 'end' */ - addButtonPosition?: 'start' | 'end'; + addButtonPlacement?: 'start' | 'end'; /** * Should we hide the "Add reaction" button. * @@ -86,7 +86,7 @@ export function Reactions({ paletteProps, readOnly, qa, - addButtonPosition = 'end', + addButtonPlacement = 'end', hideAddButton = false, renderTooltip, onToggle, @@ -166,7 +166,7 @@ export function Reactions({ }} > - {!hideAddButton && addButtonPosition === 'start' ? addReactionButton : null} + {!hideAddButton && addButtonPlacement === 'start' ? addReactionButton : null} {/* Reactions' list */} {reactionsState.map((reaction) => { @@ -184,7 +184,7 @@ export function Reactions({ ); })} - {!hideAddButton && addButtonPosition === 'end' ? addReactionButton : null} + {!hideAddButton && addButtonPlacement === 'end' ? addReactionButton : null} ); diff --git a/src/components/Reactions/__stories__/Reactions.stories.tsx b/src/components/Reactions/__stories__/Reactions.stories.tsx index dc605be..0551eec 100644 --- a/src/components/Reactions/__stories__/Reactions.stories.tsx +++ b/src/components/Reactions/__stories__/Reactions.stories.tsx @@ -65,16 +65,16 @@ export const Size: StoryFn = () => { ); }; -export const AddButtonPosition: StoryFn = () => { +export const AddButtonPlacement: StoryFn = () => { return ( Start - + End - + Hide