Skip to content

Commit

Permalink
Merge pull request #1895 from oxen-io/clearnet
Browse files Browse the repository at this point in the history
Fix search logic
  • Loading branch information
Bilb authored Sep 6, 2021
2 parents d0070ca + 291738e commit 0d07fb1
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions stylesheets/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@
display: flex;
flex-direction: row;
padding-inline-end: 16px;
padding-bottom: 8px;
padding-inline-start: 16px;
align-items: center;

Expand Down
1 change: 1 addition & 0 deletions stylesheets/_quote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
background-color: $color-white-085;
padding-inline-start: 8px;
padding-inline-end: 8px;
margin-inline-end: 8px;
}

&-warning__icon {
Expand Down
2 changes: 1 addition & 1 deletion ts/components/conversation/message/MessageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const MessageContent = (props: Props) => {
handleImageError={handleImageError}
/>
{hasContentAfterAttachmentAndQuote ? (
<Flex padding="7px">
<Flex padding="7px" container={true} flexDirection="column">
<MessagePreview messageId={props.messageId} handleImageError={handleImageError} />
<MessageText messageId={props.messageId} />
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -71,15 +70,15 @@ export const MessageContentWithStatuses = (props: Props) => {
onClick={onClickOnMessageOuterContainer}
>
<MessageStatus messageId={messageId} isCorrectSide={isIncoming} />
<Flex container={true} flexDirection="column">
<div>
<MessageAuthorText messageId={messageId} />

<MessageContent
messageId={messageId}
isDetailView={isDetailView}
onQuoteClick={onQuoteClick}
/>
</Flex>
</div>
<MessageStatus messageId={messageId} isCorrectSide={!isIncoming} />
<MessageContextMenu messageId={messageId} contextMenuId={ctxMenuID} />
</div>
Expand Down
3 changes: 2 additions & 1 deletion ts/components/conversation/message/OutgoingMessageStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;
Expand Down Expand Up @@ -41,7 +42,7 @@ const MessageStatusRead = () => {
const MessageStatusError = () => {
return (
<MessageStatusSendingContainer title={window.i18n('sendFailed')}>
<SessionIcon iconColor={'var(--color-destructibe'} iconType="error" iconSize={'tiny'} />
<SessionIcon iconColor={'var(--color-destructive'} iconType="error" iconSize={'tiny'} />
</MessageStatusSendingContainer>
);
};
Expand Down
4 changes: 3 additions & 1 deletion ts/state/createStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion ts/state/ducks/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0d07fb1

Please sign in to comment.