diff --git a/app/actions/websocket/reactions.ts b/app/actions/websocket/reactions.ts index fe3bc8c5c4..d922429b3d 100644 --- a/app/actions/websocket/reactions.ts +++ b/app/actions/websocket/reactions.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import DatabaseManager from '@database/manager'; -import {queryReaction} from '@queries/servers/reactions'; +import {queryReaction} from '@queries/servers/reaction'; export async function handleAddCustomEmoji(serverUrl: string, msg: WebSocketMessage): Promise { const operator = DatabaseManager.serverDatabases[serverUrl]?.operator; diff --git a/app/components/post_list/post/body/reactions/reaction.tsx b/app/components/post_list/post/body/reactions/reaction.tsx index 087c17cef1..7527ff0e17 100644 --- a/app/components/post_list/post/body/reactions/reaction.tsx +++ b/app/components/post_list/post/body/reactions/reaction.tsx @@ -18,6 +18,9 @@ type ReactionProps = { theme: Theme; } +const MIN_WIDTH = 50; +const DIGIT_WIDTH = 5; + const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { count: { @@ -44,7 +47,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { justifyContent: 'center', marginBottom: 12, marginRight: 8, - minWidth: 50, + minWidth: MIN_WIDTH, }, }; }); @@ -53,7 +56,7 @@ const Reaction = ({count, emojiName, highlight, onPress, onLongPress, theme}: Re const styles = getStyleSheet(theme); const digits = String(count).length; const containerStyle = useMemo(() => { - const minWidth = 50 + (digits * 5); + const minWidth = MIN_WIDTH + (digits * DIGIT_WIDTH); return [styles.reaction, (highlight && styles.highlight), {minWidth}]; }, [styles.reaction, highlight, digits]); diff --git a/app/queries/servers/reactions.ts b/app/queries/servers/reactions.ts deleted file mode 100644 index 8b71766184..0000000000 --- a/app/queries/servers/reactions.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -import {Database, Q} from '@nozbe/watermelondb'; - -import {MM_TABLES} from '@constants/database'; -const {SERVER: {REACTION}} = MM_TABLES; - -export const queryReaction = (database: Database, emojiName: string, postId: string, userId: string) => { - return database.get(REACTION).query( - Q.where('emoji_name', emojiName), - Q.where('post_id', postId), - Q.where('user_id', userId), - ); -}; diff --git a/app/screens/reactions/reactors_list/reactor/reactor.tsx b/app/screens/reactions/reactors_list/reactor/reactor.tsx index ab59b878eb..80518f7717 100644 --- a/app/screens/reactions/reactors_list/reactor/reactor.tsx +++ b/app/screens/reactions/reactors_list/reactor/reactor.tsx @@ -14,9 +14,6 @@ type Props = { const style = StyleSheet.create({ container: { - paddingVertical: 0, - paddingHorizontal: 0, - paddingTop: 0, marginBottom: 8, }, }); diff --git a/types/api/users.d.ts b/types/api/users.d.ts index 465972da2e..09be2f8073 100644 --- a/types/api/users.d.ts +++ b/types/api/users.d.ts @@ -43,7 +43,6 @@ type UserProfile = { last_picture_update: number; remote_id?: string; status?: string; - remote_id?: string; }; type UsersState = {