Skip to content

Commit

Permalink
Merge pull request #4455 from clegirar/chore/remove-reply-front-features
Browse files Browse the repository at this point in the history
  • Loading branch information
clegirar committed Oct 11, 2022
2 parents 2c54e1d + c98854b commit dc2cc9e
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 565 deletions.
13 changes: 0 additions & 13 deletions js/android/app/src/main/java/tech/berty/android/MainActivity.java
Expand Up @@ -7,7 +7,6 @@
import com.zoontek.rnbootsplash.RNBootSplash; // needed by react-native-bootsplash
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

import android.util.Log;
import android.view.MotionEvent;
Expand All @@ -34,18 +33,6 @@ protected String getMainComponentName() {
return "Berty";
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegateWrapper(this,
new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
}
);
}

public static AppState getAppState() {
return MainActivity.appState;
}
Expand Down
1 change: 0 additions & 1 deletion js/index.ts
Expand Up @@ -3,7 +3,6 @@
*/

import 'node-libs-react-native/globals'
import 'react-native-gesture-handler'
import 'string.fromcodepoint'

import protobuf from 'protobufjs'
Expand Down
6 changes: 0 additions & 6 deletions js/ios/Podfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions js/jest-setup.js
@@ -1,16 +1,7 @@
/* eslint-disable no-undef */
import 'react-native'
import i18next from 'i18next'

import { initI18N } from '@berty/i18n'

jest.mock('react-native-gesture-handler', () => {
return {
...jest.requireActual('react-native-gesture-handler/src/mocks'),
LongPressGestureHandler: jest.fn,
TouchableOpacity: jest.fn,
}
})

initI18N()
i18next.changeLanguage('cimode')
1 change: 0 additions & 1 deletion js/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion js/packages/components/chat/MessageList.tsx
Expand Up @@ -180,7 +180,6 @@ export const MessageList: React.FC<{
members={members}
previousMessage={index < messages.length - 1 ? messages[index + 1] : undefined}
nextMessage={index > 0 ? messages[index - 1] : undefined}
replyOf={messages.find(message => message.cid === item.targetCid)}
scrollToCid={handleScrollToCid}
/>
</>
Expand Down
17 changes: 1 addition & 16 deletions js/packages/components/chat/footer/ChatFooter.tsx
Expand Up @@ -15,9 +15,7 @@ import {
useMountEffect,
} from '@berty/hooks'
import {
removeActiveReplyInteraction,
resetChatInput,
selectActiveReplyInteraction,
selectChatInputText,
setChatInputText,
} from '@berty/redux/reducers/chatInputs.reducer'
Expand Down Expand Up @@ -50,7 +48,6 @@ export const ChatFooter: React.FC<ChatFooterProps> = React.memo(
const [message, setMessage, messageRef] = useStateWithRef(draftMessage)

const colors = useThemeColor()
const activeReplyInte = useAppSelector(state => selectActiveReplyInteraction(state, convPK))
const messengerClient = useMessengerClient()
const playSound = usePlaySound()
const conversation = useConversation(convPK)
Expand All @@ -69,39 +66,27 @@ export const ChatFooter: React.FC<ChatFooterProps> = React.memo(
conversationPublicKey: convPK,
type: beapi.messenger.AppMessage.Type.TypeUserMessage,
payload: buf,
targetCid: activeReplyInte?.cid,
})
const optimisticInteraction: beapi.messenger.IInteraction = {
cid: reply.cid,
conversationPublicKey: convPK,
isMine: true,
type: beapi.messenger.AppMessage.Type.TypeUserMessage,
payload: buf,
targetCid: activeReplyInte?.cid,
sentDate: Long.fromNumber(Date.now()).toString() as unknown as Long,
}
dispatch({
type: 'messenger/InteractionUpdated',
payload: { interaction: optimisticInteraction },
})
dispatch(removeActiveReplyInteraction({ convPK }))
dispatch(resetChatInput(convPK))
setMessage('')
playSound('messageSent')
} catch (e) {
console.warn('e sending message:', e)
setSending(false)
}
}, [
activeReplyInte?.cid,
convPK,
playSound,
dispatch,
message,
messengerClient,
setSending,
setMessage,
])
}, [convPK, playSound, dispatch, message, messengerClient, setSending, setMessage])

const handlePressSend = React.useCallback(async () => {
if (sending) {
Expand Down
2 changes: 0 additions & 2 deletions js/packages/components/chat/footer/ChatTextInput.tsx
Expand Up @@ -18,7 +18,6 @@ import {
import { isTablet } from '@berty/utils/react-native/constants'

import { ChatInputProps } from './interface'
import { ReplyMessageBarPriv } from './reply/ReplyMessageBar.priv'

export const ChatTextInput: React.FC<ChatInputProps> = React.memo(props => {
const { handleTabletSubmit, convPK, editable, placeholder, onChangeText, value } = props
Expand Down Expand Up @@ -52,7 +51,6 @@ export const ChatTextInput: React.FC<ChatInputProps> = React.memo(props => {
{ backgroundColor: `${colors['positive-asset']}70` },
]}
>
<ReplyMessageBarPriv convPK={convPK} />
<InputPriv
value={value}
editable={editable}
Expand Down
32 changes: 0 additions & 32 deletions js/packages/components/chat/footer/reply/CancelReply.priv.tsx

This file was deleted.

48 changes: 0 additions & 48 deletions js/packages/components/chat/footer/reply/ReplyMessageBar.priv.tsx

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions js/packages/components/chat/footer/reply/interface.ts

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions js/packages/components/chat/message/index.tsx
Expand Up @@ -23,10 +23,9 @@ export const Message: React.FC<{
convPK: string
previousMessage?: ParsedInteraction
nextMessage?: ParsedInteraction
replyOf?: ParsedInteraction
scrollToCid: (cid: string) => void
}> = React.memo(
({ inte, convKind, members, previousMessage, nextMessage, convPK, replyOf, scrollToCid }) => {
({ inte, convKind, members, previousMessage, nextMessage, convPK, scrollToCid }) => {
const { text, padding } = useStyles()
const colors = useThemeColor()

Expand Down Expand Up @@ -58,7 +57,6 @@ export const Message: React.FC<{
convKind={convKind}
nextMessage={nextMessage}
previousMessage={previousMessage}
replyOf={replyOf}
scrollToCid={scrollToCid}
/>
)
Expand Down

0 comments on commit dc2cc9e

Please sign in to comment.