diff --git a/app/screens/post_options/components/options/base_option.tsx b/app/screens/post_options/options/base_option.tsx similarity index 100% rename from app/screens/post_options/components/options/base_option.tsx rename to app/screens/post_options/options/base_option.tsx diff --git a/app/screens/post_options/components/options/copy_permalink_option/copy_permalink_option.tsx b/app/screens/post_options/options/copy_permalink_option/copy_permalink_option.tsx similarity index 100% rename from app/screens/post_options/components/options/copy_permalink_option/copy_permalink_option.tsx rename to app/screens/post_options/options/copy_permalink_option/copy_permalink_option.tsx diff --git a/app/screens/post_options/components/options/copy_permalink_option/index.tsx b/app/screens/post_options/options/copy_permalink_option/index.tsx similarity index 96% rename from app/screens/post_options/components/options/copy_permalink_option/index.tsx rename to app/screens/post_options/options/copy_permalink_option/index.tsx index 9c7f992f0..acc53520d 100644 --- a/app/screens/post_options/components/options/copy_permalink_option/index.tsx +++ b/app/screens/post_options/options/copy_permalink_option/index.tsx @@ -4,7 +4,7 @@ import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider'; import withObservables from '@nozbe/with-observables'; import {combineLatest, of as of$} from 'rxjs'; -import {switchMap} from 'rxjs/dist/types/operators'; +import {switchMap} from 'rxjs/operators'; import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database'; diff --git a/app/screens/post_options/components/options/copy_text_option.tsx b/app/screens/post_options/options/copy_text_option.tsx similarity index 100% rename from app/screens/post_options/components/options/copy_text_option.tsx rename to app/screens/post_options/options/copy_text_option.tsx diff --git a/app/screens/post_options/components/options/delete_post_option.tsx b/app/screens/post_options/options/delete_post_option.tsx similarity index 100% rename from app/screens/post_options/components/options/delete_post_option.tsx rename to app/screens/post_options/options/delete_post_option.tsx diff --git a/app/screens/post_options/components/options/edit_option.tsx b/app/screens/post_options/options/edit_option.tsx similarity index 100% rename from app/screens/post_options/components/options/edit_option.tsx rename to app/screens/post_options/options/edit_option.tsx diff --git a/app/screens/post_options/components/options/follow_option.tsx b/app/screens/post_options/options/follow_option.tsx similarity index 100% rename from app/screens/post_options/components/options/follow_option.tsx rename to app/screens/post_options/options/follow_option.tsx diff --git a/app/screens/post_options/components/options/mark_unread_option.tsx b/app/screens/post_options/options/mark_unread_option.tsx similarity index 100% rename from app/screens/post_options/components/options/mark_unread_option.tsx rename to app/screens/post_options/options/mark_unread_option.tsx diff --git a/app/screens/post_options/components/options/pin_channel_option.tsx b/app/screens/post_options/options/pin_channel_option.tsx similarity index 100% rename from app/screens/post_options/components/options/pin_channel_option.tsx rename to app/screens/post_options/options/pin_channel_option.tsx diff --git a/app/screens/post_options/components/options/reply_option.tsx b/app/screens/post_options/options/reply_option.tsx similarity index 100% rename from app/screens/post_options/components/options/reply_option.tsx rename to app/screens/post_options/options/reply_option.tsx diff --git a/app/screens/post_options/components/options/save_option.tsx b/app/screens/post_options/options/save_option.tsx similarity index 100% rename from app/screens/post_options/components/options/save_option.tsx rename to app/screens/post_options/options/save_option.tsx diff --git a/app/screens/post_options/post_options.tsx b/app/screens/post_options/post_options.tsx index ade67f6b7..1e3deaf82 100644 --- a/app/screens/post_options/post_options.tsx +++ b/app/screens/post_options/post_options.tsx @@ -9,16 +9,16 @@ import {Screens} from '@constants'; import BottomSheet from '@screens/bottom_sheet'; import {isSystemMessage} from '@utils/post'; -import CopyLinkOption from './components/options/copy_permalink_option'; -import CopyTextOption from './components/options/copy_text_option'; -import DeletePostOption from './components/options/delete_post_option'; -import EditOption from './components/options/edit_option'; -import FollowThreadOption from './components/options/follow_option'; -import MarkAsUnreadOption from './components/options/mark_unread_option'; -import PinChannelOption from './components/options/pin_channel_option'; -import ReplyOption from './components/options/reply_option'; -import SaveOption from './components/options/save_option'; -import ReactionBar from './components/reaction_bar'; +import CopyLinkOption from './options/copy_permalink_option'; +import CopyTextOption from './options/copy_text_option'; +import DeletePostOption from './options/delete_post_option'; +import EditOption from './options/edit_option'; +import FollowThreadOption from './options/follow_option'; +import MarkAsUnreadOption from './options/mark_unread_option'; +import PinChannelOption from './options/pin_channel_option'; +import ReplyOption from './options/reply_option'; +import SaveOption from './options/save_option'; +import ReactionBar from './reaction_bar'; import type PostModel from '@typings/database/models/servers/post'; @@ -66,7 +66,7 @@ const PostOptions = ({ const renderContent = () => { return ( <> - {canAddReaction && } + {canAddReaction && } {canReply && } {shouldRenderFollow && { @@ -38,17 +41,18 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }; }); -const ReactionBar = ({recentEmojis = []}: QuickReactionProps) => { +const ReactionBar = ({recentEmojis = [], postId}: QuickReactionProps) => { const theme = useTheme(); const intl = useIntl(); const {width} = useWindowDimensions(); + const serverUrl = useServerUrl(); const isSmallDevice = width < SMALL_ICON_BREAKPOINT; const styles = getStyleSheet(theme); const handleEmojiPress = useCallback((emoji: string) => { - // eslint-disable-next-line no-console - console.log('>>> selected this emoji', emoji); - }, []); + addReaction(serverUrl, postId, emoji); + dismissBottomSheet(Screens.POST_OPTIONS); + }, [postId, serverUrl]); const openEmojiPicker = useCallback(async () => { await dismissBottomSheet(Screens.POST_OPTIONS);