Skip to content

Commit

Permalink
Removed marginRight from all message root styles. Fixes #981.
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCStewart committed Nov 15, 2017
1 parent 63df8e0 commit bae8e5e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
36 changes: 22 additions & 14 deletions docs/src/components/message.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ class MessageDoc extends Component {
compact: false,
iconMenu: false,
edited: false,
multiline: false
multiline: false,
avatar: true
};
}

Expand All @@ -140,7 +141,10 @@ class MessageDoc extends Component {

selectMultiline = (event, multiline) => this.setState({ multiline })

selectAvatar = (event, avatar) => this.setState({ avatar });

render() {
const { collapsed, fontSize, compact, iconMenu, edited, multiline, avatar } = this.state;
const componentData = _.find(components, component => component.displayName === 'Message');
const style = {
paper: {
Expand Down Expand Up @@ -193,28 +197,32 @@ class MessageDoc extends Component {
<section>
<h1>Examples</h1>
<div style={style.options}>
<Select style={style.select} label="Collapsed images" value={this.state.collapsed} onChange={this.selectCollapse}>
<Select style={style.select} label="Collapsed images" value={collapsed} onChange={this.selectCollapse}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
<Select style={style.select} label="Font size" value={this.state.fontSize} onChange={this.selectFontSize}>
<Select style={style.select} label="Font size" value={fontSize} onChange={this.selectFontSize}>
<MenuItem text="Small" value="small" />
<MenuItem text="Medium" value="medium" />
<MenuItem text="Large" value="large" />
</Select>
<Select style={style.select} label="Compact messages" value={this.state.compact} onChange={this.selectCompact}>
<Select style={style.select} label="Compact messages" value={compact} onChange={this.selectCompact}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
<Select style={style.select} label="Icon menu" value={iconMenu} onChange={this.selectIconMenu}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
<Select style={style.select} label="Icon menu" value={this.state.iconMenu} onChange={this.selectIconMenu}>
<Select style={style.select} label="Edited messages" value={edited} onChange={this.selectEdited}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
<Select style={style.select} label="Edited messages" value={this.state.edited} onChange={this.selectEdited}>
<Select style={style.select} label="Enable multiline" value={multiline} onChange={this.selectMultiline}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
<Select style={style.select} label="Enable multiline" value={this.state.multiline} onChange={this.selectMultiline}>
<Select style={style.select} label="Enable avatar" value={avatar} onChange={this.selectAvatar}>
<MenuItem text="On" value />
<MenuItem text="Off" value={false} />
</Select>
Expand All @@ -226,19 +234,19 @@ class MessageDoc extends Component {
message={message}
key={`message-${message.id}`}
myMessage={message.username === currentUser}
avatar={message.avatar}
avatar={avatar ? message.avatar : null}
emoji
collapsed={this.state.collapsed}
collapsed={collapsed}
collapsedText={
message.type === 'giphy'
? 'This GIF has been collapsed, click the button to expand it.'
: 'This image has been collapsed, click the button to expand it.'
}
expand={() => this.selectCollapse(false)}
fontSize={this.state.fontSize}
compact={this.state.compact}
menuItems={this.state.iconMenu ? menuItems : null}
edited={this.state.edited ? 'edited' : null}
fontSize={fontSize}
compact={compact}
menuItems={iconMenu ? menuItems : null}
edited={edited ? 'edited' : null}
highlights={[
{
prefix: '@',
Expand All @@ -253,7 +261,7 @@ class MessageDoc extends Component {
]}
onHighlightClick={(e, username) => alert(`mention ${username}`)} // eslint-disable-line no-alert
enableLinks
enableMultiline={this.state.multiline}
enableMultiline={multiline}
/>
))}
</MessageList>
Expand Down
4 changes: 1 addition & 3 deletions src/message/giphy-message/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default {
},
myMessage: {
backgroundColor: colors.theme,
color: colors.white,
marginLeft: '0',
marginRight: '16px',
color: colors.white
},
body: {
display: 'flex',
Expand Down
4 changes: 1 addition & 3 deletions src/message/image-message/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default {
},
myMessage: {
backgroundColor: colors.theme,
color: colors.white,
marginLeft: '0',
marginRight: '16px',
color: colors.white
},
body: {
display: 'flex',
Expand Down
4 changes: 1 addition & 3 deletions src/message/sticker-message/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export default {
marginRight: '48px'
},
myMessage: {
backgroundColor: colors.theme,
marginLeft: '0',
marginRight: '16px',
backgroundColor: colors.theme
},
body: {
width: 'auto',
Expand Down
3 changes: 1 addition & 2 deletions src/message/text-message/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export default {
myMessage: {
backgroundColor: colors.theme,
color: colors.white,
marginLeft: '0',
marginRight: '16px',
marginLeft: '0'
},
body: {
display: 'flex',
Expand Down
4 changes: 1 addition & 3 deletions src/message/typing-message/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export default {
},
myMessage: {
backgroundColor: colors.theme,
color: colors.white,
marginLeft: '0',
marginRight: '16px',
color: colors.white
},
body: {
display: 'flex',
Expand Down

0 comments on commit bae8e5e

Please sign in to comment.