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

fix(Text): apply display: inline-block only if the animation prop is provided while the Text is rendered as span #940

Merged
merged 5 commits into from
Feb 26, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixes
- Remove space between `Button.Group` items without `circular` prop @Bugaa92 ([#973](https://github.com/stardust-ui/react/pull/973))
- Fix allow `Text` component when rendered as div to behave as block element in Teams theme @mnajdova ([#940](https://github.com/stardust-ui/react/pull/940))

<!--------------------------------[ v0.22.1 ]------------------------------- -->
## [v0.22.1](https://github.com/stardust-ui/react/tree/v0.22.1) (2019-02-26)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ const ChatMessageExampleStyled = () => (
ChatMessage: {
root: { ...slotLabelStyles('chat-message-root'), backgroundColor: '#87CEFA' },
author: ({ props: { mine } }) => ({
...(!mine && { ...slotLabelStyles('author'), backgroundColor: '#E0FFFF' }),
...(!mine && {
...slotLabelStyles('author', {}, { display: 'inline-block' }),
backgroundColor: '#E0FFFF',
}),
}),
content: { ...slotLabelStyles('content'), backgroundColor: '#F08080' },
timestamp: { ...slotLabelStyles('timestamp'), backgroundColor: '#FFFFE0' },
timestamp: {
...slotLabelStyles('timestamp', {}, { display: 'inline-block' }),
backgroundColor: '#FFFFE0',
},
badge: {
...slotLabelStyles(
'badge',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { TextProps } from '../../../../components/Text/Text'
export default {
root: ({
props: {
as,
animation,
atMention,
color,
disabled,
Expand All @@ -21,7 +23,11 @@ export default {
variables: v,
}: ComponentStyleFunctionParam<TextProps, TextVariables>): ICSSInJSStyle => {
return {
display: 'inline-block',
// animations are not working with span, unless display is set to 'inline-block'
...(animation &&
as === 'span' && {
display: 'inline-block',
}),
...(atMention === true && {
color: v.atMentionOtherColor,
}),
Expand Down