Skip to content

Commit f622d83

Browse files
committed
chore: fixed review comments
1 parent 74bf6f2 commit f622d83

File tree

29 files changed

+116
-100
lines changed

29 files changed

+116
-100
lines changed

src/navigation/Main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {ChannelPostHighlight} from '@screens/ChatFlow/Channel/components/Channel
3333
import {Explore} from '@screens/ChatFlow/Explore';
3434
import {Messages} from '@screens/ChatFlow/Messages';
3535
import {NewChatSelector} from '@screens/ChatFlow/NewChatSelector';
36-
import {EmojiSelector} from '@screens/EmojiSelector';
3736
import {BalanceHistory} from '@screens/HomeFlow/BalanceHistory';
3837
import {Home} from '@screens/HomeFlow/Home';
3938
import {
@@ -57,6 +56,7 @@ import {
5756
} from '@screens/Modals/ContextualMenu/types';
5857
import {CountrySelect} from '@screens/Modals/CountrySelect';
5958
import {DateSelect} from '@screens/Modals/DateSelector';
59+
import {EmojiSelector} from '@screens/modals/EmojiSelector';
6060
import {JoinTelegramPopUp} from '@screens/Modals/JoinTelegramPopUp';
6161
import {PopUp, PopUpProps} from '@screens/Modals/PopUp';
6262
import {ProfilePrivacyEditStep1} from '@screens/Modals/ProfilePrivacyEdit/step1';

src/screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/components/PostEmojiBar/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: ice License 1.0
22

3+
import {Touchable} from '@components/Touchable';
34
import {COLORS} from '@constants/colors';
45
import {DEFAULT_EMOJIS} from '@screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/components/PostEmojiBar/constants';
56
import {useEmojiBarHandlers} from '@screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/components/PostEmojiBar/hooks/useEmojiBarHandlers';
@@ -12,7 +13,7 @@ import {PlusIcon} from '@svg/PlusIcon';
1213
import {formatNumber} from '@utils/numbers';
1314
import {font} from '@utils/styles';
1415
import * as React from 'react';
15-
import {Pressable, StyleSheet, Text} from 'react-native';
16+
import {StyleSheet, Text} from 'react-native';
1617
import {ScrollView} from 'react-native-gesture-handler';
1718
import {rem} from 'rn-units';
1819

@@ -37,7 +38,7 @@ export function PostEmojiBar({postData, updatePostData}: Props) {
3738
showsHorizontalScrollIndicator={false}
3839
contentContainerStyle={styles.container}>
3940
{getDisplayEmojis(emojis).map((emoji: string) => (
40-
<Pressable
41+
<Touchable
4142
key={emoji}
4243
onPress={() => onEmojiPressed(emoji)}
4344
style={[
@@ -56,14 +57,14 @@ export function PostEmojiBar({postData, updatePostData}: Props) {
5657
})}
5758
</Text>
5859
) : null}
59-
</Pressable>
60+
</Touchable>
6061
))}
61-
<Pressable
62+
<Touchable
6263
key={'+'}
6364
style={[styles.emojiContainer, styles.plusContainer]}
6465
onPress={onShowEmojiSelector}>
6566
<PlusIcon width={rem(24)} height={rem(25)} />
66-
</Pressable>
67+
</Touchable>
6768
</ScrollView>
6869
);
6970
}

src/screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: ice License 1.0
22

3+
import {Touchable} from '@components/Touchable';
34
import {COLORS} from '@constants/colors';
45
import {MainStackParamList} from '@navigation/Main';
56
import {useNavigation} from '@react-navigation/native';
@@ -16,7 +17,7 @@ import {PostReplySection} from '@screens/ChatFlow/Channel/components/ChannelFeed
1617
import {PostText} from '@screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/components/PostText';
1718
import {ChannelPostData} from '@screens/ChatFlow/Channel/components/ChannelFeed/type';
1819
import * as React from 'react';
19-
import {LayoutChangeEvent, Pressable, StyleSheet, View} from 'react-native';
20+
import {LayoutChangeEvent, StyleSheet, View} from 'react-native';
2021
import {rem} from 'rn-units';
2122

2223
type Props = {
@@ -47,7 +48,7 @@ export function ChannelPost({
4748
});
4849
};
4950
return (
50-
<Pressable
51+
<Touchable
5152
key={postData.id}
5253
style={[styles.container, darkMode ? styles.darkModeBackground : null]}
5354
onLongPress={onLongPress}>
@@ -63,7 +64,7 @@ export function ChannelPost({
6364
<PostEmojiBar postData={postData} updatePostData={updatePostData} />
6465
</View>
6566
<PostCommentsSection postData={postData} />
66-
</Pressable>
67+
</Touchable>
6768
);
6869
}
6970

src/screens/ChatFlow/Channel/components/ChannelFeed/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
updatePostById,
1313
} from '@screens/ChatFlow/Channel/components/ChannelFeed/utils';
1414
import {useLoadChannelData} from '@screens/ChatFlow/Channel/hooks/useLoadChannelData';
15-
import {initEmojiData} from '@screens/EmojiSelector/data';
15+
import {initEmojiData} from '@screens/modals/EmojiSelector/data';
1616
import {ExploreData} from '@store/modules/Chats/types';
1717
import * as React from 'react';
1818
import {useCallback, useRef} from 'react';

src/screens/ChatFlow/Channel/components/ChannelHeader/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {CandyBoxMenuIcon} from '@svg/CandyBoxMenuIcon';
1111
import {ChevronIcon} from '@svg/ChevronIcon';
1212
import {mirrorTransform} from '@utils/styles';
1313
import * as React from 'react';
14-
import {Pressable, StyleSheet, View} from 'react-native';
14+
import {StyleSheet, View} from 'react-native';
1515
import {rem} from 'rn-units';
1616

1717
type Props = {
@@ -26,12 +26,12 @@ export function ChannelHeader({channelData}: Props) {
2626
return (
2727
<View style={topOffset.current}>
2828
<View style={styles.container}>
29-
<Pressable
29+
<Touchable
3030
hitSlop={HIT_SLOP}
3131
style={styles.chevronIconContainer}
3232
onPress={navigation.goBack}>
3333
<ChevronIcon color={COLORS.primaryDark} style={styles.chevronIcon} />
34-
</Pressable>
34+
</Touchable>
3535
<ExploreRow headerMode exploreData={channelData} />
3636
<Touchable hitSlop={HIT_SLOP} style={styles.menuIconContainer}>
3737
<CandyBoxMenuIcon stroke={COLORS.primaryDark} />

src/screens/ChatFlow/Channel/components/ChannelPostHighlight/components/ContextEmojiBar/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: ice License 1.0
22

3+
import {Touchable} from '@components/Touchable';
34
import {COLORS} from '@constants/colors';
45
import {SCREEN_SIDE_OFFSET, windowWidth} from '@constants/styles';
56
import {DEFAULT_EMOJIS} from '@screens/ChatFlow/Channel/components/ChannelFeed/ChannelPost/components/PostEmojiBar/constants';
@@ -10,7 +11,7 @@ import {PlusIcon} from '@svg/PlusIcon';
1011
import {font} from '@utils/styles';
1112
import * as React from 'react';
1213
import {useState} from 'react';
13-
import {Pressable, StyleSheet, Text} from 'react-native';
14+
import {StyleSheet, Text} from 'react-native';
1415
import {ScrollView} from 'react-native-gesture-handler';
1516
import Animated, {BounceIn} from 'react-native-reanimated';
1617
import {rem} from 'rn-units';
@@ -34,7 +35,7 @@ export function ContextEmojiBar({postData, updatePostData}: Props) {
3435
contentContainerStyle={styles.contentContainer}>
3536
{DEFAULT_EMOJIS.map((emoji: string, index: number) => (
3637
<Animated.View key={emoji} entering={BounceIn.delay(100 * (index + 1))}>
37-
<Pressable
38+
<Touchable
3839
onPress={() => {
3940
setPressedEmoji(emoji);
4041
onEmojiPressed(emoji);
@@ -50,10 +51,10 @@ export function ContextEmojiBar({postData, updatePostData}: Props) {
5051
]}>
5152
{emoji}
5253
</Text>
53-
</Pressable>
54+
</Touchable>
5455
</Animated.View>
5556
))}
56-
<Pressable
57+
<Touchable
5758
key={'+'}
5859
style={[styles.emojiContainer, styles.plusContainer]}
5960
onPress={onShowEmojiSelector}>
@@ -62,7 +63,7 @@ export function ContextEmojiBar({postData, updatePostData}: Props) {
6263
height={rem(25)}
6364
color={COLORS.primaryLight}
6465
/>
65-
</Pressable>
66+
</Touchable>
6667
</ScrollView>
6768
);
6869
}

src/screens/ChatFlow/Channel/components/ChannelPostHighlight/components/ContextMenu/index.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ export function ContextMenu({postData}: Props) {
2828
const navigation =
2929
useNavigation<NativeStackNavigationProp<MainStackParamList>>();
3030

31+
const onCopyText = () => {
32+
Clipboard.setString(
33+
postData.postText ??
34+
postData.postCaption ??
35+
postData.postEmoji ??
36+
postData.postLink?.shortDescription ??
37+
postData.postFile?.fileName ??
38+
'',
39+
);
40+
navigation.goBack();
41+
};
42+
43+
const onCopyLink = () => {
44+
Clipboard.setString(`${ENV.DEEPLINK_SCHEME}://post?id=${postData.id}`);
45+
navigation.goBack();
46+
};
47+
3148
return (
3249
<View>
3350
<RoundedTriangle
@@ -42,7 +59,7 @@ export function ContextMenu({postData}: Props) {
4259
icon={<ReplyToIcon color={COLORS.primaryDark} />}
4360
action={() => {}}
4461
/>
45-
<View style={styles.delimeter} />
62+
<View style={styles.delimiter} />
4663
<ContextMenuAction
4764
title={'Edit'}
4865
icon={
@@ -55,7 +72,7 @@ export function ContextMenu({postData}: Props) {
5572
}
5673
action={() => {}}
5774
/>
58-
<View style={styles.delimeter} />
75+
<View style={styles.delimiter} />
5976
<ContextMenuAction
6077
title={'Copy text'}
6178
icon={
@@ -65,42 +82,27 @@ export function ContextMenu({postData}: Props) {
6582
color={COLORS.primaryDark}
6683
/>
6784
}
68-
action={() => {
69-
Clipboard.setString(
70-
postData.postText ??
71-
postData.postCaption ??
72-
postData.postEmoji ??
73-
postData.postLink?.shortDescription ??
74-
postData.postFile?.fileName ??
75-
'',
76-
);
77-
navigation.goBack();
78-
}}
85+
action={onCopyText}
7986
/>
80-
<View style={styles.delimeter} />
87+
<View style={styles.delimiter} />
8188
<ContextMenuAction
8289
title={'Copy link'}
8390
icon={<CopyLinkIcon color={COLORS.primaryDark} />}
84-
action={() => {
85-
Clipboard.setString(
86-
`${ENV.DEEPLINK_SCHEME}://post?id=${postData.id}`,
87-
);
88-
navigation.goBack();
89-
}}
91+
action={onCopyLink}
9092
/>
91-
<View style={styles.delimeter} />
93+
<View style={styles.delimiter} />
9294
<ContextMenuAction
9395
title={'Report'}
9496
icon={<ReportIcon color={COLORS.primaryDark} />}
9597
action={() => {}}
9698
/>
97-
<View style={styles.delimeter} />
99+
<View style={styles.delimiter} />
98100
<ContextMenuAction
99101
title={'Select'}
100102
icon={<SelectIcon color={COLORS.primaryDark} />}
101103
action={() => {}}
102104
/>
103-
<View style={styles.delimeter} />
105+
<View style={styles.delimiter} />
104106
<ContextMenuAction
105107
isDangerous
106108
title={'Delete'}
@@ -118,7 +120,7 @@ const styles = StyleSheet.create({
118120
borderRadius: rem(20),
119121
overflow: 'hidden',
120122
},
121-
delimeter: {
123+
delimiter: {
122124
borderTopWidth: 1,
123125
borderTopColor: COLORS.secondaryFaint,
124126
},

src/screens/ChatFlow/Channel/components/ChannelPostHighlight/components/ContextMenuAction/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: ice License 1.0
22

3+
import {Touchable} from '@components/Touchable';
34
import {COLORS} from '@constants/colors';
45
import {font} from '@utils/styles';
56
import * as React from 'react';
6-
import {Pressable, StyleSheet, Text} from 'react-native';
7+
import {StyleSheet, Text} from 'react-native';
78
import {rem} from 'rn-units';
89

910
type Props = {
@@ -15,13 +16,13 @@ type Props = {
1516

1617
export function ContextMenuAction({title, icon, action, isDangerous}: Props) {
1718
return (
18-
<Pressable style={styles.container} onPress={action}>
19+
<Touchable style={styles.container} onPress={action}>
1920
<Text
2021
style={[styles.title, isDangerous ? styles.dangerousActionText : null]}>
2122
{title}
2223
</Text>
2324
{icon}
24-
</Pressable>
25+
</Touchable>
2526
);
2627
}
2728

src/screens/ChatFlow/Channel/components/ChannelPostHighlight/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: ice License 1.0
22

33
import {stopPropagation} from '@components/KeyboardDismiss';
4+
import {Touchable} from '@components/Touchable';
45
import {COLORS} from '@constants/colors';
56
import {commonStyles, SCREEN_SIDE_OFFSET, windowWidth} from '@constants/styles';
67
import {useTopOffsetStyle} from '@navigation/hooks/useTopOffsetStyle';
@@ -17,7 +18,6 @@ import {
1718
InteractionManager,
1819
LayoutChangeEvent,
1920
LayoutRectangle,
20-
Pressable,
2121
StyleSheet,
2222
View,
2323
} from 'react-native';
@@ -50,7 +50,7 @@ export function ChannelPostHighlight() {
5050
}, []);
5151

5252
return (
53-
<Pressable
53+
<Touchable
5454
style={[styles.container, topOffset.current]}
5555
onPress={navigation.goBack}>
5656
<ScrollView
@@ -99,7 +99,7 @@ export function ChannelPostHighlight() {
9999
<ContextMenu postData={postData} />
100100
</Animated.View>
101101
</ScrollView>
102-
</Pressable>
102+
</Touchable>
103103
);
104104
}
105105

src/screens/ChatFlow/Explore/components/ExploreFilterTile/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: ice License 1.0
22

3+
import {Touchable} from '@components/Touchable';
34
import {COLORS} from '@constants/colors';
45
import {ExploreFilterType} from '@screens/ChatFlow/Explore/types';
56
import {ChannelIcon} from '@svg/ChannelIcon';
@@ -8,7 +9,7 @@ import {TeamActiveIcon} from '@svg/TeamActiveIcon';
89
import {t} from '@translations/i18n';
910
import {font} from '@utils/styles';
1011
import * as React from 'react';
11-
import {Pressable, StyleSheet, Text, View} from 'react-native';
12+
import {StyleSheet, Text, View} from 'react-native';
1213
import {rem} from 'rn-units';
1314

1415
type Props = {
@@ -64,14 +65,14 @@ function getFilterTypeTitle(filterType: ExploreFilterType) {
6465

6566
export function ExploreFilterTile({onPress, filterType, selected}: Props) {
6667
return (
67-
<Pressable
68+
<Touchable
6869
style={[styles.container, selected && styles.selectedContainer]}
6970
onPress={onPress}>
7071
<View style={[styles.iconContainer, getFilterTypeIconStyle(filterType)]}>
7172
{getFilterTypeIcon(filterType)}
7273
</View>
7374
<Text style={styles.title}>{getFilterTypeTitle(filterType)}</Text>
74-
</Pressable>
75+
</Touchable>
7576
);
7677
}
7778

0 commit comments

Comments
 (0)