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

fix(Prototype): Fix Popover prototype after breaking changes #623

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import * as React from 'react'
import cx from 'classnames'
import Popover from './Popover'

const janeAvatar = {
image: 'public/images/avatar/small/ade.jpg',
status: { color: 'green', icon: 'check' },
}

interface ChatMessageWithPopoverProps {
className?: string
}
Expand Down Expand Up @@ -51,7 +46,6 @@ class ChatMessageWithPopover extends React.Component<
</div>
),
}}
avatar={janeAvatar}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
className={cx(this.props.className, this.state.focused ? 'focused' : '')}
Expand Down
25 changes: 21 additions & 4 deletions docs/src/prototypes/chatMessageWithPopover/ChatWithPopover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Chat, Provider } from '@stardust-ui/react'
import { Chat, Provider, Avatar } from '@stardust-ui/react'
import * as React from 'react'
import ChatMessageWithPopover from './ChatMessageWithPopover'

const janeAvatar = {
image: 'public/images/avatar/small/ade.jpg',
status: { color: 'green', icon: 'check' },
}

const ChatWithPopover = () => (
<Provider
theme={{
Expand Down Expand Up @@ -45,9 +50,21 @@ const ChatWithPopover = () => (
>
<Chat
items={[
{ key: 'a', content: <ChatMessageWithPopover /> },
{ key: 'b', content: <ChatMessageWithPopover /> },
{ key: 'c', content: <ChatMessageWithPopover /> },
{
key: 'a',
message: { content: <ChatMessageWithPopover /> },
gutter: { content: <Avatar {...janeAvatar} /> },
},
{
key: 'b',
message: { content: <ChatMessageWithPopover /> },
gutter: { content: <Avatar {...janeAvatar} /> },
},
{
key: 'c',
message: { content: <ChatMessageWithPopover /> },
gutter: { content: <Avatar {...janeAvatar} /> },
},
]}
/>
</Provider>
Expand Down