From bfc805c9d4bb660602e5eb9fa9838420ffd05b03 Mon Sep 17 00:00:00 2001 From: audric Date: Fri, 3 Sep 2021 16:25:21 +1000 Subject: [PATCH 1/2] fix search logic and UI cosmetic fixes --- package.json | 1 + stylesheets/_modules.scss | 1 + stylesheets/_quote.scss | 1 + ts/components/conversation/message/MessageContent.tsx | 2 +- .../conversation/message/MessageContentWithStatus.tsx | 5 ++--- ts/state/createStore.ts | 4 +++- ts/state/ducks/search.ts | 2 +- yarn.lock | 5 +++++ 8 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 296d704aa9..3c1f6dd5bc 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "redux": "4.0.1", "redux-logger": "3.0.6", "redux-persist": "^6.0.0", + "redux-promise-middleware": "^6.1.2", "reselect": "4.0.0", "rimraf": "2.6.2", "sanitize.css": "^12.0.1", diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index fb064e875c..de546aa85d 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -846,6 +846,7 @@ display: flex; flex-direction: row; padding-inline-end: 16px; + padding-bottom: 8px; padding-inline-start: 16px; align-items: center; diff --git a/stylesheets/_quote.scss b/stylesheets/_quote.scss index 369d765688..c29f9e82f5 100644 --- a/stylesheets/_quote.scss +++ b/stylesheets/_quote.scss @@ -254,6 +254,7 @@ background-color: $color-white-085; padding-inline-start: 8px; padding-inline-end: 8px; + margin-inline-end: 8px; } &-warning__icon { diff --git a/ts/components/conversation/message/MessageContent.tsx b/ts/components/conversation/message/MessageContent.tsx index bddd72224d..051c8cfa9c 100644 --- a/ts/components/conversation/message/MessageContent.tsx +++ b/ts/components/conversation/message/MessageContent.tsx @@ -177,7 +177,7 @@ export const MessageContent = (props: Props) => { handleImageError={handleImageError} /> {hasContentAfterAttachmentAndQuote ? ( - + diff --git a/ts/components/conversation/message/MessageContentWithStatus.tsx b/ts/components/conversation/message/MessageContentWithStatus.tsx index 02c9a33d83..184975b424 100644 --- a/ts/components/conversation/message/MessageContentWithStatus.tsx +++ b/ts/components/conversation/message/MessageContentWithStatus.tsx @@ -8,7 +8,6 @@ import { getMessageContentWithStatusesSelectorProps, isMessageSelectionMode, } from '../../../state/selectors/conversations'; -import { Flex } from '../../basic/Flex'; import { MessageAuthorText } from './MessageAuthorText'; import { MessageContent } from './MessageContent'; import { MessageContextMenu } from './MessageContextMenu'; @@ -71,7 +70,7 @@ export const MessageContentWithStatuses = (props: Props) => { onClick={onClickOnMessageOuterContainer} > - +
{ isDetailView={isDetailView} onQuoteClick={onQuoteClick} /> - +
diff --git a/ts/state/createStore.ts b/ts/state/createStore.ts index a508ae1020..38760107af 100644 --- a/ts/state/createStore.ts +++ b/ts/state/createStore.ts @@ -2,6 +2,8 @@ import { createLogger } from 'redux-logger'; import { configureStore } from '@reduxjs/toolkit'; import { rootReducer } from './reducer'; import { persistReducer } from 'redux-persist'; +// tslint:disable-next-line: match-default-export-name +import promiseMiddleware from 'redux-promise-middleware'; // tslint:disable-next-line: no-submodule-imports match-default-export-name import storage from 'redux-persist/lib/storage'; @@ -34,7 +36,7 @@ const persistedReducer = persistReducer(persistConfig, rootReducer); // Exclude logger if we're in production mode const disableLogging = true; //; env === 'production' || true; // ALWAYS TURNED OFF -const middlewareList = disableLogging ? [] : [logger]; +const middlewareList = disableLogging ? [promiseMiddleware] : [logger, promiseMiddleware]; export const createStore = (initialState: any) => configureStore({ diff --git a/ts/state/ducks/search.ts b/ts/state/ducks/search.ts index 00e845975a..38ab06d4d8 100644 --- a/ts/state/ducks/search.ts +++ b/ts/state/ducks/search.ts @@ -61,7 +61,7 @@ export const actions = { export function search(query: string, options: SearchOptions): SearchResultsKickoffActionType { return { type: 'SEARCH_RESULTS', - payload: doSearch(query, options), + payload: doSearch(query, options), // this uses redux-promise-middleware }; } diff --git a/yarn.lock b/yarn.lock index f9ee50d9d0..95d56a27e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7535,6 +7535,11 @@ redux-persist@^6.0.0: resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8" integrity sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ== +redux-promise-middleware@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/redux-promise-middleware/-/redux-promise-middleware-6.1.2.tgz#1c14222686934be243cbb292e348ef7d5b20d6d2" + integrity sha512-ZqZu/nnSzGgwTtNbGoGVontpk7LjTOv0kigtt3CcgXI9gpq+8WlfXTXRZD0WTD5yaohRq0q2nYmJXSTjwXs83Q== + redux-thunk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" From 7c49c51cf8abd400bff77ee4fe262f986cd1454d Mon Sep 17 00:00:00 2001 From: audric Date: Mon, 6 Sep 2021 10:45:29 +1000 Subject: [PATCH 2/2] make outgoing status align flex-end --- ts/components/conversation/message/OutgoingMessageStatus.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/message/OutgoingMessageStatus.tsx b/ts/components/conversation/message/OutgoingMessageStatus.tsx index f7de7dfb84..2a6869b75e 100644 --- a/ts/components/conversation/message/OutgoingMessageStatus.tsx +++ b/ts/components/conversation/message/OutgoingMessageStatus.tsx @@ -5,6 +5,7 @@ import { SessionIcon } from '../../session/icon'; const MessageStatusSendingContainer = styled.div` display: inline-block; + align-self: flex-end; margin-bottom: 2px; margin-inline-start: 5px; `; @@ -41,7 +42,7 @@ const MessageStatusRead = () => { const MessageStatusError = () => { return ( - + ); };