This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ChatMessage): add hasMention and isImportant variables in Teams …
…theme (#841) * -added hasMention and isImportant variables in teams theme * -update changelog * -updated example * -moved colors to variables * -added prototype -renamed mentionColor and importantColor to hasMentionColor and isImportantColor * -updated changelog
- Loading branch information
Showing
7 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import * as React from 'react' | ||
import { Avatar, Chat } from '@stardust-ui/react' | ||
|
||
const janeAvatar = { | ||
image: 'public/images/avatar/small/ade.jpg', | ||
status: { color: 'green', icon: 'check' }, | ||
} | ||
|
||
const items = [ | ||
{ | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="This is important message" | ||
author="John Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
mine | ||
badge={{ icon: 'redbang' }} | ||
variables={{ isImportant: true }} | ||
/> | ||
), | ||
}, | ||
contentPosition: 'end', | ||
attached: 'top', | ||
key: 'message-id-1', | ||
}, | ||
{ | ||
gutter: { content: <Avatar {...janeAvatar} /> }, | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="This is another important message (see how the borders radius respect the grouped ones)" | ||
author="Jane Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
badge={{ icon: 'redbang' }} | ||
variables={{ isImportant: true }} | ||
/> | ||
), | ||
}, | ||
attached: 'top', | ||
key: 'message-id-2', | ||
}, | ||
{ | ||
gutter: { content: <Avatar {...janeAvatar} /> }, | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="This is mention message @John" | ||
author="Jane Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
badge={{ icon: 'mention' }} | ||
variables={{ hasMention: true }} | ||
/> | ||
), | ||
}, | ||
attached: true, | ||
key: 'message-id-3', | ||
}, | ||
{ | ||
gutter: { content: <Avatar {...janeAvatar} /> }, | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="This is another mention message @John with custom color" | ||
author="Jane Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
badge={{ icon: 'mention' }} | ||
variables={siteVars => ({ hasMention: true, hasMentionColor: siteVars.brand })} | ||
/> | ||
), | ||
}, | ||
attached: 'bottom', | ||
key: 'message-id-4', | ||
}, | ||
{ | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="The color for the important messages can also be changed!" | ||
author="John Doe" | ||
timestamp="Yesterday, 10:16 PM" | ||
mine | ||
badge={{ icon: 'redbang' }} | ||
variables={siteVars => ({ isImportant: true, isImportantColor: siteVars.yellow })} | ||
/> | ||
), | ||
}, | ||
contentPosition: 'end', | ||
key: 'message-id-5', | ||
}, | ||
] | ||
|
||
const ChatExample = () => <Chat items={items} /> | ||
|
||
export default ChatExample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters