From 11855d15856a05366f4602a9b49b82a1ce0ca9bd Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Thu, 16 Sep 2021 16:44:00 -0500 Subject: [PATCH] Make `onHeightChange` a required prop of `` --- .../conversation/ConversationHero.stories.tsx | 14 ++++++++++++++ ts/components/conversation/ConversationHero.tsx | 4 ++-- ts/components/conversation/Timeline.stories.tsx | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ts/components/conversation/ConversationHero.stories.tsx b/ts/components/conversation/ConversationHero.stories.tsx index 5fe6b7faa..c69bd029e 100644 --- a/ts/components/conversation/ConversationHero.stories.tsx +++ b/ts/components/conversation/ConversationHero.stories.tsx @@ -40,6 +40,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={['NYC Rock Climbers', 'Dinner Party', 'Friends 🌿']} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -61,6 +62,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={['NYC Rock Climbers', 'Dinner Party']} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -82,6 +84,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={['NYC Rock Climbers']} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -103,6 +106,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -124,6 +128,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -145,6 +150,7 @@ storiesOf('Components/Conversation/ConversationHero', module) updateSharedGroups={updateSharedGroups} sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} + onHeightChange={action('onHeightChange')} /> ); @@ -165,6 +171,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -185,6 +192,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -203,6 +211,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -221,6 +230,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -240,6 +250,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -259,6 +270,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -277,6 +289,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); @@ -294,6 +307,7 @@ storiesOf('Components/Conversation/ConversationHero', module) sharedGroupNames={[]} unblurAvatar={action('unblurAvatar')} updateSharedGroups={updateSharedGroups} + onHeightChange={action('onHeightChange')} /> ); diff --git a/ts/components/conversation/ConversationHero.tsx b/ts/components/conversation/ConversationHero.tsx index 014e920ac..4d6dfbbb0 100644 --- a/ts/components/conversation/ConversationHero.tsx +++ b/ts/components/conversation/ConversationHero.tsx @@ -19,7 +19,7 @@ export type Props = { i18n: LocalizerType; isMe: boolean; membersCount?: number; - onHeightChange?: () => unknown; + onHeightChange: () => unknown; phoneNumber?: string; sharedGroupNames?: Array; unblurAvatar: () => void; @@ -134,7 +134,7 @@ export const ConversationHero = ({ } window.log.info('ConversationHero: calling onHeightChange'); - onHeightChange?.(); + onHeightChange(); }, [ about, conversationType, diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index 1ffefe6ea..0bc3bb698 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -418,6 +418,7 @@ const renderHeroRow = () => ( profileName={getProfileName()} phoneNumber={getPhoneNumber()} conversationType="direct" + onHeightChange={action('onHeightChange in ConversationHero')} sharedGroupNames={['NYC Rock Climbers', 'Dinner Party']} unblurAvatar={action('unblurAvatar')} updateSharedGroups={noop}