From 55ead6a4b204aae0793b74607fb5b7954501ea5c Mon Sep 17 00:00:00 2001 From: kibigo! Date: Thu, 4 Jan 2018 21:17:30 -0800 Subject: [PATCH] WIP Refactor; Fin~ --- .../features/composer/textarea/index.js | 2 +- .../textarea/suggestions/item/index.js | 2 +- .../flavours/glitch/reducers/compose.js | 2 +- .../glitch/styles/components/composer.scss | 6 ++-- .../glitch/styles/components/index.scss | 31 +++++++++++++++++++ .../flavours/glitch/util/emoji/index.js | 1 + 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/features/composer/textarea/index.js b/app/javascript/flavours/glitch/features/composer/textarea/index.js index 1b6f79bbac..955c06098b 100644 --- a/app/javascript/flavours/glitch/features/composer/textarea/index.js +++ b/app/javascript/flavours/glitch/features/composer/textarea/index.js @@ -32,7 +32,7 @@ const handlers = { // When blurring the textarea, suggestions are hidden. handleBlur () { - this.setState({ suggestionsHidden: true }); + //this.setState({ suggestionsHidden: true }); }, // When the contents of the textarea change, we have to pull up new diff --git a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js index dc057e6799..d2c794ae97 100644 --- a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js +++ b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js @@ -7,7 +7,7 @@ import React from 'react'; import AccountContainer from 'flavours/glitch/containers/account_container'; // Utils. -import { unicodeMapping } from 'flavours/glitch/util/emoji/emoji_unicode_mapping_light'; +import { unicodeMapping } from 'flavours/glitch/util/emoji'; import { assignHandlers } from 'flavours/glitch/util/react_helpers'; // Gets our asset host from the environment, if available. diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index c5d7b03ac7..e1f811f6f2 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -179,7 +179,7 @@ export default function compose(state = initialState, action) { case COMPOSE_MOUNT: return state.set('mounted', true); case COMPOSE_UNMOUNT: - return state.set('mounted', false) + return state.set('mounted', false); case COMPOSE_ADVANCED_OPTIONS_CHANGE: return state .set('advanced_options', diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index 4b09d80d6c..46df79906f 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -180,15 +180,15 @@ &:hover, &:focus, &:active, - &.active { background: darken($ui-secondary-color, 10%) } + &.selected { background: darken($ui-secondary-color, 10%) } & > .emoji { img { display: block; float: left; margin-right: 8px; - width: 16px; - height: 16px; + width: 18px; + height: 18px; } } } diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index 0ce0dafc9e..ab1359108f 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -754,6 +754,37 @@ text-decoration: none; font-size: 14px; } + + &.small { + border: none; + padding: 0; + + & > .account__avatar-wrapper { margin: 0 8px 0 0 } + + & > .display-name { + display: block; + padding: 0; + height: auto; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + + & > strong { + display: inline; + font-size: inherit; + line-height: inherit; + } + + & > span { + display: inline; + color: lighten($ui-base-color, 36%); + font-size: inherit; + line-height: inherit; + + &::before { content: " " } + } + } + } } .account__wrapper { diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js index 31c3e14cac..c6416db2d3 100644 --- a/app/javascript/flavours/glitch/util/emoji/index.js +++ b/app/javascript/flavours/glitch/util/emoji/index.js @@ -70,6 +70,7 @@ const emojify = (str, customEmojis = {}) => { }; export default emojify; +export { unicodeMapping }; export const buildCustomEmojis = (customEmojis) => { const emojis = [];