forked from Ivasoft/mattermost-mobile
feedback review
This commit is contained in:
@@ -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<void> {
|
||||
const operator = DatabaseManager.serverDatabases[serverUrl]?.operator;
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
};
|
||||
@@ -14,9 +14,6 @@ type Props = {
|
||||
|
||||
const style = StyleSheet.create({
|
||||
container: {
|
||||
paddingVertical: 0,
|
||||
paddingHorizontal: 0,
|
||||
paddingTop: 0,
|
||||
marginBottom: 8,
|
||||
},
|
||||
});
|
||||
|
||||
1
types/api/users.d.ts
vendored
1
types/api/users.d.ts
vendored
@@ -43,7 +43,6 @@ type UserProfile = {
|
||||
last_picture_update: number;
|
||||
remote_id?: string;
|
||||
status?: string;
|
||||
remote_id?: string;
|
||||
};
|
||||
|
||||
type UsersState = {
|
||||
|
||||
Reference in New Issue
Block a user