Minor tweaks

This commit is contained in:
Gerzon Z 2021-10-29 11:56:57 -04:00
parent 47f7ee8c91
commit ffb17d603e
4 changed files with 5 additions and 5 deletions

View File

@ -102,11 +102,11 @@ const MessageTouchable = React.memo((props: IMessageTouchable & IMessage) => {
</View> </View>
); );
} }
const { onPress, onLongPress } = useContext(MessageContext); const { onPress, onLongPress, onDiscussionPress } = useContext(MessageContext);
return ( return (
<Touchable <Touchable
onLongPress={onLongPress} onLongPress={onLongPress}
onPress={onPress} onPress={() => (props.type !== 'discussion-created' ? onPress() : onDiscussionPress())}
disabled={(props.isInfo && !props.isThreadReply) || props.archived || props.isTemp} disabled={(props.isInfo && !props.isThreadReply) || props.archived || props.isTemp}
style={{ backgroundColor: props.highlighted ? themes[props.theme].headerBackground : null }}> style={{ backgroundColor: props.highlighted ? themes[props.theme].headerBackground : null }}>
<View> <View>

View File

@ -138,7 +138,7 @@ export interface IMessageInner
IMessageThread, IMessageThread,
IMessageAttachments, IMessageAttachments,
IMessageBroadcast { IMessageBroadcast {
type: string; type: 'discussion-created' | 'jitsi_call_started' | 'c' | 'd' | 'p' | 'l';
blocks: []; blocks: [];
} }

View File

@ -12,7 +12,7 @@ interface IThemeContextProps {
export const ThemeContext = React.createContext<IThemeContextProps>({ theme: 'light' }); export const ThemeContext = React.createContext<IThemeContextProps>({ theme: 'light' });
export function withTheme(Component: React.ComponentType<any>): (props: any) => JSX.Element { export function withTheme<P extends object>(Component: React.ComponentType<P>): (props: any) => JSX.Element {
const ThemedComponent = (props: any) => ( const ThemedComponent = (props: any) => (
<ThemeContext.Consumer>{contexts => <Component {...props} {...contexts} />}</ThemeContext.Consumer> <ThemeContext.Consumer>{contexts => <Component {...props} {...contexts} />}</ThemeContext.Consumer>
); );

View File

@ -179,7 +179,7 @@ const DiscussionsView = ({ navigation, route }: IDiscussionsViewProps): JSX.Elem
rid: item.drid, rid: item.drid,
prid: item.rid, prid: item.rid,
name: item.msg, name: item.msg,
t: 'p' t: 'c'
}); });
}, },
1000, 1000,