Fixing lint

This commit is contained in:
Diego Mello 2023-03-20 15:14:25 -03:00
parent 4cd2cb5254
commit e19e48ea3f
19 changed files with 58 additions and 39 deletions

View File

@ -4,7 +4,7 @@ import React, { forwardRef, isValidElement, useEffect, useImperativeHandle, useR
import { Keyboard } from 'react-native';
import { Easing } from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import BottomSheet, { BottomSheetBackdrop } from '@gorhom/bottom-sheet';
import BottomSheet, { BottomSheetBackdrop, BottomSheetBackdropProps } from '@gorhom/bottom-sheet';
import { useDimensions, useOrientation } from '../../dimensions';
import { useTheme } from '../../theme';
@ -107,7 +107,7 @@ const ActionSheet = React.memo(
};
const renderBackdrop = useCallback(
props => (
(props: BottomSheetBackdropProps) => (
<BottomSheetBackdrop
{...props}
appearsOnIndex={0}

View File

@ -75,6 +75,7 @@ const EmojiPicker = ({
parentWidth={parentWidth}
/>
) : (
// @ts-ignore
<ScrollableTabView
renderTabBar={() => <TabBar />}
contentProps={{

View File

@ -31,7 +31,7 @@ const MentionItemContent = React.memo(({ trackingType, item }: IMessageBoxMentio
return (
<>
<MentionEmoji item={item} />
<Text style={[styles.mentionText, { color: themes[theme].titleText }]}>:{item.name || item}:</Text>
<Text style={[styles.mentionText, { color: themes[theme].titleText }]}>:{item.name ?? item}:</Text>
</>
);
case MENTIONS_TRACKING_TYPE_COMMANDS:
@ -57,7 +57,7 @@ const MentionItemContent = React.memo(({ trackingType, item }: IMessageBoxMentio
return (
<>
<Avatar style={styles.avatar} text={item.username || item.name} size={30} type={item.t} />
<Text style={[styles.mentionText, { color: themes[theme].titleText }]}>{item.username || item.name || item}</Text>
<Text style={[styles.mentionText, { color: themes[theme].titleText }]}>{item.username ?? item.name ?? item}</Text>
</>
);
}

View File

@ -976,7 +976,7 @@ class MessageBox extends Component<IMessageBoxProps, IMessageBoxState> {
const { showEmojiKeyboard } = this.state;
this.closeEmoji();
setTimeout(() => action && action(params), showEmojiKeyboard && isIOS ? TIMEOUT_CLOSE_EMOJI : null);
setTimeout(() => action && action(params), showEmojiKeyboard && isIOS ? TIMEOUT_CLOSE_EMOJI : undefined);
};
submit = async () => {

View File

@ -21,6 +21,7 @@ const ReactionsList = ({ reactions, getCustomEmoji }: IReactionsListProps): Reac
const allTabLabel = { emoji: I18n.t('All'), usernames: [], names: [], _id: 'All' };
return (
<View style={styles.container} testID='reactionsList'>
{/* @ts-ignore */}
<ScrollableTabView renderTabBar={() => <ReactionsTabBar getCustomEmoji={getCustomEmoji} />}>
<AllTab tabLabel={allTabLabel} reactions={sortedReactions} getCustomEmoji={getCustomEmoji} />
{sortedReactions?.map(reaction => (

View File

@ -17,7 +17,7 @@ const SearchBox = ({ onChangeText, onSubmitEditing, testID }: TextInputProps): J
const { colors } = useTheme();
const internalOnChangeText = useCallback(value => {
const internalOnChangeText = useCallback((value: string) => {
setText(value);
onChangeText?.(value);
}, []);

View File

@ -46,6 +46,7 @@ const Toast = (): React.ReactElement => {
ref={getToastRef}
// @ts-ignore
position='center'
// @ts-ignore
style={[styles.toast, { backgroundColor: colors.toastBackground }]}
textStyle={[styles.text, { color: colors.buttonText }]}
opacity={0.9}

View File

@ -93,6 +93,7 @@ export const DatePicker = ({ element, language, action, context, loading, value,
mode='date'
display={isAndroid ? 'default' : 'inline'}
value={currentDate}
// @ts-ignore
onChange={onChange}
textColor={themes[theme].titleText}
/>

View File

@ -1,6 +1,6 @@
import React from 'react';
import { Text, View } from 'react-native';
import Touchable from 'react-native-platform-touchable';
import Touchable, { PlatformTouchableProps } from 'react-native-platform-touchable';
import { CustomIcon } from '../../CustomIcon';
import ActivityIndicator from '../../ActivityIndicator';
@ -9,9 +9,9 @@ import { useTheme } from '../../../theme';
interface IInput {
children?: JSX.Element;
onPress: () => void;
onPress: PlatformTouchableProps['onPress'];
inputStyle?: object;
disabled?: boolean | null;
disabled?: PlatformTouchableProps['disabled'];
placeholder?: string;
loading?: boolean;
innerInputStyle?: object;

View File

@ -28,7 +28,7 @@ interface IMultiSelect {
onClose?: () => void;
inputStyle?: TextStyle;
value?: any[];
disabled?: boolean | null;
disabled?: boolean;
innerInputStyle?: object;
}

View File

@ -63,6 +63,7 @@ export const Select = ({ options = [], placeholder, onChange, loading, disabled,
);
return (
// @ts-ignore lib types issues. We need to fork it and maintain or find another lib
<RNPickerSelect
items={items}
placeholder={placeholder ? { label: textParser([placeholder]), value: null } : {}}
@ -79,8 +80,6 @@ export const Select = ({ options = [], placeholder, onChange, loading, disabled,
}}
Icon={Icon}
textInputProps={{
// style property was Omitted in lib, but can be used normally
// @ts-ignore
style: { ...styles.pickerText, color: selected ? themes[theme].titleText : themes[theme].auxiliaryText }
}}
/>

View File

@ -114,7 +114,7 @@ Button.displayName = 'MessageAudioButton';
class MessageAudio extends React.Component<IMessageAudioProps, IMessageAudioState> {
static contextType = MessageContext;
declare context: React.ContextType<typeof MessageContext>;
private sound: Sound;
constructor(props: IMessageAudioProps) {

View File

@ -39,7 +39,11 @@ import {
import ChangePasscodeView from './views/ChangePasscodeView';
import ScreenLockedView from './views/ScreenLockedView';
const KeyCommandsEmitter = {};
const KeyCommandsEmitter = {
addListener: (arg: string, cb: (command: any) => void) => {
console.log(arg, cb);
}
};
RNScreens.enableScreens();
initStore(store);

View File

@ -1,5 +1,5 @@
export default class Deferred {
[Symbol.toStringTag]: 'Promise';
// [Symbol.toStringTag]: 'Promise';
private promise: Promise<unknown>;
private _resolve: (value?: unknown) => void;

View File

@ -212,6 +212,7 @@ const createOrUpdateSubscription = async (subscription: ISubscription, room: ISe
if (messageRecord) {
batch.push(
messageRecord.prepareUpdate(() => {
// @ts-ignore
Object.assign(messageRecord, lastMessage);
})
);

View File

@ -6,6 +6,7 @@ import { SWITCH_TRACK_COLOR, themes } from '../../lib/constants';
import styles from './styles';
interface ISwitchContainer {
children?: JSX.Element | null;
value: boolean;
disabled?: boolean;
leftLabelPrimary: string;
@ -19,7 +20,7 @@ interface ISwitchContainer {
leftLabelStyle?: TextStyle;
}
const SwitchContainer: React.FC<ISwitchContainer> = React.memo(
const SwitchContainer = React.memo(
({
children,
value,
@ -33,7 +34,7 @@ const SwitchContainer: React.FC<ISwitchContainer> = React.memo(
testID,
labelContainerStyle,
leftLabelStyle
}) => (
}: ISwitchContainer) => (
<>
<View key='switch-container' style={[styles.switchContainer, !!children && styles.switchMargin]}>
{leftLabelPrimary && (

View File

@ -38,7 +38,7 @@
"dependencies": {
"@bugsnag/react-native": "^7.10.5",
"@codler/react-native-keyboard-aware-scroll-view": "^2.0.1",
"@gorhom/bottom-sheet": "^4.3.1",
"@gorhom/bottom-sheet": "^4.4.5",
"@hookform/resolvers": "^2.9.10",
"@nozbe/watermelondb": "0.23.0",
"@react-native-async-storage/async-storage": "^1.17.11",

View File

@ -0,0 +1,21 @@
diff --git a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
index 58cfac7..0fb7755 100644
--- a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
+++ b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
@@ -4,7 +4,7 @@ declare type SkeletonPlaceholderProps = {
/**
* Determines component's children.
*/
- children: JSX.Element;
+ children: JSX.Element[] | JSX.Element;
/**
* Determines the color of placeholder.
*/
@@ -33,6 +33,7 @@ declare type SkeletonPlaceholderProps = {
};
declare type SkeletonPlaceholderItemProps = ViewStyle & {
style?: StyleProp<ViewStyle>;
+ children?: JSX.Element[] | JSX.Element;
};
declare const SkeletonPlaceholder: React.FC<SkeletonPlaceholderProps> & {
Item: React.FC<SkeletonPlaceholderItemProps>;

View File

@ -4080,20 +4080,18 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
"@gorhom/bottom-sheet@^4.3.1":
version "4.3.2"
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.3.2.tgz#83de68387f54f6e3cc9419329b8e4f925a3426c8"
integrity sha512-kOnxKz3TuxbwagxhHvAyo2b1fgUCzw/Xs3OQD2lTE7vjGEdibsYnRaBxdpKKLV25VOQA6zVFmZq9apICj9foPw==
"@gorhom/bottom-sheet@^4.4.5":
version "4.4.5"
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.4.5.tgz#b9041b01ce1af9a936e7c0fc1d78f026d759eebe"
integrity sha512-Z5Z20wshLUB8lIdtMKoJaRnjd64wBR/q8EeVPThrg+skrcBwBPHfUwZJ2srB0rEszA/01ejSJy/ixyd7Ra7vUA==
dependencies:
"@gorhom/portal" "1.0.13"
"@gorhom/portal" "1.0.14"
invariant "^2.2.4"
nanoid "^3.3.3"
react-native-redash "^16.1.1"
"@gorhom/portal@1.0.13":
version "1.0.13"
resolved "https://registry.yarnpkg.com/@gorhom/portal/-/portal-1.0.13.tgz#da3af4d427e1fa68d264107de4b3072a4adf35ce"
integrity sha512-ViClKPkyGnj8HVMW45OGQSnGbWBVh8i3tgMOkGqpm6Cv0WVcDfUL7SER6zyGQy8Wdoj3GUDpAJFMqVOxpmRpzw==
"@gorhom/portal@1.0.14":
version "1.0.14"
resolved "https://registry.yarnpkg.com/@gorhom/portal/-/portal-1.0.14.tgz#1953edb76aaba80fb24021dc774550194a18e111"
integrity sha512-MXyL4xvCjmgaORr/rtryDNFy3kU4qUbKlwtQqqsygd0xX3mhKjOLn6mQK8wfu0RkoE0pBE0nAasRoHua+/QZ7A==
dependencies:
nanoid "^3.3.1"
@ -15372,7 +15370,7 @@ nanoid@^3.1.23:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35"
integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==
nanoid@^3.3.1, nanoid@^3.3.3:
nanoid@^3.3.1:
version "3.3.4"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
@ -17424,15 +17422,6 @@ react-native-redash@^12.0.3:
parse-svg-path "^0.1.2"
use-memo-one "^1.1.1"
react-native-redash@^16.1.1:
version "16.2.3"
resolved "https://registry.yarnpkg.com/react-native-redash/-/react-native-redash-16.2.3.tgz#ee63e100c60f83275116e57d4e8bc79f26349db9"
integrity sha512-vSjHA6/mBY3IpDYPish3DlG06PKNLkb/b89hw7nsDM3yxAJ7Db+yMnEL3pp2YsoYblDc3s+0+wBRlvxay4X4vQ==
dependencies:
abs-svg-path "^0.1.1"
normalize-svg-path "^1.0.1"
parse-svg-path "^0.1.2"
react-native-restart@0.0.22:
version "0.0.22"
resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.22.tgz#81fcb7f31e35951d85410c68b9556acf3ab88705"