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

feat(Chat): add props interface #131

Merged
merged 4 commits into from
Aug 24, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/src/examples/components/Chat/Types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ const Types = () => (
description="A default Chat."
examplePath="components/Chat/Types/ChatExample"
/>
<ComponentExample
title="Shorthand"
description="Chat messages can be defined with shorthand."
examplePath="components/Chat/Types/ChatExample"
/>
</ExampleSection>
)

Expand Down
14 changes: 12 additions & 2 deletions src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ import * as _ from 'lodash'
import * as PropTypes from 'prop-types'
import * as React from 'react'

import { childrenExist, customPropTypes, UIComponent } from '../../lib'
import { childrenExist, customPropTypes, UIComponent, Extendable } from '../../lib'
import ChatMessage from './ChatMessage'
import { ComponentVariablesInput, IComponentPartStylesInput } from '../../../types/theme'

export interface IChatProps {
as?: any
className?: string
children?: React.ReactNode
messages?: any[]
styles?: IComponentPartStylesInput
variables?: ComponentVariablesInput
}

class Chat extends UIComponent<any, any> {
class Chat extends UIComponent<Extendable<IChatProps>, any> {
static className = 'ui-chat'

static displayName = 'Chat'
Expand Down