Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit fa2e9bd

Browse files
sophieH29manajdov
authored and
manajdov
committed
fix(Prototype): Fix Popover prototype after breaking changes (#623)
1 parent 9909483 commit fa2e9bd

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

docs/src/prototypes/chatMessageWithPopover/ChatMessageWithPopover.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ import * as React from 'react'
44
import cx from 'classnames'
55
import Popover from './Popover'
66

7-
const janeAvatar = {
8-
image: 'public/images/avatar/small/ade.jpg',
9-
status: { color: 'green', icon: 'check' },
10-
}
11-
127
interface ChatMessageWithPopoverProps {
138
className?: string
149
}
@@ -51,7 +46,6 @@ class ChatMessageWithPopover extends React.Component<
5146
</div>
5247
),
5348
}}
54-
avatar={janeAvatar}
5549
onFocus={this.handleFocus}
5650
onBlur={this.handleBlur}
5751
className={cx(this.props.className, this.state.focused ? 'focused' : '')}

docs/src/prototypes/chatMessageWithPopover/ChatWithPopover.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import { Chat, Provider } from '@stardust-ui/react'
1+
import { Chat, Provider, Avatar } from '@stardust-ui/react'
22
import * as React from 'react'
33
import ChatMessageWithPopover from './ChatMessageWithPopover'
44

5+
const janeAvatar = {
6+
image: 'public/images/avatar/small/ade.jpg',
7+
status: { color: 'green', icon: 'check' },
8+
}
9+
510
const ChatWithPopover = () => (
611
<Provider
712
theme={{
@@ -45,9 +50,21 @@ const ChatWithPopover = () => (
4550
>
4651
<Chat
4752
items={[
48-
{ key: 'a', content: <ChatMessageWithPopover /> },
49-
{ key: 'b', content: <ChatMessageWithPopover /> },
50-
{ key: 'c', content: <ChatMessageWithPopover /> },
53+
{
54+
key: 'a',
55+
message: { content: <ChatMessageWithPopover /> },
56+
gutter: { content: <Avatar {...janeAvatar} /> },
57+
},
58+
{
59+
key: 'b',
60+
message: { content: <ChatMessageWithPopover /> },
61+
gutter: { content: <Avatar {...janeAvatar} /> },
62+
},
63+
{
64+
key: 'c',
65+
message: { content: <ChatMessageWithPopover /> },
66+
gutter: { content: <Avatar {...janeAvatar} /> },
67+
},
5168
]}
5269
/>
5370
</Provider>

0 commit comments

Comments
 (0)