Compare commits
1 Commits
develop
...
dependabot
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 6c081ff38d |
File diff suppressed because one or more lines are too long
|
@ -1,31 +1,34 @@
|
|||
import React from 'react';
|
||||
import { useWindowDimensions } from 'react-native';
|
||||
import { FlatList } from 'react-native-gesture-handler';
|
||||
|
||||
import { IEmoji } from '../../definitions/IEmoji';
|
||||
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
||||
import { PressableEmoji } from './PressableEmoji';
|
||||
import { EMOJI_BUTTON_SIZE } from './styles';
|
||||
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
||||
import { IEmoji } from '../../definitions/IEmoji';
|
||||
import { PressableEmoji } from './PressableEmoji';
|
||||
|
||||
interface IEmojiCategoryProps {
|
||||
emojis: IEmoji[];
|
||||
onEmojiSelected: (emoji: IEmoji) => void;
|
||||
tabLabel?: string; // needed for react-native-scrollable-tab-view only
|
||||
parentWidth: number;
|
||||
}
|
||||
|
||||
const EmojiCategory = ({ onEmojiSelected, emojis, parentWidth }: IEmojiCategoryProps): React.ReactElement | null => {
|
||||
if (!parentWidth) {
|
||||
return null;
|
||||
}
|
||||
const EmojiCategory = ({ onEmojiSelected, emojis }: IEmojiCategoryProps): React.ReactElement | null => {
|
||||
const { width } = useWindowDimensions();
|
||||
|
||||
const numColumns = Math.trunc(parentWidth / EMOJI_BUTTON_SIZE);
|
||||
const marginHorizontal = (parentWidth % EMOJI_BUTTON_SIZE) / 2;
|
||||
const numColumns = Math.trunc(width / EMOJI_BUTTON_SIZE);
|
||||
const marginHorizontal = (width % EMOJI_BUTTON_SIZE) / 2;
|
||||
|
||||
const renderItem = ({ item }: { item: IEmoji }) => <PressableEmoji emoji={item} onPress={onEmojiSelected} />;
|
||||
|
||||
if (!width) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<FlatList
|
||||
key={`emoji-category-${parentWidth}`}
|
||||
// needed to update the numColumns when the width changes
|
||||
key={`emoji-category-${width}`}
|
||||
keyExtractor={item => (typeof item === 'string' ? item : item.name)}
|
||||
data={emojis}
|
||||
renderItem={renderItem}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
|
||||
|
@ -20,8 +20,6 @@ const EmojiPicker = ({
|
|||
searchedEmojis = []
|
||||
}: IEmojiPickerProps): React.ReactElement | null => {
|
||||
const { colors } = useTheme();
|
||||
const [parentWidth, setParentWidth] = useState(0);
|
||||
|
||||
const { frequentlyUsed, loaded } = useFrequentlyUsedEmoji();
|
||||
|
||||
const allCustomEmojis: ICustomEmojis = useAppSelector(
|
||||
|
@ -52,14 +50,7 @@ const EmojiPicker = ({
|
|||
if (!emojis.length) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<EmojiCategory
|
||||
parentWidth={parentWidth}
|
||||
emojis={emojis}
|
||||
onEmojiSelected={(emoji: IEmoji) => handleEmojiSelect(emoji)}
|
||||
tabLabel={label}
|
||||
/>
|
||||
);
|
||||
return <EmojiCategory emojis={emojis} onEmojiSelected={(emoji: IEmoji) => handleEmojiSelect(emoji)} tabLabel={label} />;
|
||||
};
|
||||
|
||||
if (!loaded) {
|
||||
|
@ -67,13 +58,9 @@ const EmojiPicker = ({
|
|||
}
|
||||
|
||||
return (
|
||||
<View style={styles.emojiPickerContainer} onLayout={e => setParentWidth(e.nativeEvent.layout.width)}>
|
||||
<View style={styles.emojiPickerContainer}>
|
||||
{searching ? (
|
||||
<EmojiCategory
|
||||
emojis={searchedEmojis}
|
||||
onEmojiSelected={(emoji: IEmoji) => handleEmojiSelect(emoji)}
|
||||
parentWidth={parentWidth}
|
||||
/>
|
||||
<EmojiCategory emojis={searchedEmojis} onEmojiSelected={(emoji: IEmoji) => handleEmojiSelect(emoji)} />
|
||||
) : (
|
||||
<ScrollableTabView
|
||||
renderTabBar={() => <TabBar />}
|
||||
|
|
|
@ -53,7 +53,7 @@ const Content = React.memo(
|
|||
content = (
|
||||
<Markdown
|
||||
msg={props.msg}
|
||||
md={props.type !== 'e2e' ? props.md : undefined}
|
||||
md={props.md}
|
||||
getCustomEmoji={props.getCustomEmoji}
|
||||
enableMessageParser={user.enableMessageParserEarlyAdoption}
|
||||
username={user.username}
|
||||
|
|
|
@ -18,7 +18,7 @@ const MessageAvatar = React.memo(({ isHeader, avatar, author, small, navToRoomIn
|
|||
style={small ? styles.avatarSmall : styles.avatar}
|
||||
text={avatar ? '' : author.username}
|
||||
size={small ? 20 : 36}
|
||||
borderRadius={4}
|
||||
borderRadius={small ? 2 : 4}
|
||||
onPress={author._id === user.id ? undefined : () => navToRoomInfo(navParam)}
|
||||
getCustomEmoji={getCustomEmoji}
|
||||
avatar={avatar}
|
||||
|
|
|
@ -247,8 +247,6 @@ const Reply = React.memo(
|
|||
>
|
||||
<View style={styles.attachmentContainer}>
|
||||
<Title attachment={attachment} timeFormat={timeFormat} theme={theme} />
|
||||
<Description attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||
<UrlImage image={attachment.thumb_url} />
|
||||
<Attachments
|
||||
attachments={attachment.attachments}
|
||||
getCustomEmoji={getCustomEmoji}
|
||||
|
@ -257,6 +255,8 @@ const Reply = React.memo(
|
|||
isReply
|
||||
id={messageId}
|
||||
/>
|
||||
<UrlImage image={attachment.thumb_url} />
|
||||
<Description attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||
<Fields attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||
{loading ? (
|
||||
<View style={[styles.backdrop]}>
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
"@react-native-community/picker": "^1.8.1",
|
||||
"@react-native-community/slider": "4.2.2",
|
||||
"@react-native-cookies/cookies": "6.2.1",
|
||||
"@react-native-firebase/analytics": "^14.11.0",
|
||||
"@react-native-firebase/app": "^14.11.0",
|
||||
"@react-native-firebase/crashlytics": "^14.11.0",
|
||||
"@react-native-firebase/analytics": "^17.3.2",
|
||||
"@react-native-firebase/app": "^17.3.2",
|
||||
"@react-native-firebase/crashlytics": "^17.3.2",
|
||||
"@react-native-masked-view/masked-view": "^0.2.8",
|
||||
"@react-navigation/drawer": "6.4.1",
|
||||
"@react-navigation/elements": "^1.3.6",
|
||||
|
|
45
yarn.lock
45
yarn.lock
|
@ -3839,7 +3839,7 @@
|
|||
node-forge "^1.2.1"
|
||||
nullthrows "^1.1.1"
|
||||
|
||||
"@expo/config-plugins@^4.0.14", "@expo/config-plugins@^4.1.5":
|
||||
"@expo/config-plugins@^4.0.14":
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-4.1.5.tgz#9d357d2cda9c095e511b51583ede8a3b76174068"
|
||||
integrity sha512-RVvU40RtZt12HavuDAe+LDIq9lHj7sheOfMEHdmpJ/uTA8pgvkbc56XF6JHQD+yRr6+uhhb+JnAasGq49dsQbw==
|
||||
|
@ -3860,12 +3860,12 @@
|
|||
xcode "^3.0.1"
|
||||
xml2js "0.4.23"
|
||||
|
||||
"@expo/config-plugins@~5.0.0", "@expo/config-plugins@~5.0.1":
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-5.0.1.tgz#66bc8d15785bdcd3598e466344f8c0518390179d"
|
||||
integrity sha512-1OfnsOrfeSkB0VZfT01UjQ5Uq6p+yYbq8yNkj0e99K/6NLHpyvIxj+5tZIV0nQXgkOcqBIABL2uA7lwB8CkaBQ==
|
||||
"@expo/config-plugins@^5.0.4", "@expo/config-plugins@~5.0.0", "@expo/config-plugins@~5.0.1":
|
||||
version "5.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-5.0.4.tgz#216fea6558fe66615af1370de55193f4181cb23e"
|
||||
integrity sha512-vzUcVpqOMs3h+hyRdhGwk+eGIOhXa5xYdd92yO17RMNHav3v/+ekMbs7XA2c3lepMO8Yd4/5hqmRw9ZTL6jGzg==
|
||||
dependencies:
|
||||
"@expo/config-types" "^46.0.0"
|
||||
"@expo/config-types" "^47.0.0"
|
||||
"@expo/json-file" "8.2.36"
|
||||
"@expo/plist" "0.0.18"
|
||||
"@expo/sdk-runtime-versions" "^1.0.0"
|
||||
|
@ -3891,6 +3891,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-46.0.2.tgz#191f225ebfcbe624868ddc40efae79593f948dd8"
|
||||
integrity sha512-PXkmOgNwRyBfgVT1HmFZhfh3Qm7WKKyV6mk3/5HJ/LzPh1t+Zs2JrWX8U2YncTLV1QzV7nV8tnkyvszzqnZEzQ==
|
||||
|
||||
"@expo/config-types@^47.0.0":
|
||||
version "47.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-47.0.0.tgz#99eeabe0bba7a776e0f252b78beb0c574692c38d"
|
||||
integrity sha512-r0pWfuhkv7KIcXMUiNACJmJKKwlTBGMw9VZHNdppS8/0Nve8HZMTkNRFQzTHW1uH3pBj8jEXpyw/2vSWDHex9g==
|
||||
|
||||
"@expo/config@7.0.1", "@expo/config@~7.0.0", "@expo/config@~7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@expo/config/-/config-7.0.1.tgz#d8e2e5410bb0b8e305690bbc76e6bb76f6a6de31"
|
||||
|
@ -5208,26 +5213,26 @@
|
|||
dependencies:
|
||||
invariant "^2.2.4"
|
||||
|
||||
"@react-native-firebase/analytics@^14.11.0":
|
||||
version "14.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/analytics/-/analytics-14.11.0.tgz#99a3bb96f0ed6362907a120a40489f9a8bcf9ccd"
|
||||
integrity sha512-hYc2avm4S1vicBdKLtBif87SFGru85LOMPqDblC9GM7cGFRR5WlkOiECvNTzzs+a5Jrfq1zPJsK1YQKxD7CRfQ==
|
||||
"@react-native-firebase/analytics@^17.3.2":
|
||||
version "17.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/analytics/-/analytics-17.3.2.tgz#31ddb8b349f073b540d6e15ac2c4216439b39390"
|
||||
integrity sha512-xjgH5QFmVDHpaxxndhGMXhMFBizNg9Rkr5ukeWIMeR/K6Shi/xGVoomjn/PmgoCZWIjX3EJkokXSxsntMlh+Vg==
|
||||
|
||||
"@react-native-firebase/app@^14.11.0":
|
||||
version "14.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/app/-/app-14.11.0.tgz#41b1b7d41f51b6880ebad6a12ff87c85bcdab0d6"
|
||||
integrity sha512-LzqgZNx+WcNGYRZG6LB9BkJAx4LE+LsbPF9p65TMSagWYd/iJafoXl4d6KWQeUMIFZQH7Ke/eJ/fIZkc+4eMRw==
|
||||
"@react-native-firebase/app@^17.3.2":
|
||||
version "17.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/app/-/app-17.3.2.tgz#c39dd34f5389ff65845c5d67313bbf2371275a8f"
|
||||
integrity sha512-JPA9PuD3il2/FERnsW5bC/PbXdcBcVMtk4V0vL8YgLh+jQg+E3qQTQmeWn9eOWTYJb6BYOiiNHTdTglvqoo5Cg==
|
||||
dependencies:
|
||||
"@expo/config-plugins" "^4.1.5"
|
||||
"@expo/config-plugins" "^5.0.4"
|
||||
opencollective-postinstall "^2.0.1"
|
||||
superstruct "^0.6.2"
|
||||
|
||||
"@react-native-firebase/crashlytics@^14.11.0":
|
||||
version "14.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/crashlytics/-/crashlytics-14.11.0.tgz#73c9c02154b50bcb34b77d67c7f5e0393ec2ae2e"
|
||||
integrity sha512-HNLJE+XvMt7dNvV5n+M+tDv7n9xER050KtayJoKjzkyFTyPTQzf1IEKqckSZS1PHSG+Sqcbe2nfoMF2GwNAAhA==
|
||||
"@react-native-firebase/crashlytics@^17.3.2":
|
||||
version "17.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-firebase/crashlytics/-/crashlytics-17.3.2.tgz#3d3a6177e16a0234ee4c7c0735eaa228d8e23c50"
|
||||
integrity sha512-kmb42rHfwLGMe0pAWTwaZR++RlE1AkOWQh70qasLIkPnhxo25e5DqwKWqqkAQ6eSWmG3bpY/b9AN04VmuxEXfQ==
|
||||
dependencies:
|
||||
"@expo/config-plugins" "^4.1.5"
|
||||
"@expo/config-plugins" "^5.0.4"
|
||||
stacktrace-js "^2.0.0"
|
||||
|
||||
"@react-native-masked-view/masked-view@^0.2.8":
|
||||
|
|
Loading…
Reference in New Issue