Skip to content

Commit 609bf2d

Browse files
authored
fix(fuselage): Reaction list not wrapping (#843)
1 parent 2957704 commit 609bf2d

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

packages/fuselage/src/components/Message/MessageReactions/MessageReactions.styles.scss

+10
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@
77
@use '../mixins.scss';
88

99
.rcx-message-reactions {
10+
&__container {
11+
display: flex;
12+
flex-flow: row wrap;
13+
justify-content: flex-start;
14+
15+
margin: lengths.margin(-2);
16+
}
17+
1018
&__reaction {
1119
@include button.kind-variant(buttons.$icon);
1220
@include typography.use-font-scale(c1);
1321
display: inline-flex;
1422
align-items: center;
1523

24+
margin: lengths.margin(2);
25+
1626
padding: lengths.padding(2);
1727

1828
cursor: pointer;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import type { ComponentProps } from 'react';
1+
import type { ReactNode } from 'react';
22
import React from 'react';
33

4-
import { ButtonGroup } from '../..';
54
import { MessageBlock } from '../MessageBlock';
65

7-
type MessageReactionsProps = ComponentProps<typeof ButtonGroup>;
6+
type MessageReactionsProps = { children: ReactNode };
87

98
export const MessageReactions = (props: MessageReactionsProps) => (
109
<MessageBlock className='rcx-message-reactions'>
11-
<ButtonGroup {...{ small: true }} {...props} />
10+
<div className='rcx-message-reactions__container' {...props} />
1211
</MessageBlock>
1312
);

packages/fuselage/src/components/Message/Messages.stories.tsx

+44
Original file line numberDiff line numberDiff line change
@@ -728,3 +728,47 @@ export const MessageWithMetrics: ComponentStory<typeof Message> = () => (
728728
</Message>
729729
</Box>
730730
);
731+
732+
export const LotsOfReactions: ComponentStory<typeof Message> = () => (
733+
<Box>
734+
<MessageDivider>May, 24, 2020</MessageDivider>
735+
<Message className='customclass' clickable>
736+
<Message.LeftContainer>
737+
<Avatar url={avatarUrl} size={'x36'} />
738+
</Message.LeftContainer>
739+
<Message.Container>
740+
<Message.Header>
741+
<Message.Name>Haylie George</Message.Name>
742+
<Message.Username>@haylie.george</Message.Username>
743+
<Message.Roles>
744+
<Message.Role>Admin</Message.Role>
745+
<Message.Role>User</Message.Role>
746+
<Message.Role>Owner</Message.Role>
747+
</Message.Roles>
748+
<Message.Timestamp>12:00 PM</Message.Timestamp>
749+
</Message.Header>
750+
<Message.Body>
751+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
752+
nisi ut aliquip ex ea commodo consequat a duis aute irure dolor in
753+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
754+
pariatur. Consectetur adipiscing elit, sed do eiusmod tempor
755+
incididunt ut labore et dolore magna aliqua. Ut enim ad minim
756+
veniam...
757+
</Message.Body>
758+
<MessageReactions>
759+
{Array.from({ length: 100 }).map((_, index) => (
760+
<MessageReactions.Reaction counter={index} mine={!(index % 3)} />
761+
))}
762+
<MessageReactions.Action />
763+
</MessageReactions>
764+
</Message.Container>
765+
<MessageToolbox.Wrapper>
766+
<MessageToolbox>
767+
<MessageToolbox.Item icon='quote' />
768+
<MessageToolbox.Item icon='clock' />
769+
<MessageToolbox.Item icon='thread' />
770+
</MessageToolbox>
771+
</MessageToolbox.Wrapper>
772+
</Message>
773+
</Box>
774+
);

0 commit comments

Comments
 (0)