Add user badges to typing bubbles, refactor typing logic

This commit is contained in:
Evan Hahn 2021-11-15 14:01:58 -06:00 committed by GitHub
parent ede34ecee3
commit f4e336836f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 125 additions and 189 deletions

View file

@ -10,6 +10,8 @@ import enMessages from '../../../_locales/en/messages.json';
import type { Props } from './TypingBubble';
import { TypingBubble } from './TypingBubble';
import { AvatarColors } from '../../types/Colors';
import { getFakeBadge } from '../../test-both/helpers/getFakeBadge';
import { ThemeType } from '../../types/Util';
const i18n = setupI18n('en', enMessages);
@ -17,6 +19,7 @@ const story = storiesOf('Components/Conversation/TypingBubble', module);
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
acceptedMessageRequest: true,
badge: overrideProps.badge,
isMe: false,
i18n,
color: select(
@ -33,6 +36,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
overrideProps.conversationType || 'direct'
),
sharedGroupNames: [],
theme: ThemeType.light,
});
story.add('Direct', () => {
@ -46,3 +50,12 @@ story.add('Group', () => {
return <TypingBubble {...props} />;
});
story.add('Group (with badge)', () => {
const props = createProps({
badge: getFakeBadge(),
conversationType: 'group',
});
return <TypingBubble {...props} />;
});