Browse Source

Use vh instead of % to fix storybook rendering of chat container.

pull/2032/head
Gabe Kangas 4 years ago
parent
commit
0574725be8
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 2
      web/components/chat/ChatContainer/ChatContainer.tsx
  2. 4
      web/stories/ChatContainer.stories.tsx

2
web/components/chat/ChatContainer/ChatContainer.tsx

@ -102,7 +102,7 @@ export default function ChatContainer(props: Props) { @@ -102,7 +102,7 @@ export default function ChatContainer(props: Props) {
() => (
<>
<Virtuoso
style={{ height: 'calc(100% - 110px)', width: 'auto' }}
style={{ height: 'calc(100vh - 170px)', width: 'auto' }}
ref={chatContainerRef}
initialTopMostItemIndex={messages.length - 1} // Force alignment to bottom
data={messages}

4
web/stories/ChatContainer.stories.tsx

@ -35,8 +35,8 @@ const AddMessagesChatExample = args => { @@ -35,8 +35,8 @@ const AddMessagesChatExample = args => {
</button>
<ChatContainer
messages={chatMessages}
usernameToHighlight={null}
chatUserId={null}
usernameToHighlight="testuser"
chatUserId="testuser"
isModerator={false}
isMobile={false}
/>

Loading…
Cancel
Save