-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fuselage): Update message metric styles and add Avatar row (#1417)
Co-authored-by: dougfabris <[email protected]>
- Loading branch information
1 parent
ad92257
commit b8441ee
Showing
13 changed files
with
381 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/fuselage": minor | ||
--- | ||
|
||
Updated message metric styles and added Avatar row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 14 additions & 11 deletions
25
packages/fuselage/src/components/Message/MessageBlock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import type { ComponentProps } from 'react'; | ||
import type { ComponentProps, Ref } from 'react'; | ||
import { forwardRef } from 'react'; | ||
|
||
import Box from '../Box'; | ||
|
||
type MessageBlockProps = { | ||
fixedWidth?: boolean; | ||
} & ComponentProps<typeof Box>; | ||
|
||
export const MessageBlock = ({ | ||
className: _className, | ||
fixedWidth, | ||
...props | ||
}: MessageBlockProps) => ( | ||
<Box | ||
rcx-message-block | ||
rcx-message-block--width-fixed={fixedWidth} | ||
{...props} | ||
/> | ||
export const MessageBlock = forwardRef( | ||
( | ||
{ className: _className, fixedWidth, ...props }: MessageBlockProps, | ||
ref: Ref<HTMLDivElement> | ||
) => ( | ||
<Box | ||
rcx-message-block | ||
rcx-message-block--width-fixed={fixedWidth} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
packages/fuselage/src/components/Message/MessageMetrics/MessageMetricsFollowing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
import type { ComponentProps } from 'react'; | ||
import type { ComponentProps, ReactElement } from 'react'; | ||
|
||
import { IconButton } from '../../Button'; | ||
|
||
type MessageMetricsFollowingProps = { | ||
name: 'bell' | 'bell-off'; | ||
badge?: ReactElement; | ||
} & Omit<ComponentProps<typeof IconButton>, 'icon'>; | ||
|
||
export const MessageMetricsFollowing = ({ | ||
name, | ||
badge, | ||
...props | ||
}: MessageMetricsFollowingProps) => <IconButton {...props} small icon={name} />; | ||
}: MessageMetricsFollowingProps) => ( | ||
<IconButton | ||
position='relative' | ||
overflow='visible' | ||
{...props} | ||
small | ||
icon={name} | ||
> | ||
{badge && ( | ||
<div className='rcx-message-metrics__item__follow-badge'>{badge}</div> | ||
)} | ||
</IconButton> | ||
); |
12 changes: 10 additions & 2 deletions
12
.../fuselage/src/components/Message/MessageMetrics/MessageMetricsItem/MessageMetricsItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import type { HTMLAttributes } from 'react'; | ||
|
||
import { prependClassName } from '../../../../helpers/prependClassName'; | ||
|
||
type MessageMetricsItemProps = HTMLAttributes<HTMLDivElement>; | ||
|
||
export const MessageMetricsItem = (props: MessageMetricsItemProps) => ( | ||
<div className='rcx-message-metrics__item' {...props} /> | ||
export const MessageMetricsItem = ({ | ||
className, | ||
...props | ||
}: MessageMetricsItemProps) => ( | ||
<div | ||
className={prependClassName(className, 'rcx-message-metrics__item')} | ||
{...props} | ||
/> | ||
); |
15 changes: 15 additions & 0 deletions
15
.../src/components/Message/MessageMetrics/MessageMetricsItem/MessageMetricsItemAvatarRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { HTMLAttributes } from 'react'; | ||
|
||
import { prependClassName } from '../../../../helpers/prependClassName'; | ||
|
||
type MessageMetricsItemProps = HTMLAttributes<HTMLDivElement>; | ||
|
||
export const MessageMetricsItemAvatarRow = ({ | ||
className, | ||
...props | ||
}: MessageMetricsItemProps) => ( | ||
<div | ||
className={prependClassName(className, 'rcx-message-metrics__avatar-row')} | ||
{...props} | ||
/> | ||
); |
18 changes: 18 additions & 0 deletions
18
...mponents/Message/MessageMetrics/MessageMetricsItem/MessageMetricsItemAvatarRowContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { HTMLAttributes } from 'react'; | ||
|
||
import { prependClassName } from '../../../../helpers/prependClassName'; | ||
|
||
type MessageMetricsItemProps = HTMLAttributes<HTMLDivElement>; | ||
|
||
export const MessageMetricsItemAvatarRowContent = ({ | ||
className, | ||
...props | ||
}: MessageMetricsItemProps) => ( | ||
<div | ||
className={prependClassName( | ||
className, | ||
'rcx-message-metrics__avatar-row__content' | ||
)} | ||
{...props} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.