More emoji options

This commit is contained in:
Marquis Kurt 2019-04-05 16:45:54 -04:00
parent 339233a00d
commit 27b6c92c22
3 changed files with 25 additions and 6 deletions

View File

@ -16,9 +16,15 @@ export class EmojiPicker extends Component<IEmojiPickerProps, any> {
return ( return (
<Picker <Picker
custom={this.retrieveFromLocal()} custom={this.retrieveFromLocal()}
emoji="point_up" emoji=""
title="Pick an emoji" title=""
onClick={this.props.onGetEmoji} onClick={this.props.onGetEmoji}
style={{
borderColor: 'transparent'
}}
perLine={10}
emojiSize={20}
set={"google"}
/> />
) )
} }

View File

@ -26,5 +26,14 @@ export const styles = (theme: Theme) => createStyles({
composeAttachmentAreaGridList: { composeAttachmentAreaGridList: {
height: 250, height: 250,
width: '100%' width: '100%'
},
composeEmoji: {
marginTop: theme.spacing.unit * 8
},
desktopOnly: {
display: "none",
[theme.breakpoints.up('sm')]: {
display: "block"
}
} }
}); });

View File

@ -55,22 +55,25 @@ class Composer extends Component<any, IComposerState> {
componentDidMount() { componentDidMount() {
let state = this.getComposerParams(this.props); let state = this.getComposerParams(this.props);
let text = state.acct? `@${state.acct}: `: '';
this.setState({ this.setState({
reply: state.reply, reply: state.reply,
acct: state.acct, acct: state.acct,
visibility: state.visibility, visibility: state.visibility,
text: state.acct? `@${state.acct}: `: '' text,
remainingChars: 500 - text.length
}) })
} }
componentWillReceiveProps(props: any) { componentWillReceiveProps(props: any) {
let state = this.getComposerParams(props); let state = this.getComposerParams(props);
let text = state.acct? `@${state.acct}: `: '';
this.setState({ this.setState({
reply: state.reply, reply: state.reply,
acct: state.acct, acct: state.acct,
visibility: state.visibility, visibility: state.visibility,
text: state.acct? `@${state.acct}: `: '', text,
remainingChars: 500 - (state.acct? `@${state.acct}: `: '').length remainingChars: 500 - text.length
}) })
} }
@ -304,7 +307,7 @@ class Composer extends Component<any, IComposerState> {
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title="Insert emoji"> <Tooltip title="Insert emoji">
<IconButton id="compose-emoji" onClick={() => this.toggleEmojis()}> <IconButton id="compose-emoji" onClick={() => this.toggleEmojis()} className={classes.desktopOnly}>
<TagFacesIcon/> <TagFacesIcon/>
</IconButton> </IconButton>
</Tooltip> </Tooltip>
@ -312,6 +315,7 @@ class Composer extends Component<any, IComposerState> {
open={this.state.showEmojis} open={this.state.showEmojis}
anchorEl={document.getElementById('compose-emoji')} anchorEl={document.getElementById('compose-emoji')}
onClose={() => this.toggleEmojis()} onClose={() => this.toggleEmojis()}
className={classes.composeEmoji}
> >
<EmojiPicker onGetEmoji={(emoji: any) => this.insertEmoji(emoji)}/> <EmojiPicker onGetEmoji={(emoji: any) => this.insertEmoji(emoji)}/>
</Menu> </Menu>