Skip to content
Closed

Beta #2168

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
802257e
[WIP] New Action Sheet
djorkaeffalexandre May 12, 2020
aa6168c
[NEW] Header Indicator
djorkaeffalexandre May 12, 2020
0e50e90
[IMPROVEMENT] Header Logic
djorkaeffalexandre May 12, 2020
d75d902
[NEW] Use EventEmitter to show ActionSheet for while
djorkaeffalexandre May 12, 2020
3175fad
[FIX] Animation
djorkaeffalexandre May 12, 2020
9d560ba
[IMPROVEMENT] Use provider
djorkaeffalexandre May 12, 2020
33c74f2
[FIX] Add callback
djorkaeffalexandre May 12, 2020
cf12576
[FIX] Message Actions
djorkaeffalexandre May 12, 2020
c7ccaf8
[FIX] Add MessageActions icons
djorkaeffalexandre May 12, 2020
7845f06
[NEW] MessageErrorActions
djorkaeffalexandre May 12, 2020
9da61ba
[IMPROVEMENT] OnClose
djorkaeffalexandre May 12, 2020
8df08f5
[FIX] Adjust height
djorkaeffalexandre May 12, 2020
39c1b7f
[FIX] Close/Reopen
djorkaeffalexandre May 12, 2020
95bf8f5
[CHORE] Remove react-native-action-sheet
djorkaeffalexandre May 12, 2020
e482823
[CHORE] Move ActionSheet
djorkaeffalexandre May 12, 2020
02900e5
[FIX] Reply Message
djorkaeffalexandre May 12, 2020
e47923f
[IMPROVEMENT] Hide ActionSheet logic
djorkaeffalexandre May 12, 2020
7ae9aef
[WIP] Custom MessageActions Header
djorkaeffalexandre May 12, 2020
310d24a
[IMPROVEMENT] MessageActions Header
djorkaeffalexandre May 12, 2020
90ab8de
[IMPROVEMENT] Enable Scroll
djorkaeffalexandre May 12, 2020
bf0312a
[FIX] Scroll on Android
djorkaeffalexandre May 13, 2020
8a20cbb
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat.R…
djorkaeffalexandre May 14, 2020
4208c72
Move to react-native-scroll-bottom-sheet
djorkaeffalexandre May 20, 2020
8c12946
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat.R…
djorkaeffalexandre May 20, 2020
672f9e4
Stash
djorkaeffalexandre May 20, 2020
68abfde
Merge develop
djorkaeffalexandre May 20, 2020
cc3f820
Refactor actions
djorkaeffalexandre May 20, 2020
f1e9d5d
react-navigation v5 installed
diegolmello May 21, 2020
50806d7
Revert some changes
djorkaeffalexandre May 21, 2020
796c82a
compiling
diegolmello May 21, 2020
6c6e361
Trying react-native-modalize
djorkaeffalexandre May 21, 2020
a89856c
Back to HOC
djorkaeffalexandre May 21, 2020
b9eb801
ActionSheet style
djorkaeffalexandre May 21, 2020
9f4461c
HOC Header
djorkaeffalexandre May 21, 2020
3def144
Outside working
diegolmello May 21, 2020
6515e41
Reaction actionSheet
djorkaeffalexandre May 21, 2020
0cc510d
InsideStack compiling
diegolmello May 21, 2020
d0824bb
Fix messageBox actions
djorkaeffalexandre May 21, 2020
1bc67f6
Fix add reaction
djorkaeffalexandre May 21, 2020
3867e57
Switch stack
diegolmello May 21, 2020
e4de36d
Starting room
diegolmello May 21, 2020
f764527
RoomView header
diegolmello May 21, 2020
a895d41
SafeAreaView
diegolmello May 21, 2020
e03d423
Slide from right stack animation
diegolmello May 21, 2020
d95730f
Change to flatListProps
djorkaeffalexandre May 21, 2020
f59d8e0
stash
diegolmello May 21, 2020
ac539ab
[NEW] Using react-native-notifier for notifications inApp
EzequielDeOliveira May 22, 2020
1067f25
Removing useless comment
EzequielDeOliveira May 22, 2020
c677322
fix modalize android scroll
djorkaeffalexandre May 22, 2020
ae459d1
Fix params
diegolmello May 22, 2020
1ec094c
Create channel
diegolmello May 22, 2020
639520b
Use react-native-scroll-bottom-sheet
djorkaeffalexandre May 22, 2020
7b8f59f
[NEW] BottomSheet dismissable & [FIX] Android not opening
djorkaeffalexandre May 25, 2020
8c48da1
[NEW] Show emojis based on screen width
djorkaeffalexandre May 25, 2020
5e6c720
[WIP] Adjust to content height
djorkaeffalexandre May 25, 2020
e4cbc92
[IMPROVEMENT] Responsible
djorkaeffalexandre May 25, 2020
355a646
Merge branch 'develop' into new.action-sheet
djorkaeffalexandre May 25, 2020
0b839aa
Merge branch 'develop' into notificationsInApp
diegolmello May 25, 2020
c9dafd2
[IMPROVEMENT] Use alert instead actionSheet at NewServerView
djorkaeffalexandre May 25, 2020
933c954
[FIX] Handle tablet cases
djorkaeffalexandre May 25, 2020
0d65113
[IMPROVEMENT] Remove actionSheet of RoomMembersView
djorkaeffalexandre May 25, 2020
66cde0a
[IMPROVEMENT] Min snap distance when its portrait
djorkaeffalexandre May 25, 2020
11b7b28
[CHORE] Remove unused Components
djorkaeffalexandre May 25, 2020
4200583
[IMPROVEMENT] Remove duplicated add-reaction
djorkaeffalexandre May 25, 2020
6dd2af5
Merge branch 'new.action-sheet' of https://github.com/RocketChat/Rock…
djorkaeffalexandre May 25, 2020
57d13e9
inapp notification
diegolmello May 26, 2020
cef50fe
Custom status
diegolmello May 26, 2020
3b93c11
Add server working
diegolmello May 26, 2020
3a4ff61
[IMPROVEMENT] Refactor Icon Package
djorkaeffalexandre May 26, 2020
cfc95e0
Merge branch 'new.icons' into new.action-sheet
djorkaeffalexandre May 26, 2020
aa12751
[IMPROVEMENT] Use new icons
djorkaeffalexandre May 26, 2020
988d3a3
Refactor appStart
diegolmello May 26, 2020
3347a67
Attachment
diegolmello May 26, 2020
54330a7
[FIX] Select message at MessageActions before getOptions
djorkaeffalexandre May 26, 2020
99e4dfc
in-app notification
diegolmello May 26, 2020
c60bdfb
AuthLoadingView
diegolmello May 26, 2020
c177c0f
[FIX] Custom header height
djorkaeffalexandre May 26, 2020
0bda859
Remove compat
diegolmello May 26, 2020
e30149a
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat.R…
djorkaeffalexandre May 26, 2020
b7b8501
[CHORE] Remove patch & [FIX] Tablet bottom sheet
djorkaeffalexandre May 26, 2020
5ca94ee
Navigation
diegolmello May 26, 2020
feab6a6
[FIX] Use ListItem height to BottomSheet Height
djorkaeffalexandre May 26, 2020
06684cb
Outside animations
diegolmello May 27, 2020
cabf630
Fix new server icon
diegolmello May 27, 2020
52d5781
Some fixes
djorkaeffalexandre May 27, 2020
c2a1173
block modal
diegolmello May 27, 2020
f86798b
[FIX] Custom MessageActions header
djorkaeffalexandre May 27, 2020
40b38b7
AttachmentView header
diegolmello May 27, 2020
739f885
Remove unnecessary code
diegolmello May 27, 2020
69e2fe8
SelectedUsersView header
diegolmello May 27, 2020
6c132cb
StatusView
diegolmello May 27, 2020
97ae9bc
CreateDiscussionView
diegolmello May 27, 2020
ce47856
[FIX] Android height adjust
djorkaeffalexandre May 27, 2020
90ef49c
[IMPROVEMENT] Item touchable & [FIX] Respect pin permission
djorkaeffalexandre May 27, 2020
15e1897
RoomInfoView
diegolmello May 27, 2020
816cb43
RoomInfoEditView style
diegolmello May 27, 2020
a1c2875
RoomMembersView
diegolmello May 27, 2020
34ed411
[IMPROVEMENT] More than one snap point
djorkaeffalexandre May 27, 2020
1f6bb5d
RoomsListView header
diegolmello May 27, 2020
c3d1867
some size fixes
djorkaeffalexandre May 27, 2020
55887d4
Merge branch 'develop' into new.icons
djorkaeffalexandre May 27, 2020
e00bc4b
Merge branch 'new.icons' into new.action-sheet
djorkaeffalexandre May 27, 2020
009de40
RoomView header
diegolmello May 27, 2020
a114c88
improve code
djorkaeffalexandre May 27, 2020
2bd6f2b
hide horizontal scroll indicator
djorkaeffalexandre May 27, 2020
ffda9e5
Share extension
diegolmello May 27, 2020
4f010e5
getParam
diegolmello May 28, 2020
452620c
Focus/blur
diegolmello May 28, 2020
d840408
[FIX] Focus MessageBox on edit message
djorkaeffalexandre May 28, 2020
6236017
[FIX] Ripple color
djorkaeffalexandre May 28, 2020
ff5b5b3
Trying to fix inapp
diegolmello May 28, 2020
61d570d
[IMPROVEMENT] Backdrop must keep same opacity after 50% of the screen
djorkaeffalexandre May 28, 2020
e1f328e
[TEST] Change animation config
djorkaeffalexandre May 28, 2020
967b73d
[IMPROVEMENT] BackHandler should close the ActionSheet
djorkaeffalexandre May 28, 2020
0b0e768
Lint
diegolmello May 28, 2020
7413d26
Merge branch 'develop' into update-rn-5
diegolmello May 28, 2020
1dde0af
[CHORE] Add react-native-safe-area-context
djorkaeffalexandre May 28, 2020
2bc51c8
[FIX] Provide a bottom padding at notch devices
djorkaeffalexandre May 28, 2020
2abede3
[IMPROVEMENT] Improve backdrop input/output range
djorkaeffalexandre May 28, 2020
1e49d80
Simpler app container
diegolmello May 28, 2020
f721c96
Update libs
diegolmello May 29, 2020
48e47f2
Revert "Simpler app container"
diegolmello May 29, 2020
91c2fbb
[FIX] Weird Android Snap behavior
djorkaeffalexandre May 29, 2020
a61ab22
[PATCH] React-native-scroll-bottom-sheet
djorkaeffalexandre May 29, 2020
dad8752
[CI] Re-run build
djorkaeffalexandre May 29, 2020
a8e02bb
[FIX] Landscape android
djorkaeffalexandre May 29, 2020
ccd76eb
[IMPROVEMENT] Cover 50% of the screen at the landscape mode
djorkaeffalexandre May 29, 2020
e47ed1f
[FIX] Adjust emoji content to width size
djorkaeffalexandre May 29, 2020
521e364
[IMPROVEMENT] Use hooks library
djorkaeffalexandre May 29, 2020
8749ea0
[IMPROVEMENT] Close the actionSheet when orientation change
djorkaeffalexandre May 29, 2020
612a5d8
Load messages faster
diegolmello May 29, 2020
69930cd
Fix safearea on ReactionsModal
diegolmello May 29, 2020
dedd508
deactivate safe-area-context for while
djorkaeffalexandre May 29, 2020
945c096
Update safe area to v3
diegolmello Jun 1, 2020
4d8a758
lint
diegolmello Jun 1, 2020
bcaf4a3
[REVERT] Re-add react-native-safe-area-context (3.0.2)
djorkaeffalexandre Jun 1, 2020
80cbd10
[IMPROVEMENT] Use focused background
djorkaeffalexandre Jun 1, 2020
790599f
Fix transition
diegolmello Jun 1, 2020
2e247cc
stash - drawer replace working
diegolmello Jun 1, 2020
f08ef94
stash - modal nav
diegolmello Jun 1, 2020
e597a44
RoomActionsView as tablet modal
diegolmello Jun 2, 2020
42225b6
RoomStack
diegolmello Jun 2, 2020
f6ea268
Stop showing RoomView header when there's no room
diegolmello Jun 2, 2020
ad786ac
[TESTS] E2E Tests updated to new BottomSheet
djorkaeffalexandre Jun 2, 2020
83aceee
[NEW] Add cancel button
djorkaeffalexandre Jun 2, 2020
b1ae5c9
[FIX] Cancel button at android
djorkaeffalexandre Jun 2, 2020
59a3ecc
[IMPROVEMENT] Use cancelable bottom sheet at room members view
djorkaeffalexandre Jun 2, 2020
28e5b90
Custom Header and different navigation based on stack
diegolmello Jun 2, 2020
ed2ca11
Refactor setHeader
diegolmello Jun 2, 2020
0e03328
MasterDetailContext
diegolmello Jun 2, 2020
bea3c74
Using EventEmitter for in App notifications
EzequielDeOliveira Jun 3, 2020
60bad2d
Merge branch 'notificationsInApp' of https://github.com/EzequielDeOli…
EzequielDeOliveira Jun 3, 2020
0934a52
Using correct lifecycle to remove listener
EzequielDeOliveira Jun 3, 2020
763f494
RoomView header
diegolmello Jun 3, 2020
15ad611
Fix isMasterDetail rule
diegolmello Jun 3, 2020
a24b97b
KeyCommands kind of working
diegolmello Jun 3, 2020
20b768f
Create channel on tablet
diegolmello Jun 3, 2020
7dcb38b
RoomView sCU
diegolmello Jun 3, 2020
98dc19d
Remove withSplit
diegolmello Jun 3, 2020
b7e634a
Settings opening as modal
diegolmello Jun 3, 2020
383b060
Settings
diegolmello Jun 3, 2020
631aa9c
StatusView headerLeft
diegolmello Jun 3, 2020
fa33770
Admin panel
diegolmello Jun 3, 2020
8977bc2
TwoFactor style
diegolmello Jun 3, 2020
06f2e58
DirectoryView
diegolmello Jun 3, 2020
5f5461d
ServerDropdown and SortDropdown animations
diegolmello Jun 3, 2020
28b68fa
ThreadMessagesView
diegolmello Jun 3, 2020
be5974c
Navigate to empty RoomView on server switch when in master detail
diegolmello Jun 3, 2020
650ada5
ProfileView header
diegolmello Jun 3, 2020
a7df8a7
Fix navigation issues
diegolmello Jun 3, 2020
7f7184a
Nav to any room info on tablet
diegolmello Jun 3, 2020
4f970ac
Room info
diegolmello Jun 3, 2020
69b4e33
Refactoring
diegolmello Jun 3, 2020
8e07b3c
Fix rooms search
diegolmello Jun 3, 2020
c6dcbd6
Roomslist commands
diegolmello Jun 3, 2020
164c769
SearchMessagesView close modal
diegolmello Jun 3, 2020
c1d2445
Key commands
diegolmello Jun 4, 2020
8e9066b
Fix undefined subscription
diegolmello Jun 4, 2020
b57284d
Disallow navigate to focused room
diegolmello Jun 4, 2020
52d22ed
isFocused state on RoomsListView
diegolmello Jun 4, 2020
f8f629e
Blur text inputs when focus is lost
diegolmello Jun 4, 2020
e53bc36
Replace animation
diegolmello Jun 4, 2020
38088d0
Default nav theme
diegolmello Jun 4, 2020
f0be483
Refactoring
diegolmello Jun 4, 2020
c66e286
Always open Attachment with close modal button
diegolmello Jun 4, 2020
3466050
ModalContainer backdrop following themes
diegolmello Jun 4, 2020
faa0850
Screen tracking
diegolmello Jun 4, 2020
b0a5c94
Refactor get active route for in-app notification
diegolmello Jun 4, 2020
5f79b90
Only mark room as focused when in master detail layout
diegolmello Jun 4, 2020
6ba9036
Lint
diegolmello Jun 4, 2020
01e7591
Open modals as fade from bottom on Android
diegolmello Jun 4, 2020
0da8abf
typo
diegolmello Jun 4, 2020
064ae52
Fixing tests
diegolmello Jun 4, 2020
4ddae42
Fix in-app update
diegolmello Jun 5, 2020
920f1a9
Merge branch 'develop' into update-rn-5
diegolmello Jun 5, 2020
1fe9fcd
Merge branch 'develop' into new.action-sheet
diegolmello Jun 5, 2020
002b6d5
Merge branch 'new.action-sheet' into beta
diegolmello Jun 5, 2020
16a8ded
Merge branch 'develop' into notificationsInApp
diegolmello Jun 5, 2020
d2feaef
Merge branch 'notificationsInApp' into beta
diegolmello Jun 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions app/AppContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import React from 'react';
import PropTypes from 'prop-types';
import { NavigationContainer, DefaultTheme, DarkTheme } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { connect } from 'react-redux';
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';

import Navigation from './lib/Navigation';
import { defaultHeader, getActiveRouteName } from './utils/navigation';
import {
ROOT_LOADING, ROOT_OUTSIDE, ROOT_NEW_SERVER, ROOT_INSIDE, ROOT_SET_USERNAME, ROOT_BACKGROUND
} from './actions/app';
import ActionSheetProvider from './actionSheet';

// Stacks
import AuthLoadingView from './views/AuthLoadingView';

// SetUsername Stack
import SetUsernameView from './views/SetUsernameView';

import OutsideStack from './stacks/OutsideStack';
import InsideStack from './stacks/InsideStack';
import MasterDetailStack from './stacks/MasterDetailStack';
import { ThemeContext } from './theme';
import { themes } from './constants/colors';
import { setCurrentScreen } from './utils/log';

// SetUsernameStack
const SetUsername = createStackNavigator();
const SetUsernameStack = () => (
<SetUsername.Navigator screenOptions={defaultHeader}>
<SetUsername.Screen
name='SetUsernameView'
component={SetUsernameView}
/>
</SetUsername.Navigator>
);

// App
const Stack = createStackNavigator();
const App = React.memo(({ root, isMasterDetail }) => {
if (!root || root === ROOT_BACKGROUND) {
return null;
}

const { theme } = React.useContext(ThemeContext);
const defaultNavTheme = theme === 'light' ? DefaultTheme : DarkTheme;

const navigationTheme = {
...defaultNavTheme,
colors: {
...defaultNavTheme.colors,
background: 'transparent',
border: themes[theme].borderColor
}
};

React.useEffect(() => {
const state = Navigation.navigationRef.current.getRootState();
const currentRouteName = getActiveRouteName(state);
Navigation.routeNameRef.current = currentRouteName;
setCurrentScreen(currentRouteName);
}, []);

return (
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
<ActionSheetProvider>
<NavigationContainer
theme={navigationTheme}
ref={Navigation.navigationRef}
onStateChange={(state) => {
const previousRouteName = Navigation.routeNameRef.current;
const currentRouteName = getActiveRouteName(state);
if (previousRouteName !== currentRouteName) {
setCurrentScreen(currentRouteName);
}
Navigation.routeNameRef.current = currentRouteName;
}}
>
<Stack.Navigator screenOptions={{ headerShown: false, animationEnabled: false }}>
<>
{root === ROOT_LOADING ? (
<Stack.Screen
name='AuthLoading'
component={AuthLoadingView}
/>
) : null}
{root === ROOT_OUTSIDE || root === ROOT_NEW_SERVER ? (
<Stack.Screen
name='OutsideStack'
component={OutsideStack}
/>
) : null}
{root === ROOT_INSIDE && isMasterDetail ? (
<Stack.Screen
name='MasterDetailStack'
component={MasterDetailStack}
/>
) : null}
{root === ROOT_INSIDE && !isMasterDetail ? (
<Stack.Screen
name='InsideStack'
component={InsideStack}
/>
) : null}
{root === ROOT_SET_USERNAME ? (
<Stack.Screen
name='SetUsernameStack'
component={SetUsernameStack}
/>
) : null}
</>
</Stack.Navigator>
</NavigationContainer>
</ActionSheetProvider>
</SafeAreaProvider>
);
});
const mapStateToProps = state => ({
root: state.app.root,
isMasterDetail: state.app.isMasterDetail
});

App.propTypes = {
root: PropTypes.string,
isMasterDetail: PropTypes.bool
};

const AppContainer = connect(mapStateToProps)(App);
export default AppContainer;
53 changes: 53 additions & 0 deletions app/actionSheet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React, { useRef, useContext } from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import PropTypes from 'prop-types';

import ActionSheet from './containers/ActionSheet';
import { withTheme } from './theme';

const context = React.createContext({
show: () => {},
hide: () => {}
});

export function useActionSheet() {
return useContext(context);
}

const { Provider, Consumer } = context;

export function connectActionSheet(Component) {
const ConnectedActionSheet = props => (
<Consumer>
{contexts => <Component {...props} {...contexts} />}
</Consumer>
);
hoistNonReactStatics(ConnectedActionSheet, Component);
return ConnectedActionSheet;
}

const ActionSheetProvider = ({ children, theme }) => {
const ref = useRef();

const getContext = () => ({
show: (options) => {
ref.current?.show(options);
},
hide: () => {
ref.current?.hide();
}
});

return (
<Provider value={getContext()}>
<ActionSheet ref={ref} theme={theme}>
{children}
</ActionSheet>
</Provider>
);
};
ActionSheetProvider.propTypes = {
children: PropTypes.node,
theme: PropTypes.string
};
export default withTheme(ActionSheetProvider);
2 changes: 1 addition & 1 deletion app/actions/actionsTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ROOMS = createRequestTypes('ROOMS', [
'CLOSE_SEARCH_HEADER'
]);
export const ROOM = createRequestTypes('ROOM', ['SUBSCRIBE', 'UNSUBSCRIBE', 'LEAVE', 'DELETE', 'REMOVED', 'CLOSE', 'FORWARD', 'USER_TYPING']);
export const APP = createRequestTypes('APP', ['START', 'READY', 'INIT', 'INIT_LOCAL_SETTINGS']);
export const APP = createRequestTypes('APP', ['START', 'READY', 'INIT', 'INIT_LOCAL_SETTINGS', 'SET_MASTER_DETAIL']);
export const MESSAGES = createRequestTypes('MESSAGES', ['REPLY_BROADCAST']);
export const CREATE_CHANNEL = createRequestTypes('CREATE_CHANNEL', [...defaultTypes]);
export const CREATE_DISCUSSION = createRequestTypes('CREATE_DISCUSSION', [...defaultTypes]);
Expand Down
41 changes: 41 additions & 0 deletions app/actions/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { APP } from './actionsTypes';

export const ROOT_OUTSIDE = 'outside';
export const ROOT_INSIDE = 'inside';
export const ROOT_LOADING = 'loading';
export const ROOT_NEW_SERVER = 'newServer';
export const ROOT_SET_USERNAME = 'setUsername';
export const ROOT_BACKGROUND = 'background';

export function appStart({ root, ...args }) {
return {
type: APP.START,
root,
...args
};
}

export function appReady() {
return {
type: APP.READY
};
}

export function appInit() {
return {
type: APP.INIT
};
}

export function appInitLocalSettings() {
return {
type: APP.INIT_LOCAL_SETTINGS
};
}

export function setMasterDetail(isMasterDetail) {
return {
type: APP.SET_MASTER_DETAIL,
isMasterDetail
};
}
41 changes: 0 additions & 41 deletions app/actions/index.js

This file was deleted.

13 changes: 7 additions & 6 deletions app/commands.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-bitwise */
import { constants } from 'react-native-keycommands';
import KeyCommands, { constants } from 'react-native-keycommands';

import I18n from './i18n';

Expand All @@ -17,7 +17,7 @@ const KEY_ADD_SERVER = __DEV__ ? 'l' : 'n';
const KEY_SEND_MESSAGE = '\r';
const KEY_SELECT = '123456789';

export const defaultCommands = [
const keyCommands = [
{
// Focus messageBox
input: KEY_TYPING,
Expand All @@ -29,10 +29,7 @@ export const defaultCommands = [
input: KEY_SEND_MESSAGE,
modifierFlags: 0,
discoverabilityTitle: I18n.t('Send')
}
];

export const keyCommands = [
},
{
// Open Preferences Modal
input: KEY_PREFERENCES,
Expand Down Expand Up @@ -139,6 +136,10 @@ export const keyCommands = [
})))
];

export const setKeyCommands = () => KeyCommands.setKeyCommands(keyCommands);

export const deleteKeyCommands = () => KeyCommands.deleteKeyCommands(keyCommands);

export const KEY_COMMAND = 'KEY_COMMAND';

export const commandHandle = (event, key, flags = []) => {
Expand Down
3 changes: 1 addition & 2 deletions app/constants/tablet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const MAX_SIDEBAR_WIDTH = 321;
export const MAX_CONTENT_WIDTH = '90%';
export const MAX_SCREEN_CONTENT_WIDTH = '50%';
export const MIN_WIDTH_SPLIT_LAYOUT = 700;
export const MIN_WIDTH_MASTER_DETAIL_LAYOUT = 700;
4 changes: 0 additions & 4 deletions app/constants/types.js

This file was deleted.

17 changes: 17 additions & 0 deletions app/containers/ActionSheet/Handle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View } from 'react-native';

import styles from './styles';
import { themes } from '../../constants/colors';

const Handle = React.memo(({ theme }) => (
<View style={[styles.handle, { backgroundColor: themes[theme].focusedBackground }]} testID='scroll-bottom-sheet-handle'>
<View style={[styles.handleIndicator, { backgroundColor: themes[theme].auxiliaryText }]} />
</View>
));
Handle.propTypes = {
theme: PropTypes.string
};

export default Handle;
46 changes: 46 additions & 0 deletions app/containers/ActionSheet/Item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Text } from 'react-native';

import { themes } from '../../constants/colors';
import { CustomIcon } from '../../lib/Icons';
import styles from './styles';
import { Button } from './index';

const Item = React.memo(({
item, hide, theme
}) => {
const onPress = () => {
hide();
item?.onPress();
};

return (
<Button
onPress={onPress}
style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]}
theme={theme}
testID={item.title}
>
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
<Text
numberOfLines={1}
style={[styles.title, { color: item.danger ? themes[theme].dangerColor : themes[theme].bodyText }]}
>
{item.title}
</Text>
</Button>
);
});
Item.propTypes = {
item: PropTypes.shape({
title: PropTypes.string,
icon: PropTypes.string,
danger: PropTypes.bool,
onPress: PropTypes.func
}),
hide: PropTypes.func,
theme: PropTypes.string
};

export default Item;
Loading