diff --git a/src/components/Reactions/Reaction.tsx b/src/components/Reactions/Reaction.tsx index bd96324..86de1e6 100644 --- a/src/components/Reactions/Reaction.tsx +++ b/src/components/Reactions/Reaction.tsx @@ -9,7 +9,7 @@ import {useReactionsPopup} from './hooks'; export type ReactionProps = Pick; -export interface ReactionStateProps { +export interface ReactionState { /** * Reaction's unique value (ID). */ @@ -31,7 +31,7 @@ export interface ReactionStateProps { } interface ReactionInnerProps extends Pick { - reaction: ReactionStateProps; + reaction: ReactionState; size: ButtonSize; tooltipBehavior: 'tooltip' | 'popover'; onClick?: (value: string) => void; @@ -59,25 +59,24 @@ export function Reaction(props: ReactionInnerProps) { const {openedTooltip: currentHoveredReaction} = useReactionsContext(); const button = ( - - - + + {content} + + {counter === undefined || counter === null ? null : ( + {counter} + )} + ); return tooltip ? ( diff --git a/src/components/Reactions/Reactions.scss b/src/components/Reactions/Reactions.scss index 19fd75a..1d4873a 100644 --- a/src/components/Reactions/Reactions.scss +++ b/src/components/Reactions/Reactions.scss @@ -15,35 +15,38 @@ $block: '.#{variables.$ns}reactions'; max-width: unset; } - &__reaction-button_size_xs { + &__reaction-button-content_size_xs { font-size: 12px; } - &__reaction-button_size_s { - font-size: 16px; - } - &__reaction-button_size_m { - font-size: 16px; + &__reaction-button-content_size_xs#{&}__reaction-button-content_text { + font-size: var(--g-text-caption-1-font-size); } - &__reaction-button_size_l { + + &__reaction-button-content_size_s { font-size: 16px; } - &__reaction-button_size_xl { - font-size: 20px; + &__reaction-button-content_size_s#{&}__reaction-button-content_text { + font-size: var(--g-text-caption-2-font-size); } - &__reaction-button-text_size_xs { - font-size: var(--g-text-caption-1-font-size); - } - &__reaction-button-text_size_s { - font-size: var(--g-text-caption-2-font-size); + &__reaction-button-content_size_m { + font-size: 16px; } - &__reaction-button-text_size_m { + &__reaction-button-content_size_m#{&}__reaction-button-content_text { font-size: var(--g-text-body-1-font-size); } - &__reaction-button-text_size_l { + + &__reaction-button-content_size_l { + font-size: 16px; + } + &__reaction-button-content_size_l#{&}__reaction-button-content_text { font-size: var(--g-text-subheader-1-font-size); } - &__reaction-button-text_size_xl { + + &__reaction-button-content_size_xl { + font-size: 20px; + } + &__reaction-button-content_size_xl#{&}__reaction-button-content_text { font-size: var(--g-text-subheader-2-font-size); } } diff --git a/src/components/Reactions/Reactions.tsx b/src/components/Reactions/Reactions.tsx index 2259f93..374ca69 100644 --- a/src/components/Reactions/Reactions.tsx +++ b/src/components/Reactions/Reactions.tsx @@ -16,8 +16,9 @@ import xor from 'lodash/xor'; import {block} from '../utils/cn'; -import {Reaction, ReactionProps, ReactionStateProps} from './Reaction'; +import {Reaction, ReactionProps, ReactionState} from './Reaction'; import {ReactionsContextProvider, ReactionsContextTooltipProps} from './context'; +import {i18n} from './i18n'; import './Reactions.scss'; @@ -36,7 +37,7 @@ export interface ReactionsProps extends Pick, QAProps, DOM /** * Users' reactions. */ - reactionsState: ReactionStateProps[]; + reactionsState: ReactionState[]; /** * Reactions' palette props. */ @@ -155,11 +156,13 @@ export function Reactions({ tooltipContentClassName={b('add-reaction-popover')} openOnHover={false} hasArrow={false} + focusTrap + autoFocus >