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 55
feat(ChatMessage): add badge and badgePosition props #823
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0009793
wip
74a073e
-improved styles
b5c49f4
-added example for the badge prop
15ab7d0
Merge branch 'master' into feat/chat-message-badge
884e43d
-added example for the badge prop
2c7ad9e
-added className for the badge
09b8c6d
-fixed description of the badgePosition prop.
16d115e
-added zIndex to the styles for the badge
49e2576
-added box shadow to the chat badge
4ec54a2
Merge branch 'master' into feat/chat-message-badge
35cb1ed
-updated styled chat example
5cd1c7f
Merge branch 'master' into feat/chat-message-badge
mnajdova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
51 changes: 51 additions & 0 deletions
51
docs/src/examples/components/Chat/Types/ChatMessageExampleBadge.shorthand.tsx
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,51 @@ | ||
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="Hi, can we talk? It's important!" | ||
author="John Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
mine | ||
badge={{ | ||
icon: 'exclamation', | ||
color: 'red', | ||
}} | ||
badgePosition="start" | ||
/> | ||
), | ||
}, | ||
contentPosition: 'end', | ||
key: 'message-id-1', | ||
}, | ||
{ | ||
gutter: { content: <Avatar {...janeAvatar} /> }, | ||
message: { | ||
content: ( | ||
<Chat.Message | ||
content="Sure @John. Let's schedule a meeting." | ||
author="Jane Doe" | ||
timestamp="Yesterday, 10:15 PM" | ||
badge={{ | ||
icon: 'at', | ||
color: 'red', | ||
}} | ||
/> | ||
), | ||
}, | ||
attached: 'top', | ||
key: 'message-id-4', | ||
}, | ||
] | ||
|
||
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this default - lot of examples where badge appears at start